@@ -265,7 +265,7 @@ enum ImplTraitContext<'b, 'a> {
265
265
origin : hir:: OpaqueTyOrigin ,
266
266
} ,
267
267
/// Impl trait in type aliases.
268
- OtherOpaqueTy {
268
+ TypeAliasesOpaqueTy {
269
269
/// Set of lifetimes that this opaque type can capture, if it uses
270
270
/// them. This includes lifetimes bound since we entered this context.
271
271
/// For example:
@@ -310,8 +310,8 @@ impl<'a> ImplTraitContext<'_, 'a> {
310
310
ReturnPositionOpaqueTy { fn_def_id, origin } => {
311
311
ReturnPositionOpaqueTy { fn_def_id : * fn_def_id, origin : * origin }
312
312
}
313
- OtherOpaqueTy { capturable_lifetimes, origin } => {
314
- OtherOpaqueTy { capturable_lifetimes, origin : * origin }
313
+ TypeAliasesOpaqueTy { capturable_lifetimes, origin } => {
314
+ TypeAliasesOpaqueTy { capturable_lifetimes, origin : * origin }
315
315
}
316
316
Disallowed ( pos) => Disallowed ( * pos) ,
317
317
}
@@ -1126,7 +1126,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1126
1126
//
1127
1127
// fn foo() -> impl Iterator<Item = impl Debug>
1128
1128
ImplTraitContext :: ReturnPositionOpaqueTy { .. }
1129
- | ImplTraitContext :: OtherOpaqueTy { .. } => ( true , itctx) ,
1129
+ | ImplTraitContext :: TypeAliasesOpaqueTy { .. } => ( true , itctx) ,
1130
1130
1131
1131
// We are in the argument position, but within a dyn type:
1132
1132
//
@@ -1150,7 +1150,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1150
1150
capturable_lifetimes = FxHashSet :: default ( ) ;
1151
1151
(
1152
1152
true ,
1153
- ImplTraitContext :: OtherOpaqueTy {
1153
+ ImplTraitContext :: TypeAliasesOpaqueTy {
1154
1154
capturable_lifetimes : & mut capturable_lifetimes,
1155
1155
origin : hir:: OpaqueTyOrigin :: Misc ,
1156
1156
} ,
@@ -1416,11 +1416,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1416
1416
None ,
1417
1417
|this| this. lower_param_bounds ( bounds, itctx) ,
1418
1418
) ,
1419
- ImplTraitContext :: OtherOpaqueTy { ref capturable_lifetimes, origin } => {
1419
+ ImplTraitContext :: TypeAliasesOpaqueTy { ref capturable_lifetimes, origin } => {
1420
1420
// Reset capturable lifetimes, any nested impl trait
1421
1421
// types will inherit lifetimes from this opaque type,
1422
1422
// so don't need to capture them again.
1423
- let nested_itctx = ImplTraitContext :: OtherOpaqueTy {
1423
+ let nested_itctx = ImplTraitContext :: TypeAliasesOpaqueTy {
1424
1424
capturable_lifetimes : & mut FxHashSet :: default ( ) ,
1425
1425
origin,
1426
1426
} ;
@@ -2321,13 +2321,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
2321
2321
) ) ,
2322
2322
_ => None ,
2323
2323
} ) ;
2324
- if let ImplTraitContext :: OtherOpaqueTy { ref mut capturable_lifetimes, .. } = itctx {
2324
+ if let ImplTraitContext :: TypeAliasesOpaqueTy { ref mut capturable_lifetimes, .. } =
2325
+ itctx
2326
+ {
2325
2327
capturable_lifetimes. extend ( lt_def_names. clone ( ) ) ;
2326
2328
}
2327
2329
2328
2330
let res = this. lower_trait_ref ( & p. trait_ref , itctx. reborrow ( ) ) ;
2329
2331
2330
- if let ImplTraitContext :: OtherOpaqueTy { ref mut capturable_lifetimes, .. } = itctx {
2332
+ if let ImplTraitContext :: TypeAliasesOpaqueTy { ref mut capturable_lifetimes, .. } =
2333
+ itctx
2334
+ {
2331
2335
for param in lt_def_names {
2332
2336
capturable_lifetimes. remove ( & param) ;
2333
2337
}
0 commit comments