@@ -152,21 +152,6 @@ enum Scope<'a> {
152
152
/// for diagnostics.
153
153
lifetimes : FxIndexMap < LocalDefId , Region > ,
154
154
155
- /// Whether or not this binder would serve as the parent
156
- /// binder for opaque types introduced within. For example:
157
- ///
158
- /// ```text
159
- /// fn foo<'a>() -> impl for<'b> Trait<Item = impl Trait2<'a>>
160
- /// ```
161
- ///
162
- /// Here, the opaque types we create for the `impl Trait`
163
- /// and `impl Trait2` references will both have the `foo` item
164
- /// as their parent. When we get to `impl Trait2`, we find
165
- /// that it is nested within the `for<>` binder -- this flag
166
- /// allows us to skip that when looking for the parent binder
167
- /// of the resulting opaque type.
168
- opaque_type_parent : bool ,
169
-
170
155
scope_type : BinderScopeType ,
171
156
172
157
/// The late bound vars for a given item are stored by `HirId` to be
@@ -236,17 +221,9 @@ struct TruncatedScopeDebug<'a>(&'a Scope<'a>);
236
221
impl < ' a > fmt:: Debug for TruncatedScopeDebug < ' a > {
237
222
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
238
223
match self . 0 {
239
- Scope :: Binder {
240
- lifetimes,
241
- opaque_type_parent,
242
- scope_type,
243
- hir_id,
244
- s : _,
245
- allow_late_bound,
246
- } => f
224
+ Scope :: Binder { lifetimes, scope_type, hir_id, s : _, allow_late_bound } => f
247
225
. debug_struct ( "Binder" )
248
226
. field ( "lifetimes" , lifetimes)
249
- . field ( "opaque_type_parent" , opaque_type_parent)
250
227
. field ( "scope_type" , scope_type)
251
228
. field ( "hir_id" , hir_id)
252
229
. field ( "s" , & ".." )
@@ -577,7 +554,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
577
554
hir_id,
578
555
lifetimes : FxIndexMap :: default ( ) ,
579
556
s : self . scope ,
580
- opaque_type_parent : false ,
581
557
scope_type : BinderScopeType :: Normal ,
582
558
allow_late_bound : true ,
583
559
} ;
@@ -681,7 +657,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
681
657
let scope = Scope :: Binder {
682
658
hir_id : item. hir_id ( ) ,
683
659
lifetimes,
684
- opaque_type_parent : true ,
685
660
scope_type : BinderScopeType :: Normal ,
686
661
s : ROOT_SCOPE ,
687
662
allow_late_bound : false ,
@@ -745,7 +720,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
745
720
hir_id : ty. hir_id ,
746
721
lifetimes,
747
722
s : self . scope ,
748
- opaque_type_parent : false ,
749
723
scope_type : BinderScopeType :: Normal ,
750
724
allow_late_bound : true ,
751
725
} ;
@@ -920,7 +894,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
920
894
hir_id : ty. hir_id ,
921
895
lifetimes,
922
896
s : this. scope ,
923
- opaque_type_parent : false ,
924
897
scope_type : BinderScopeType :: Normal ,
925
898
allow_late_bound : false ,
926
899
} ;
@@ -939,7 +912,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
939
912
hir_id : ty. hir_id ,
940
913
lifetimes,
941
914
s : self . scope ,
942
- opaque_type_parent : false ,
943
915
scope_type : BinderScopeType :: Normal ,
944
916
allow_late_bound : false ,
945
917
} ;
@@ -986,7 +958,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
986
958
hir_id : trait_item. hir_id ( ) ,
987
959
lifetimes,
988
960
s : self . scope ,
989
- opaque_type_parent : true ,
990
961
scope_type : BinderScopeType :: Normal ,
991
962
allow_late_bound : false ,
992
963
} ;
@@ -1042,7 +1013,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
1042
1013
hir_id : ty. hir_id ,
1043
1014
lifetimes,
1044
1015
s : self . scope ,
1045
- opaque_type_parent : true ,
1046
1016
scope_type : BinderScopeType :: Normal ,
1047
1017
allow_late_bound : true ,
1048
1018
} ;
@@ -1185,7 +1155,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
1185
1155
hir_id : bounded_ty. hir_id ,
1186
1156
lifetimes,
1187
1157
s : this. scope ,
1188
- opaque_type_parent : false ,
1189
1158
scope_type : BinderScopeType :: Normal ,
1190
1159
allow_late_bound : true ,
1191
1160
} ;
@@ -1256,7 +1225,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
1256
1225
hir_id : * hir_id,
1257
1226
lifetimes : FxIndexMap :: default ( ) ,
1258
1227
s : self . scope ,
1259
- opaque_type_parent : false ,
1260
1228
scope_type,
1261
1229
allow_late_bound : true ,
1262
1230
} ;
@@ -1306,7 +1274,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
1306
1274
hir_id : trait_ref. trait_ref . hir_ref_id ,
1307
1275
lifetimes,
1308
1276
s : self . scope ,
1309
- opaque_type_parent : false ,
1310
1277
scope_type,
1311
1278
allow_late_bound : true ,
1312
1279
} ;
@@ -1405,7 +1372,6 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
1405
1372
hir_id,
1406
1373
lifetimes,
1407
1374
s : self . scope ,
1408
- opaque_type_parent : true ,
1409
1375
scope_type : BinderScopeType :: Normal ,
1410
1376
allow_late_bound : true ,
1411
1377
} ;
0 commit comments