@@ -1041,6 +1041,8 @@ const NUM_PREINTERNED_TY_VARS: u32 = 100;
1041
1041
const NUM_PREINTERNED_FRESH_TYS : u32 = 20 ;
1042
1042
const NUM_PREINTERNED_FRESH_INT_TYS : u32 = 3 ;
1043
1043
const NUM_PREINTERNED_FRESH_FLOAT_TYS : u32 = 3 ;
1044
+ const NUM_PREINTERNED_ANON_BOUND_TYS_I : u32 = 3 ;
1045
+ const NUM_PREINTERNED_ANON_BOUND_TYS_V : u32 = 20 ;
1044
1046
1045
1047
// This number may seem high, but it is reached in all but the smallest crates.
1046
1048
const NUM_PREINTERNED_RE_VARS : u32 = 500 ;
@@ -1088,6 +1090,11 @@ pub struct CommonTypes<'tcx> {
1088
1090
1089
1091
/// Pre-interned `Infer(ty::FreshFloatTy(n))` for small values of `n`.
1090
1092
pub fresh_float_tys : Vec < Ty < ' tcx > > ,
1093
+
1094
+ /// Pre-interned values of the form:
1095
+ /// `Bound(DebruijnIndex(i), BoundTy { var: v, kind: BoundTyKind::Anon})`
1096
+ /// for small values of `i` and `v`.
1097
+ pub anon_bound_tys : Vec < Vec < Ty < ' tcx > > > ,
1091
1098
}
1092
1099
1093
1100
pub struct CommonLifetimes < ' tcx > {
@@ -1131,6 +1138,19 @@ impl<'tcx> CommonTypes<'tcx> {
1131
1138
let fresh_float_tys: Vec < _ > =
1132
1139
( 0 ..NUM_PREINTERNED_FRESH_FLOAT_TYS ) . map ( |n| mk ( Infer ( ty:: FreshFloatTy ( n) ) ) ) . collect ( ) ;
1133
1140
1141
+ let anon_bound_tys = ( 0 ..NUM_PREINTERNED_ANON_BOUND_TYS_I )
1142
+ . map ( |i| {
1143
+ ( 0 ..NUM_PREINTERNED_ANON_BOUND_TYS_V )
1144
+ . map ( |v| {
1145
+ mk ( ty:: Bound (
1146
+ ty:: DebruijnIndex :: from ( i) ,
1147
+ ty:: BoundTy { var : ty:: BoundVar :: from ( v) , kind : ty:: BoundTyKind :: Anon } ,
1148
+ ) )
1149
+ } )
1150
+ . collect ( )
1151
+ } )
1152
+ . collect ( ) ;
1153
+
1134
1154
CommonTypes {
1135
1155
unit : mk ( Tuple ( List :: empty ( ) ) ) ,
1136
1156
bool : mk ( Bool ) ,
@@ -1161,6 +1181,7 @@ impl<'tcx> CommonTypes<'tcx> {
1161
1181
fresh_tys,
1162
1182
fresh_int_tys,
1163
1183
fresh_float_tys,
1184
+ anon_bound_tys,
1164
1185
}
1165
1186
}
1166
1187
}
0 commit comments