1
Fork 0

Update local variables and tracing calls

Most of the tracing calls didn't fully leverage the power of `tracing`.
For example, several of them used to hard-code method names / tracing spans
as well as variable names. Use `#[instrument]` and `?var` / `%var` (etc.) instead.

In my opinion, this is the proper way to migrate them from the old
AstConv nomenclature to the new HIR ty lowering one.
This commit is contained in:
León Orell Valerian Liehr 2024-02-11 09:24:35 +01:00
parent 82c2c8deb1
commit b79335dbed
No known key found for this signature in database
GPG key ID: D17A07215F68E713
11 changed files with 136 additions and 148 deletions

View file

@ -37,6 +37,7 @@ pub use crate::traits::{MethodViolationCode, ObjectSafetyViolation};
/// Currently that is `Self` in supertraits. This is needed
/// because `object_safety_violations` can't be used during
/// type collection.
#[instrument(level = "debug", skip(tcx))]
pub fn hir_ty_lowering_object_safety_violations(
tcx: TyCtxt<'_>,
trait_def_id: DefId,
@ -47,9 +48,7 @@ pub fn hir_ty_lowering_object_safety_violations(
.filter(|spans| !spans.is_empty())
.map(ObjectSafetyViolation::SupertraitSelf)
.collect();
debug!("astconv_object_safety_violations(trait_def_id={:?}) = {:?}", trait_def_id, violations);
debug!(?violations);
violations
}