File tree 2 files changed +13
-8
lines changed
2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -2192,12 +2192,7 @@ pub fn keep_local<'tcx, T: ty::TypeFoldable<'tcx>>(x: &T) -> bool {
2192
2192
}
2193
2193
2194
2194
direct_interners ! ( ' tcx,
2195
- region: mk_region( |r| {
2196
- match r {
2197
- & ty:: ReVar ( _) | & ty:: ReSkolemized ( ..) => true ,
2198
- _ => false
2199
- }
2200
- } ) -> RegionKind ,
2195
+ region: mk_region( |r: & RegionKind | r. keep_in_local_tcx( ) ) -> RegionKind ,
2201
2196
const_: mk_const( |c: & Const | keep_local( & c. ty) || keep_local( & c. val) ) -> Const <' tcx>
2202
2197
) ;
2203
2198
Original file line number Diff line number Diff line change @@ -1188,19 +1188,29 @@ impl RegionKind {
1188
1188
}
1189
1189
}
1190
1190
1191
+ pub fn keep_in_local_tcx ( & self ) -> bool {
1192
+ if let ty:: ReVar ( ..) = self {
1193
+ true
1194
+ } else {
1195
+ false
1196
+ }
1197
+ }
1198
+
1191
1199
pub fn type_flags ( & self ) -> TypeFlags {
1192
1200
let mut flags = TypeFlags :: empty ( ) ;
1193
1201
1202
+ if self . keep_in_local_tcx ( ) {
1203
+ flags = flags | TypeFlags :: KEEP_IN_LOCAL_TCX ;
1204
+ }
1205
+
1194
1206
match * self {
1195
1207
ty:: ReVar ( ..) => {
1196
1208
flags = flags | TypeFlags :: HAS_FREE_REGIONS ;
1197
1209
flags = flags | TypeFlags :: HAS_RE_INFER ;
1198
- flags = flags | TypeFlags :: KEEP_IN_LOCAL_TCX ;
1199
1210
}
1200
1211
ty:: ReSkolemized ( ..) => {
1201
1212
flags = flags | TypeFlags :: HAS_FREE_REGIONS ;
1202
1213
flags = flags | TypeFlags :: HAS_RE_SKOL ;
1203
- flags = flags | TypeFlags :: KEEP_IN_LOCAL_TCX ;
1204
1214
}
1205
1215
ty:: ReLateBound ( ..) => { }
1206
1216
ty:: ReEarlyBound ( ..) => {
You can’t perform that action at this time.
0 commit comments