about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-02-11 09:24:35 +0100
committerLeón Orell Valerian Liehr <me@fmease.dev>2024-03-22 06:32:23 +0100
commitb79335dbedfbb9599970c209c3f3e7a5e3e7b992 (patch)
tree2aa3d859b46c0fb3cec6666ae444e4870d4480b6 /compiler/rustc_trait_selection/src
parent82c2c8deb1fb7640fedfbc49b5647957a1d572db (diff)
downloadrust-b79335dbedfbb9599970c209c3f3e7a5e3e7b992.tar.gz
rust-b79335dbedfbb9599970c209c3f3e7a5e3e7b992.zip
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.
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/object_safety.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/object_safety.rs b/compiler/rustc_trait_selection/src/traits/object_safety.rs
index feca4d384bc..5efb41f2bd8 100644
--- a/compiler/rustc_trait_selection/src/traits/object_safety.rs
+++ b/compiler/rustc_trait_selection/src/traits/object_safety.rs
@@ -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
 }