pub fn instantiate_trait_ref<'tcx>(
    this: &AstConv<'tcx>,
    rscope: &RegionScope,
    ast_trait_ref: &ast::TraitRef,
    self_ty: Option<Ty<'tcx>>,
    projections: Option<&mut Vec<ty::ProjectionPredicate<'tcx>>>)
    -> Rc<ty::TraitRef<'tcx>>
{
    match ::lookup_def_tcx(this.tcx(), ast_trait_ref.path.span, ast_trait_ref.ref_id) {
        def::DefTrait(trait_def_id) => {
            let trait_ref = ast_path_to_trait_ref(this,
                                                  rscope,
                                                  trait_def_id,
                                                  self_ty,
                                                  &ast_trait_ref.path,
                                                  projections);
            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.
///
/// If the `projections` argument is `None`, then assoc type bindings like `Foo<T=X>`
/// are disallowed. Otherwise, they are pushed onto the vector given.
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>(
    this: &AstConv<'tcx>,
    rscope: &RegionScope,
    ast_trait_ref: &ast::TraitRef,
    self_ty: Option<Ty<'tcx>>,
    projections: Option<&mut Vec<ty::ProjectionPredicate<'tcx>>>)
    -> Rc<ty::TraitRef<'tcx>>
{
    match ::lookup_def_tcx(this.tcx(), ast_trait_ref.path.span, ast_trait_ref.ref_id) {
        def::DefTrait(trait_def_id) => {
            let trait_ref = ast_path_to_trait_ref(this,
                                                  rscope,
                                                  trait_def_id,
                                                  self_ty,
                                                  &ast_trait_ref.path,
                                                  projections);
            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 > ( this : & AstConv < ' tcx > , rscope : & RegionScope , ast_trait_ref : & ast :: TraitRef , self_ty : Option < Ty < ' tcx > > , projections : Option < & mut Vec < ty :: ProjectionPredicate < ' tcx > > > ) -> Rc < ty :: TraitRef < ' tcx > > { match :: lookup_def_tcx ( this . tcx ( ) , ast_trait_ref . path . span , ast_trait_ref . ref_id ) { def :: DefTrait ( trait_def_id ) => { let trait_ref = ast_path_to_trait_ref ( this , rscope , trait_def_id , self_ty , & ast_trait_ref . path , projections ) ; 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
&AstConv<'tcx>
rscope
&RegionScope
ast_trait_ref
&ast::TraitRef
self_ty
Option<Ty<'tcx>>
projections
Option<&mut Vec<ty::ProjectionPredicate<'tcx>>>
this
&AstConv<'tcx>
rscope
&RegionScope
ast_trait_ref
&ast::TraitRef
self_ty
Option<Ty<'tcx>>
projections
Option<&mut Vec<ty::ProjectionPredicate<'tcx>>>