@@ -268,17 +268,17 @@ enum Scope<'a> {
268268 track_lifetime_uses : bool ,
269269
270270 /// Whether or not this binder would serve as the parent
271- /// binder for abstract types introduced within. For example:
271+ /// binder for opaque types introduced within. For example:
272272 ///
273273 /// fn foo<'a>() -> impl for<'b> Trait<Item = impl Trait2<'a>>
274274 ///
275- /// Here, the abstract types we create for the `impl Trait`
275+ /// Here, the opaque types we create for the `impl Trait`
276276 /// and `impl Trait2` references will both have the `foo` item
277277 /// as their parent. When we get to `impl Trait2`, we find
278278 /// that it is nested within the `for<>` binder -- this flag
279279 /// allows us to skip that when looking for the parent binder
280- /// of the resulting abstract type.
281- abstract_type_parent : bool ,
280+ /// of the resulting opaque type.
281+ opaque_type_parent : bool ,
282282
283283 s : ScopeRef < ' a > ,
284284 } ,
@@ -526,7 +526,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
526526 let scope = Scope :: Binder {
527527 lifetimes,
528528 next_early_index : index + non_lifetime_count,
529- abstract_type_parent : true ,
529+ opaque_type_parent : true ,
530530 track_lifetime_uses,
531531 s : ROOT_SCOPE ,
532532 } ;
@@ -574,7 +574,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
574574 s : self . scope ,
575575 next_early_index,
576576 track_lifetime_uses : true ,
577- abstract_type_parent : false ,
577+ opaque_type_parent : false ,
578578 } ;
579579 self . with ( scope, |old_scope, this| {
580580 // a bare fn has no bounds, so everything
@@ -622,9 +622,9 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
622622 hir:: TyKind :: Def ( item_id, ref lifetimes) => {
623623 // Resolve the lifetimes in the bounds to the lifetime defs in the generics.
624624 // `fn foo<'a>() -> impl MyTrait<'a> { ... }` desugars to
625- // `abstract type MyAnonTy<'b>: MyTrait<'b>;`
626- // ^ ^ this gets resolved in the scope of
627- // the exist_ty generics
625+ // `type MyAnonTy<'b> = impl MyTrait<'b>;`
626+ // ^ ^ this gets resolved in the scope of
627+ // the opaque_ty generics
628628 let ( generics, bounds) = match self . tcx . hir ( ) . expect_item ( item_id. id ) . node
629629 {
630630 // Named opaque `impl Trait` types are reached via `TyKind::Path`.
@@ -687,7 +687,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
687687
688688 // We want to start our early-bound indices at the end of the parent scope,
689689 // not including any parent `impl Trait`s.
690- let mut index = self . next_early_index_for_abstract_type ( ) ;
690+ let mut index = self . next_early_index_for_opaque_type ( ) ;
691691 debug ! ( "visit_ty: index = {}" , index) ;
692692
693693 let mut elision = None ;
@@ -728,7 +728,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
728728 next_early_index,
729729 s : this. scope ,
730730 track_lifetime_uses : true ,
731- abstract_type_parent : false ,
731+ opaque_type_parent : false ,
732732 } ;
733733 this. with ( scope, |_old_scope, this| {
734734 this. visit_generics ( generics) ;
@@ -743,7 +743,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
743743 next_early_index,
744744 s : self . scope ,
745745 track_lifetime_uses : true ,
746- abstract_type_parent : false ,
746+ opaque_type_parent : false ,
747747 } ;
748748 self . with ( scope, |_old_scope, this| {
749749 this. visit_generics ( generics) ;
@@ -796,7 +796,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
796796 next_early_index : index + non_lifetime_count,
797797 s : self . scope ,
798798 track_lifetime_uses : true ,
799- abstract_type_parent : true ,
799+ opaque_type_parent : true ,
800800 } ;
801801 self . with ( scope, |_old_scope, this| {
802802 this. visit_generics ( generics) ;
@@ -848,7 +848,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
848848 next_early_index : index + non_lifetime_count,
849849 s : self . scope ,
850850 track_lifetime_uses : true ,
851- abstract_type_parent : true ,
851+ opaque_type_parent : true ,
852852 } ;
853853 self . with ( scope, |_old_scope, this| {
854854 this. visit_generics ( generics) ;
@@ -879,7 +879,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
879879 next_early_index,
880880 s : self . scope ,
881881 track_lifetime_uses : true ,
882- abstract_type_parent : true ,
882+ opaque_type_parent : true ,
883883 } ;
884884 self . with ( scope, |_old_scope, this| {
885885 this. visit_generics ( generics) ;
@@ -967,7 +967,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
967967 s : self . scope ,
968968 next_early_index,
969969 track_lifetime_uses : true ,
970- abstract_type_parent : false ,
970+ opaque_type_parent : false ,
971971 } ;
972972 let result = self . with ( scope, |old_scope, this| {
973973 this. check_lifetime_params ( old_scope, & bound_generic_params) ;
@@ -1037,7 +1037,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
10371037 s : self . scope ,
10381038 next_early_index,
10391039 track_lifetime_uses : true ,
1040- abstract_type_parent : false ,
1040+ opaque_type_parent : false ,
10411041 } ;
10421042 self . with ( scope, |old_scope, this| {
10431043 this. check_lifetime_params ( old_scope, & trait_ref. bound_generic_params ) ;
@@ -1753,7 +1753,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
17531753 lifetimes,
17541754 next_early_index,
17551755 s : self . scope ,
1756- abstract_type_parent : true ,
1756+ opaque_type_parent : true ,
17571757 track_lifetime_uses : false ,
17581758 } ;
17591759 self . with ( scope, move |old_scope, this| {
@@ -1762,17 +1762,17 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
17621762 } ) ;
17631763 }
17641764
1765- fn next_early_index_helper ( & self , only_abstract_type_parent : bool ) -> u32 {
1765+ fn next_early_index_helper ( & self , only_opaque_type_parent : bool ) -> u32 {
17661766 let mut scope = self . scope ;
17671767 loop {
17681768 match * scope {
17691769 Scope :: Root => return 0 ,
17701770
17711771 Scope :: Binder {
17721772 next_early_index,
1773- abstract_type_parent ,
1773+ opaque_type_parent ,
17741774 ..
1775- } if ( !only_abstract_type_parent || abstract_type_parent ) =>
1775+ } if ( !only_opaque_type_parent || opaque_type_parent ) =>
17761776 {
17771777 return next_early_index
17781778 }
@@ -1792,10 +1792,10 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
17921792 }
17931793
17941794 /// Returns the next index one would use for an `impl Trait` that
1795- /// is being converted into an `abstract type`. This will be the
1795+ /// is being converted into an opaque type alias `impl Trait `. This will be the
17961796 /// next early index from the enclosing item, for the most
1797- /// part. See the `abstract_type_parent ` field for more info.
1798- fn next_early_index_for_abstract_type ( & self ) -> u32 {
1797+ /// part. See the `opaque_type_parent ` field for more info.
1798+ fn next_early_index_for_opaque_type ( & self ) -> u32 {
17991799 self . next_early_index_helper ( false )
18001800 }
18011801
0 commit comments