File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 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 {
21922192}
21932193
21942194direct_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 ,
22012196 const_: mk_const( |c: & Const | keep_local( & c. ty) || keep_local( & c. val) ) -> Const <' tcx>
22022197) ;
22032198
Original file line number Diff line number Diff line change @@ -1188,19 +1188,29 @@ impl RegionKind {
11881188 }
11891189 }
11901190
1191+ pub fn keep_in_local_tcx ( & self ) -> bool {
1192+ if let ty:: ReVar ( ..) = self {
1193+ true
1194+ } else {
1195+ false
1196+ }
1197+ }
1198+
11911199 pub fn type_flags ( & self ) -> TypeFlags {
11921200 let mut flags = TypeFlags :: empty ( ) ;
11931201
1202+ if self . keep_in_local_tcx ( ) {
1203+ flags = flags | TypeFlags :: KEEP_IN_LOCAL_TCX ;
1204+ }
1205+
11941206 match * self {
11951207 ty:: ReVar ( ..) => {
11961208 flags = flags | TypeFlags :: HAS_FREE_REGIONS ;
11971209 flags = flags | TypeFlags :: HAS_RE_INFER ;
1198- flags = flags | TypeFlags :: KEEP_IN_LOCAL_TCX ;
11991210 }
12001211 ty:: ReSkolemized ( ..) => {
12011212 flags = flags | TypeFlags :: HAS_FREE_REGIONS ;
12021213 flags = flags | TypeFlags :: HAS_RE_SKOL ;
1203- flags = flags | TypeFlags :: KEEP_IN_LOCAL_TCX ;
12041214 }
12051215 ty:: ReLateBound ( ..) => { }
12061216 ty:: ReEarlyBound ( ..) => {
You can’t perform that action at this time.
0 commit comments