Skip to content

Commit 2aa43cb

Browse files
committed
Update tracing calls
1 parent f2d054e commit 2aa43cb

File tree

9 files changed

+120
-133
lines changed

9 files changed

+120
-133
lines changed

compiler/rustc_hir_analysis/src/astconv/bounds.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
2020
&self,
2121
bounds: &mut Bounds<'tcx>,
2222
self_ty: Ty<'tcx>,
23-
ast_bounds: &'tcx [hir::GenericBound<'tcx>],
23+
hir_bounds: &'tcx [hir::GenericBound<'tcx>],
2424
self_ty_where_predicates: Option<(LocalDefId, &'tcx [hir::WherePredicate<'tcx>])>,
2525
span: Span,
2626
) {
@@ -31,9 +31,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
3131

3232
// Try to find an unbound in bounds.
3333
let mut unbounds: SmallVec<[_; 1]> = SmallVec::new();
34-
let mut search_bounds = |ast_bounds: &'tcx [hir::GenericBound<'tcx>]| {
35-
for ab in ast_bounds {
36-
let hir::GenericBound::Trait(ptr, modifier) = ab else {
34+
let mut search_bounds = |hir_bounds: &'tcx [hir::GenericBound<'tcx>]| {
35+
for hir_bound in hir_bounds {
36+
let hir::GenericBound::Trait(ptr, modifier) = hir_bound else {
3737
continue;
3838
};
3939
match modifier {
@@ -56,7 +56,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
5656
}
5757
}
5858
};
59-
search_bounds(ast_bounds);
59+
search_bounds(hir_bounds);
6060
if let Some((self_ty, where_clause)) = self_ty_where_predicates {
6161
for clause in where_clause {
6262
if let hir::WherePredicate::BoundPredicate(pred) = clause
@@ -105,28 +105,28 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
105105
///
106106
/// ```ignore (illustrative)
107107
/// fn foo<T: Debug>() { }
108-
/// ^ ^^^^^ `ast_bounds`, in HIR form
108+
/// ^ ^^^^^ `hir_bounds`, in HIR form
109109
/// |
110110
/// `param_ty`, in ty form
111111
/// ```
112112
///
113113
/// ### A Note on Binders
114114
///
115-
/// There is an implied binder around `param_ty` and `ast_bounds`.
115+
/// There is an implied binder around `param_ty` and `hir_bounds`.
116116
/// See `lower_poly_trait_ref` for more details.
117-
#[instrument(level = "debug", skip(self, ast_bounds, bounds))]
117+
#[instrument(level = "debug", skip(self, hir_bounds, bounds))]
118118
pub(crate) fn lower_bounds<'hir, I: Iterator<Item = &'hir hir::GenericBound<'tcx>>>(
119119
&self,
120120
param_ty: Ty<'tcx>,
121-
ast_bounds: I,
121+
hir_bounds: I,
122122
bounds: &mut Bounds<'tcx>,
123123
bound_vars: &'tcx ty::List<ty::BoundVariableKind>,
124124
only_self_bounds: OnlySelfBounds,
125125
) where
126126
'tcx: 'hir,
127127
{
128-
for ast_bound in ast_bounds {
129-
match ast_bound {
128+
for hir_bound in hir_bounds {
129+
match hir_bound {
130130
hir::GenericBound::Trait(poly_trait_ref, modifier) => {
131131
let (constness, polarity) = match modifier {
132132
hir::TraitBoundModifier::Const => {
@@ -176,15 +176,15 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
176176
///
177177
/// ```ignore (illustrative)
178178
/// fn foo<T: Bar + Baz>() { }
179-
/// // ^ ^^^^^^^^^ ast_bounds
179+
/// // ^ ^^^^^^^^^ hir_bounds
180180
/// // param_ty
181181
/// ```
182182
// FIXME(astconv-no-more): This should renamed to make it clear how it differs from `lower_bounds`
183183
// Maybe `lower_mono_bounds` (as in no bound vars)?
184184
pub(crate) fn compute_bounds(
185185
&self,
186186
param_ty: Ty<'tcx>,
187-
ast_bounds: &[hir::GenericBound<'tcx>],
187+
hir_bounds: &[hir::GenericBound<'tcx>],
188188
filter: PredicateFilter,
189189
) -> Bounds<'tcx> {
190190
let mut bounds = Bounds::default();
@@ -198,7 +198,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
198198

199199
self.lower_bounds(
200200
param_ty,
201-
ast_bounds.iter().filter(|bound| match filter {
201+
hir_bounds.iter().filter(|bound| match filter {
202202
PredicateFilter::All
203203
| PredicateFilter::SelfOnly
204204
| PredicateFilter::SelfAndAssociatedTypeBounds => true,
@@ -490,7 +490,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
490490
}
491491
// Lower a constraint like `Item: Debug` as found in HIR bound `T: Iterator<Item: Debug>`
492492
// to a bound involving a projection: `<T as Iterator>::Item: Debug`.
493-
hir::TypeBindingKind::Constraint { bounds: ast_bounds } => {
493+
hir::TypeBindingKind::Constraint { bounds: hir_bounds } => {
494494
// NOTE: If `only_self_bounds` is true, do NOT expand this associated type bound into
495495
// a trait predicate, since we only want to add predicates for the `Self` type.
496496
if !only_self_bounds.0 {
@@ -499,7 +499,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
499499
let param_ty = Ty::new_alias(tcx, ty::Projection, projection_ty.skip_binder());
500500
self.lower_bounds(
501501
param_ty,
502-
ast_bounds.iter(),
502+
hir_bounds.iter(),
503503
bounds,
504504
projection_ty.bound_vars(),
505505
only_self_bounds,

0 commit comments

Comments
 (0)