@@ -534,8 +534,11 @@ pub enum Vtable<'tcx, N> {
534
534
/// Same as above, but for a fn pointer type with the given signature.
535
535
VtableFnPointer ( VtableFnPointerData < ' tcx , N > ) ,
536
536
537
- /// Vtable automatically generated for a generator
537
+ /// Vtable automatically generated for a generator.
538
538
VtableGenerator ( VtableGeneratorData < ' tcx , N > ) ,
539
+
540
+ /// Vtable for a trait alias.
541
+ VtableTraitAlias ( VtableTraitAliasData < ' tcx , N > ) ,
539
542
}
540
543
541
544
/// Identifies a particular impl in the source, along with a set of
@@ -605,6 +608,13 @@ pub struct VtableFnPointerData<'tcx, N> {
605
608
pub nested : Vec < N >
606
609
}
607
610
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
+
608
618
/// Creates predicate obligations from the generic bounds.
609
619
pub fn predicates_for_generics < ' tcx > ( cause : ObligationCause < ' tcx > ,
610
620
param_env : ty:: ParamEnv < ' tcx > ,
@@ -1067,6 +1077,7 @@ impl<'tcx, N> Vtable<'tcx, N> {
1067
1077
VtableGenerator ( c) => c. nested ,
1068
1078
VtableObject ( d) => d. nested ,
1069
1079
VtableFnPointer ( d) => d. nested ,
1080
+ VtableTraitAlias ( d) => d. nested ,
1070
1081
}
1071
1082
}
1072
1083
@@ -1090,20 +1101,25 @@ impl<'tcx, N> Vtable<'tcx, N> {
1090
1101
trait_def_id : d. trait_def_id ,
1091
1102
nested : d. nested . into_iter ( ) . map ( f) . collect ( ) ,
1092
1103
} ) ,
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 ( ) ,
1096
1108
} ) ,
1097
1109
VtableGenerator ( c) => VtableGenerator ( VtableGeneratorData {
1098
1110
generator_def_id : c. generator_def_id ,
1099
1111
substs : c. substs ,
1100
1112
nested : c. nested . into_iter ( ) . map ( f) . collect ( ) ,
1101
1113
} ) ,
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
+ } ) ,
1107
1123
}
1108
1124
}
1109
1125
}
0 commit comments