pub fn instantiate_trait_ref<'tcx,AC,RS>(this: &AC,
                                         rscope: &RS,
                                         ast_trait_ref: &ast::TraitRef,
                                         self_ty: Option<Ty<'tcx>>)
                                         -> Rc<ty::TraitRef<'tcx>>
                                         where AC: AstConv<'tcx>,
                                               RS: RegionScope
{
    match ::lookup_def_tcx(this.tcx(),
                           ast_trait_ref.path.span,
                           ast_trait_ref.ref_id) {
        def::DefTrait(trait_def_id) => {
            let trait_ref = Rc::new(ast_path_to_trait_ref(this, rscope, trait_def_id,
                                                          self_ty, &ast_trait_ref.path));
            this.tcx().trait_refs.borrow_mut().insert(ast_trait_ref.ref_id,
                                                      trait_ref.clone());
            trait_ref
        }
        _ => {
            this.tcx().sess.span_fatal(
                ast_trait_ref.path.span,
                format!("`{}` is not a trait", ast_trait_ref.path.user_string(this.tcx()))[]);
        }
    }
}
/// Instantiates the path for the given trait reference, assuming that it's bound to a valid trait
/// type. Returns the def_id for the defining trait. Fails if the type is a type other than a trait
/// type.
Instantiates the path for the given trait reference, assuming that it's bound to a valid trait
type. Returns the def_id for the defining trait. Fails if the type is a type other than a trait
type.
Instantiates the path for the given trait reference assuming that it ' s bound to a valid trait type . Returns the def_id for the defining trait . Fails if the type is a type other than a trait type .
pub fn instantiate_trait_ref<'tcx,AC,RS>(this: &AC,
                                         rscope: &RS,
                                         ast_trait_ref: &ast::TraitRef,
                                         self_ty: Option<Ty<'tcx>>)
                                         -> Rc<ty::TraitRef<'tcx>>
                                         where AC: AstConv<'tcx>,
                                               RS: RegionScope
{
    match ::lookup_def_tcx(this.tcx(),
                           ast_trait_ref.path.span,
                           ast_trait_ref.ref_id) {
        def::DefTrait(trait_def_id) => {
            let trait_ref = Rc::new(ast_path_to_trait_ref(this, rscope, trait_def_id,
                                                          self_ty, &ast_trait_ref.path));
            this.tcx().trait_refs.borrow_mut().insert(ast_trait_ref.ref_id,
                                                      trait_ref.clone());
            trait_ref
        }
        _ => {
            this.tcx().sess.span_fatal(
                ast_trait_ref.path.span,
                format!("`{}` is not a trait", ast_trait_ref.path.user_string(this.tcx()))[]);
        }
    }
}
pub fn instantiate_trait_ref < ' tcx , AC , RS > ( this : & AC , rscope : & RS , ast_trait_ref : & ast :: TraitRef , self_ty : Option < Ty < ' tcx > > ) -> Rc < ty :: TraitRef < ' tcx > > where AC : AstConv < ' tcx > , RS : RegionScope { match :: lookup_def_tcx ( this . tcx ( ) , ast_trait_ref . path . span , ast_trait_ref . ref_id ) { def :: DefTrait ( trait_def_id ) => { let trait_ref = Rc :: new ( ast_path_to_trait_ref ( this , rscope , trait_def_id , self_ty , & ast_trait_ref . path ) ) ; this . tcx ( ) . trait_refs . borrow_mut ( ) . insert ( ast_trait_ref . ref_id , trait_ref . clone ( ) ) ; trait_ref } _ => { this . tcx ( ) . sess . span_fatal ( ast_trait_ref . path . span , format ! ( " " ast_trait_ref path user_string ( this tcx ( ) ) ) [ ] ) ; } } }
Instantiates the path for the given trait reference, assuming that it's bound to a valid trait
type.
Instantiates the path for the given trait reference assuming that it ' s bound to a valid trait type .
this
&AC
rscope
&RS
ast_trait_ref
&ast::TraitRef
self_ty
Option<Ty<'tcx>>