Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 13287d8

Browse files
committed
Rename OtherOpaqueTy to TypeAliasesOpaqueTy
1 parent 66c9cd9 commit 13287d8

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
343343
// opaque type Foo1: Trait
344344
let ty = self.lower_ty(
345345
ty,
346-
ImplTraitContext::OtherOpaqueTy {
346+
ImplTraitContext::TypeAliasesOpaqueTy {
347347
capturable_lifetimes: &mut FxHashSet::default(),
348348
origin: hir::OpaqueTyOrigin::TyAlias,
349349
},
@@ -487,7 +487,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
487487
let mut capturable_lifetimes;
488488
let itctx = if self.sess.features_untracked().impl_trait_in_bindings {
489489
capturable_lifetimes = FxHashSet::default();
490-
ImplTraitContext::OtherOpaqueTy {
490+
ImplTraitContext::TypeAliasesOpaqueTy {
491491
capturable_lifetimes: &mut capturable_lifetimes,
492492
origin: hir::OpaqueTyOrigin::Misc,
493493
}
@@ -926,7 +926,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
926926
Some(ty) => {
927927
let ty = self.lower_ty(
928928
ty,
929-
ImplTraitContext::OtherOpaqueTy {
929+
ImplTraitContext::TypeAliasesOpaqueTy {
930930
capturable_lifetimes: &mut FxHashSet::default(),
931931
origin: hir::OpaqueTyOrigin::TyAlias,
932932
},

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ enum ImplTraitContext<'b, 'a> {
265265
origin: hir::OpaqueTyOrigin,
266266
},
267267
/// Impl trait in type aliases.
268-
OtherOpaqueTy {
268+
TypeAliasesOpaqueTy {
269269
/// Set of lifetimes that this opaque type can capture, if it uses
270270
/// them. This includes lifetimes bound since we entered this context.
271271
/// For example:
@@ -310,8 +310,8 @@ impl<'a> ImplTraitContext<'_, 'a> {
310310
ReturnPositionOpaqueTy { fn_def_id, origin } => {
311311
ReturnPositionOpaqueTy { fn_def_id: *fn_def_id, origin: *origin }
312312
}
313-
OtherOpaqueTy { capturable_lifetimes, origin } => {
314-
OtherOpaqueTy { capturable_lifetimes, origin: *origin }
313+
TypeAliasesOpaqueTy { capturable_lifetimes, origin } => {
314+
TypeAliasesOpaqueTy { capturable_lifetimes, origin: *origin }
315315
}
316316
Disallowed(pos) => Disallowed(*pos),
317317
}
@@ -1126,7 +1126,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11261126
//
11271127
// fn foo() -> impl Iterator<Item = impl Debug>
11281128
ImplTraitContext::ReturnPositionOpaqueTy { .. }
1129-
| ImplTraitContext::OtherOpaqueTy { .. } => (true, itctx),
1129+
| ImplTraitContext::TypeAliasesOpaqueTy { .. } => (true, itctx),
11301130

11311131
// We are in the argument position, but within a dyn type:
11321132
//
@@ -1150,7 +1150,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11501150
capturable_lifetimes = FxHashSet::default();
11511151
(
11521152
true,
1153-
ImplTraitContext::OtherOpaqueTy {
1153+
ImplTraitContext::TypeAliasesOpaqueTy {
11541154
capturable_lifetimes: &mut capturable_lifetimes,
11551155
origin: hir::OpaqueTyOrigin::Misc,
11561156
},
@@ -1416,11 +1416,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
14161416
None,
14171417
|this| this.lower_param_bounds(bounds, itctx),
14181418
),
1419-
ImplTraitContext::OtherOpaqueTy { ref capturable_lifetimes, origin } => {
1419+
ImplTraitContext::TypeAliasesOpaqueTy { ref capturable_lifetimes, origin } => {
14201420
// Reset capturable lifetimes, any nested impl trait
14211421
// types will inherit lifetimes from this opaque type,
14221422
// so don't need to capture them again.
1423-
let nested_itctx = ImplTraitContext::OtherOpaqueTy {
1423+
let nested_itctx = ImplTraitContext::TypeAliasesOpaqueTy {
14241424
capturable_lifetimes: &mut FxHashSet::default(),
14251425
origin,
14261426
};
@@ -2321,13 +2321,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
23212321
)),
23222322
_ => None,
23232323
});
2324-
if let ImplTraitContext::OtherOpaqueTy { ref mut capturable_lifetimes, .. } = itctx {
2324+
if let ImplTraitContext::TypeAliasesOpaqueTy { ref mut capturable_lifetimes, .. } =
2325+
itctx
2326+
{
23252327
capturable_lifetimes.extend(lt_def_names.clone());
23262328
}
23272329

23282330
let res = this.lower_trait_ref(&p.trait_ref, itctx.reborrow());
23292331

2330-
if let ImplTraitContext::OtherOpaqueTy { ref mut capturable_lifetimes, .. } = itctx {
2332+
if let ImplTraitContext::TypeAliasesOpaqueTy { ref mut capturable_lifetimes, .. } =
2333+
itctx
2334+
{
23312335
for param in lt_def_names {
23322336
capturable_lifetimes.remove(&param);
23332337
}

0 commit comments

Comments
 (0)