@@ -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