Skip to content

Commit be9a2a0

Browse files
committed
Remove opaque_type_parent.
1 parent bc70bb9 commit be9a2a0

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

compiler/rustc_resolve/src/late/lifetimes.rs

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,6 @@ enum Scope<'a> {
152152
/// for diagnostics.
153153
lifetimes: FxIndexMap<LocalDefId, Region>,
154154

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-
170155
scope_type: BinderScopeType,
171156

172157
/// The late bound vars for a given item are stored by `HirId` to be
@@ -236,17 +221,9 @@ struct TruncatedScopeDebug<'a>(&'a Scope<'a>);
236221
impl<'a> fmt::Debug for TruncatedScopeDebug<'a> {
237222
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
238223
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
247225
.debug_struct("Binder")
248226
.field("lifetimes", lifetimes)
249-
.field("opaque_type_parent", opaque_type_parent)
250227
.field("scope_type", scope_type)
251228
.field("hir_id", hir_id)
252229
.field("s", &"..")
@@ -577,7 +554,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
577554
hir_id,
578555
lifetimes: FxIndexMap::default(),
579556
s: self.scope,
580-
opaque_type_parent: false,
581557
scope_type: BinderScopeType::Normal,
582558
allow_late_bound: true,
583559
};
@@ -681,7 +657,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
681657
let scope = Scope::Binder {
682658
hir_id: item.hir_id(),
683659
lifetimes,
684-
opaque_type_parent: true,
685660
scope_type: BinderScopeType::Normal,
686661
s: ROOT_SCOPE,
687662
allow_late_bound: false,
@@ -745,7 +720,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
745720
hir_id: ty.hir_id,
746721
lifetimes,
747722
s: self.scope,
748-
opaque_type_parent: false,
749723
scope_type: BinderScopeType::Normal,
750724
allow_late_bound: true,
751725
};
@@ -920,7 +894,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
920894
hir_id: ty.hir_id,
921895
lifetimes,
922896
s: this.scope,
923-
opaque_type_parent: false,
924897
scope_type: BinderScopeType::Normal,
925898
allow_late_bound: false,
926899
};
@@ -939,7 +912,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
939912
hir_id: ty.hir_id,
940913
lifetimes,
941914
s: self.scope,
942-
opaque_type_parent: false,
943915
scope_type: BinderScopeType::Normal,
944916
allow_late_bound: false,
945917
};
@@ -986,7 +958,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
986958
hir_id: trait_item.hir_id(),
987959
lifetimes,
988960
s: self.scope,
989-
opaque_type_parent: true,
990961
scope_type: BinderScopeType::Normal,
991962
allow_late_bound: false,
992963
};
@@ -1042,7 +1013,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
10421013
hir_id: ty.hir_id,
10431014
lifetimes,
10441015
s: self.scope,
1045-
opaque_type_parent: true,
10461016
scope_type: BinderScopeType::Normal,
10471017
allow_late_bound: true,
10481018
};
@@ -1185,7 +1155,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
11851155
hir_id: bounded_ty.hir_id,
11861156
lifetimes,
11871157
s: this.scope,
1188-
opaque_type_parent: false,
11891158
scope_type: BinderScopeType::Normal,
11901159
allow_late_bound: true,
11911160
};
@@ -1256,7 +1225,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
12561225
hir_id: *hir_id,
12571226
lifetimes: FxIndexMap::default(),
12581227
s: self.scope,
1259-
opaque_type_parent: false,
12601228
scope_type,
12611229
allow_late_bound: true,
12621230
};
@@ -1306,7 +1274,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
13061274
hir_id: trait_ref.trait_ref.hir_ref_id,
13071275
lifetimes,
13081276
s: self.scope,
1309-
opaque_type_parent: false,
13101277
scope_type,
13111278
allow_late_bound: true,
13121279
};
@@ -1405,7 +1372,6 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
14051372
hir_id,
14061373
lifetimes,
14071374
s: self.scope,
1408-
opaque_type_parent: true,
14091375
scope_type: BinderScopeType::Normal,
14101376
allow_late_bound: true,
14111377
};

0 commit comments

Comments
 (0)