@@ -268,17 +268,17 @@ enum Scope<'a> {
268
268
track_lifetime_uses : bool ,
269
269
270
270
/// 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:
272
272
///
273
273
/// fn foo<'a>() -> impl for<'b> Trait<Item = impl Trait2<'a>>
274
274
///
275
- /// Here, the abstract types we create for the `impl Trait`
275
+ /// Here, the opaque types we create for the `impl Trait`
276
276
/// and `impl Trait2` references will both have the `foo` item
277
277
/// as their parent. When we get to `impl Trait2`, we find
278
278
/// that it is nested within the `for<>` binder -- this flag
279
279
/// 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 ,
282
282
283
283
s : ScopeRef < ' a > ,
284
284
} ,
@@ -526,7 +526,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
526
526
let scope = Scope :: Binder {
527
527
lifetimes,
528
528
next_early_index : index + non_lifetime_count,
529
- abstract_type_parent : true ,
529
+ opaque_type_parent : true ,
530
530
track_lifetime_uses,
531
531
s : ROOT_SCOPE ,
532
532
} ;
@@ -574,7 +574,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
574
574
s : self . scope ,
575
575
next_early_index,
576
576
track_lifetime_uses : true ,
577
- abstract_type_parent : false ,
577
+ opaque_type_parent : false ,
578
578
} ;
579
579
self . with ( scope, |old_scope, this| {
580
580
// a bare fn has no bounds, so everything
@@ -622,9 +622,9 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
622
622
hir:: TyKind :: Def ( item_id, ref lifetimes) => {
623
623
// Resolve the lifetimes in the bounds to the lifetime defs in the generics.
624
624
// `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
628
628
let ( generics, bounds) = match self . tcx . hir ( ) . expect_item ( item_id. id ) . node
629
629
{
630
630
// Named opaque `impl Trait` types are reached via `TyKind::Path`.
@@ -687,7 +687,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
687
687
688
688
// We want to start our early-bound indices at the end of the parent scope,
689
689
// 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 ( ) ;
691
691
debug ! ( "visit_ty: index = {}" , index) ;
692
692
693
693
let mut elision = None ;
@@ -728,7 +728,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
728
728
next_early_index,
729
729
s : this. scope ,
730
730
track_lifetime_uses : true ,
731
- abstract_type_parent : false ,
731
+ opaque_type_parent : false ,
732
732
} ;
733
733
this. with ( scope, |_old_scope, this| {
734
734
this. visit_generics ( generics) ;
@@ -743,7 +743,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
743
743
next_early_index,
744
744
s : self . scope ,
745
745
track_lifetime_uses : true ,
746
- abstract_type_parent : false ,
746
+ opaque_type_parent : false ,
747
747
} ;
748
748
self . with ( scope, |_old_scope, this| {
749
749
this. visit_generics ( generics) ;
@@ -796,7 +796,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
796
796
next_early_index : index + non_lifetime_count,
797
797
s : self . scope ,
798
798
track_lifetime_uses : true ,
799
- abstract_type_parent : true ,
799
+ opaque_type_parent : true ,
800
800
} ;
801
801
self . with ( scope, |_old_scope, this| {
802
802
this. visit_generics ( generics) ;
@@ -848,7 +848,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
848
848
next_early_index : index + non_lifetime_count,
849
849
s : self . scope ,
850
850
track_lifetime_uses : true ,
851
- abstract_type_parent : true ,
851
+ opaque_type_parent : true ,
852
852
} ;
853
853
self . with ( scope, |_old_scope, this| {
854
854
this. visit_generics ( generics) ;
@@ -879,7 +879,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
879
879
next_early_index,
880
880
s : self . scope ,
881
881
track_lifetime_uses : true ,
882
- abstract_type_parent : true ,
882
+ opaque_type_parent : true ,
883
883
} ;
884
884
self . with ( scope, |_old_scope, this| {
885
885
this. visit_generics ( generics) ;
@@ -967,7 +967,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
967
967
s : self . scope ,
968
968
next_early_index,
969
969
track_lifetime_uses : true ,
970
- abstract_type_parent : false ,
970
+ opaque_type_parent : false ,
971
971
} ;
972
972
let result = self . with ( scope, |old_scope, this| {
973
973
this. check_lifetime_params ( old_scope, & bound_generic_params) ;
@@ -1037,7 +1037,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
1037
1037
s : self . scope ,
1038
1038
next_early_index,
1039
1039
track_lifetime_uses : true ,
1040
- abstract_type_parent : false ,
1040
+ opaque_type_parent : false ,
1041
1041
} ;
1042
1042
self . with ( scope, |old_scope, this| {
1043
1043
this. check_lifetime_params ( old_scope, & trait_ref. bound_generic_params ) ;
@@ -1753,7 +1753,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
1753
1753
lifetimes,
1754
1754
next_early_index,
1755
1755
s : self . scope ,
1756
- abstract_type_parent : true ,
1756
+ opaque_type_parent : true ,
1757
1757
track_lifetime_uses : false ,
1758
1758
} ;
1759
1759
self . with ( scope, move |old_scope, this| {
@@ -1762,17 +1762,17 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
1762
1762
} ) ;
1763
1763
}
1764
1764
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 {
1766
1766
let mut scope = self . scope ;
1767
1767
loop {
1768
1768
match * scope {
1769
1769
Scope :: Root => return 0 ,
1770
1770
1771
1771
Scope :: Binder {
1772
1772
next_early_index,
1773
- abstract_type_parent ,
1773
+ opaque_type_parent ,
1774
1774
..
1775
- } if ( !only_abstract_type_parent || abstract_type_parent ) =>
1775
+ } if ( !only_opaque_type_parent || opaque_type_parent ) =>
1776
1776
{
1777
1777
return next_early_index
1778
1778
}
@@ -1792,10 +1792,10 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
1792
1792
}
1793
1793
1794
1794
/// 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
1796
1796
/// 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 {
1799
1799
self . next_early_index_helper ( false )
1800
1800
}
1801
1801
0 commit comments