@@ -24,7 +24,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
24
24
& self ,
25
25
bounds : & mut Bounds < ' tcx > ,
26
26
self_ty : Ty < ' tcx > ,
27
- ast_bounds : & ' tcx [ hir:: GenericBound < ' tcx > ] ,
27
+ hir_bounds : & ' tcx [ hir:: GenericBound < ' tcx > ] ,
28
28
self_ty_where_predicates : Option < ( LocalDefId , & ' tcx [ hir:: WherePredicate < ' tcx > ] ) > ,
29
29
span : Span ,
30
30
) {
@@ -35,9 +35,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
35
35
36
36
// Try to find an unbound in bounds.
37
37
let mut unbounds: SmallVec < [ _ ; 1 ] > = SmallVec :: new ( ) ;
38
- let mut search_bounds = |ast_bounds : & ' tcx [ hir:: GenericBound < ' tcx > ] | {
39
- for ab in ast_bounds {
40
- let hir:: GenericBound :: Trait ( ptr, modifier) = ab else {
38
+ let mut search_bounds = |hir_bounds : & ' tcx [ hir:: GenericBound < ' tcx > ] | {
39
+ for hir_bound in hir_bounds {
40
+ let hir:: GenericBound :: Trait ( ptr, modifier) = hir_bound else {
41
41
continue ;
42
42
} ;
43
43
match modifier {
@@ -60,7 +60,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
60
60
}
61
61
}
62
62
} ;
63
- search_bounds ( ast_bounds ) ;
63
+ search_bounds ( hir_bounds ) ;
64
64
if let Some ( ( self_ty, where_clause) ) = self_ty_where_predicates {
65
65
for clause in where_clause {
66
66
if let hir:: WherePredicate :: BoundPredicate ( pred) = clause
@@ -109,34 +109,34 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
109
109
///
110
110
/// ```ignore (illustrative)
111
111
/// fn foo<T>() where for<'a> T: Trait<'a> + Copy {}
112
- /// // ^^^^^^^ ^ ^^^^^^^^^^^^^^^^ `ast_bounds `, in HIR form
112
+ /// // ^^^^^^^ ^ ^^^^^^^^^^^^^^^^ `hir_bounds `, in HIR form
113
113
/// // | |
114
114
/// // | `param_ty`, in ty form
115
115
/// // `bound_vars`, in ty form
116
116
///
117
117
/// fn bar<T>() where T: for<'a> Trait<'a> + Copy {} // no overarching `bound_vars` here!
118
- /// // ^ ^^^^^^^^^^^^^^^^^^^^^^^^ `ast_bounds `, in HIR form
118
+ /// // ^ ^^^^^^^^^^^^^^^^^^^^^^^^ `hir_bounds `, in HIR form
119
119
/// // |
120
120
/// // `param_ty`, in ty form
121
121
/// ```
122
122
///
123
123
/// ### A Note on Binders
124
124
///
125
- /// There is an implied binder around `param_ty` and `ast_bounds `.
125
+ /// There is an implied binder around `param_ty` and `hir_bounds `.
126
126
/// See `lower_poly_trait_ref` for more details.
127
- #[ instrument( level = "debug" , skip( self , ast_bounds , bounds) ) ]
127
+ #[ instrument( level = "debug" , skip( self , hir_bounds , bounds) ) ]
128
128
pub ( crate ) fn lower_poly_bounds < ' hir , I : Iterator < Item = & ' hir hir:: GenericBound < ' tcx > > > (
129
129
& self ,
130
130
param_ty : Ty < ' tcx > ,
131
- ast_bounds : I ,
131
+ hir_bounds : I ,
132
132
bounds : & mut Bounds < ' tcx > ,
133
133
bound_vars : & ' tcx ty:: List < ty:: BoundVariableKind > ,
134
134
only_self_bounds : OnlySelfBounds ,
135
135
) where
136
136
' tcx : ' hir ,
137
137
{
138
- for ast_bound in ast_bounds {
139
- match ast_bound {
138
+ for hir_bound in hir_bounds {
139
+ match hir_bound {
140
140
hir:: GenericBound :: Trait ( poly_trait_ref, modifier) => {
141
141
let ( constness, polarity) = match modifier {
142
142
hir:: TraitBoundModifier :: Const => {
@@ -183,14 +183,14 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
183
183
/// ### Example
184
184
///
185
185
/// ```ignore (illustrative)
186
- /// fn foo<T: Bar + Baz>() {}
187
- /// // ^ ^^^^^^^^^ ast_bounds
186
+ /// fn foo<T: Bar + Baz>() { }
187
+ /// // ^ ^^^^^^^^^ hir_bounds
188
188
/// // param_ty
189
189
/// ```
190
190
pub ( crate ) fn lower_mono_bounds (
191
191
& self ,
192
192
param_ty : Ty < ' tcx > ,
193
- ast_bounds : & [ hir:: GenericBound < ' tcx > ] ,
193
+ hir_bounds : & [ hir:: GenericBound < ' tcx > ] ,
194
194
filter : PredicateFilter ,
195
195
) -> Bounds < ' tcx > {
196
196
let mut bounds = Bounds :: default ( ) ;
@@ -204,7 +204,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
204
204
205
205
self . lower_poly_bounds (
206
206
param_ty,
207
- ast_bounds . iter ( ) . filter ( |bound| match filter {
207
+ hir_bounds . iter ( ) . filter ( |bound| match filter {
208
208
PredicateFilter :: All
209
209
| PredicateFilter :: SelfOnly
210
210
| PredicateFilter :: SelfAndAssociatedTypeBounds => true ,
@@ -496,7 +496,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
496
496
}
497
497
// Lower a constraint like `Item: Debug` as found in HIR bound `T: Iterator<Item: Debug>`
498
498
// to a bound involving a projection: `<T as Iterator>::Item: Debug`.
499
- hir:: TypeBindingKind :: Constraint { bounds : ast_bounds } => {
499
+ hir:: TypeBindingKind :: Constraint { bounds : hir_bounds } => {
500
500
// NOTE: If `only_self_bounds` is true, do NOT expand this associated type bound into
501
501
// a trait predicate, since we only want to add predicates for the `Self` type.
502
502
if !only_self_bounds. 0 {
@@ -505,7 +505,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
505
505
let param_ty = Ty :: new_alias ( tcx, ty:: Projection , projection_ty. skip_binder ( ) ) ;
506
506
self . lower_poly_bounds (
507
507
param_ty,
508
- ast_bounds . iter ( ) ,
508
+ hir_bounds . iter ( ) ,
509
509
bounds,
510
510
projection_ty. bound_vars ( ) ,
511
511
only_self_bounds,
0 commit comments