@@ -534,8 +534,11 @@ pub enum Vtable<'tcx, N> {
534534 /// Same as above, but for a fn pointer type with the given signature.
535535 VtableFnPointer ( VtableFnPointerData < ' tcx , N > ) ,
536536
537- /// Vtable automatically generated for a generator
537+ /// Vtable automatically generated for a generator.
538538 VtableGenerator ( VtableGeneratorData < ' tcx , N > ) ,
539+
540+ /// Vtable for a trait alias.
541+ VtableTraitAlias ( VtableTraitAliasData < ' tcx , N > ) ,
539542}
540543
541544/// Identifies a particular impl in the source, along with a set of
@@ -605,6 +608,13 @@ pub struct VtableFnPointerData<'tcx, N> {
605608 pub nested : Vec < N >
606609}
607610
611+ #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable ) ]
612+ pub struct VtableTraitAliasData < ' tcx , N > {
613+ pub alias_def_id : DefId ,
614+ pub substs : & ' tcx Substs < ' tcx > ,
615+ pub nested : Vec < N > ,
616+ }
617+
608618/// Creates predicate obligations from the generic bounds.
609619pub fn predicates_for_generics < ' tcx > ( cause : ObligationCause < ' tcx > ,
610620 param_env : ty:: ParamEnv < ' tcx > ,
@@ -1067,6 +1077,7 @@ impl<'tcx, N> Vtable<'tcx, N> {
10671077 VtableGenerator ( c) => c. nested ,
10681078 VtableObject ( d) => d. nested ,
10691079 VtableFnPointer ( d) => d. nested ,
1080+ VtableTraitAlias ( d) => d. nested ,
10701081 }
10711082 }
10721083
@@ -1090,20 +1101,25 @@ impl<'tcx, N> Vtable<'tcx, N> {
10901101 trait_def_id : d. trait_def_id ,
10911102 nested : d. nested . into_iter ( ) . map ( f) . collect ( ) ,
10921103 } ) ,
1093- VtableFnPointer ( p) => VtableFnPointer ( VtableFnPointerData {
1094- fn_ty : p. fn_ty ,
1095- nested : p. nested . into_iter ( ) . map ( f) . collect ( ) ,
1104+ VtableClosure ( c) => VtableClosure ( VtableClosureData {
1105+ closure_def_id : c. closure_def_id ,
1106+ substs : c. substs ,
1107+ nested : c. nested . into_iter ( ) . map ( f) . collect ( ) ,
10961108 } ) ,
10971109 VtableGenerator ( c) => VtableGenerator ( VtableGeneratorData {
10981110 generator_def_id : c. generator_def_id ,
10991111 substs : c. substs ,
11001112 nested : c. nested . into_iter ( ) . map ( f) . collect ( ) ,
11011113 } ) ,
1102- VtableClosure ( c) => VtableClosure ( VtableClosureData {
1103- closure_def_id : c. closure_def_id ,
1104- substs : c. substs ,
1105- nested : c. nested . into_iter ( ) . map ( f) . collect ( ) ,
1106- } )
1114+ VtableFnPointer ( p) => VtableFnPointer ( VtableFnPointerData {
1115+ fn_ty : p. fn_ty ,
1116+ nested : p. nested . into_iter ( ) . map ( f) . collect ( ) ,
1117+ } ) ,
1118+ VtableTraitAlias ( d) => VtableTraitAlias ( VtableTraitAliasData {
1119+ alias_def_id : d. alias_def_id ,
1120+ substs : d. substs ,
1121+ nested : d. nested . into_iter ( ) . map ( f) . collect ( ) ,
1122+ } ) ,
11071123 }
11081124 }
11091125}
0 commit comments