diff --git a/compiler/rustc_infer/src/infer/combine.rs b/compiler/rustc_infer/src/infer/combine.rs index 364a8ce3e53..5e11932eafc 100644 --- a/compiler/rustc_infer/src/infer/combine.rs +++ b/compiler/rustc_infer/src/infer/combine.rs @@ -221,6 +221,7 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> { /// As `3 + 4` contains `N` in its substs, this must not succeed. /// /// See `src/test/ui/const-generics/occurs-check/` for more examples where this is relevant. + #[instrument(level = "debug", skip(self))] fn unify_const_variable( &self, param_env: ty::ParamEnv<'tcx>, @@ -228,7 +229,6 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> { ct: &'tcx ty::Const<'tcx>, vid_is_expected: bool, ) -> RelateResult<'tcx, &'tcx ty::Const<'tcx>> { - debug!("unify_const_variable: param_env={:?}", param_env); let (for_universe, span) = { let mut inner = self.inner.borrow_mut(); let variable_table = &mut inner.const_unification_table(); diff --git a/compiler/rustc_middle/src/mir/interpret/queries.rs b/compiler/rustc_middle/src/mir/interpret/queries.rs index 3a2496315c3..3e7b93b32a6 100644 --- a/compiler/rustc_middle/src/mir/interpret/queries.rs +++ b/compiler/rustc_middle/src/mir/interpret/queries.rs @@ -31,6 +31,7 @@ impl<'tcx> TyCtxt<'tcx> { /// constant `bar::()` requires a substitution for `T`, if the substitution for `T` is still /// too generic for the constant to be evaluated then `Err(ErrorHandled::TooGeneric)` is /// returned. + #[instrument(level = "debug", skip(self))] pub fn const_eval_resolve( self, param_env: ty::ParamEnv<'tcx>, @@ -39,7 +40,6 @@ impl<'tcx> TyCtxt<'tcx> { promoted: Option, span: Option, ) -> EvalToConstValueResult<'tcx> { - debug!("const_eval_resolve: param_env={:?}", param_env); match ty::Instance::resolve_opt_const_arg(self, param_env, def, substs) { Ok(Some(instance)) => { let cid = GlobalId { instance, promoted }; diff --git a/compiler/rustc_middle/src/ty/instance.rs b/compiler/rustc_middle/src/ty/instance.rs index 560b00a281d..de012a69574 100644 --- a/compiler/rustc_middle/src/ty/instance.rs +++ b/compiler/rustc_middle/src/ty/instance.rs @@ -347,13 +347,13 @@ impl<'tcx> Instance<'tcx> { } // This should be kept up to date with `resolve`. + #[instrument(level = "debug", skip(tcx))] pub fn resolve_opt_const_arg( tcx: TyCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>, def: ty::WithOptConstParam, substs: SubstsRef<'tcx>, ) -> Result>, ErrorReported> { - debug!("resolve_opt_const_arg: param_env={:?},substs={:?}", param_env, substs); // All regions in the result of this query are erased, so it's // fine to erase all of the input regions. diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index 3acf53ba3ec..1cc580a1983 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -10,11 +10,11 @@ use traits::{translate_substs, Reveal}; use tracing::debug; +#[instrument(level = "debug", skip(tcx))] fn resolve_instance<'tcx>( tcx: TyCtxt<'tcx>, key: ty::ParamEnvAnd<'tcx, (DefId, SubstsRef<'tcx>)>, ) -> Result>, ErrorReported> { - debug!("resolve_instance: key = {:?}", key); let (param_env, (did, substs)) = key.into_parts(); if let Some(did) = did.as_local() { if let Some(param_did) = tcx.opt_const_param_of(did) { @@ -39,13 +39,13 @@ fn resolve_instance_of_const_arg<'tcx>( ) } +#[instrument(level = "debug", skip(tcx))] fn inner_resolve_instance<'tcx>( tcx: TyCtxt<'tcx>, key: ty::ParamEnvAnd<'tcx, (ty::WithOptConstParam, SubstsRef<'tcx>)>, ) -> Result>, ErrorReported> { let (param_env, (def, substs)) = key.into_parts(); - debug!("inner_resolve_instance: key={:?}", key); let result = if let Some(trait_def_id) = tcx.trait_of_item(def.did) { debug!(" => associated item, attempting to find impl in param_env {:#?}", param_env); let item = tcx.associated_item(def.did); @@ -94,10 +94,7 @@ fn inner_resolve_instance<'tcx>( }; Ok(Some(Instance { def, substs })) }; - debug!( - "inner_resolve_instance: resolve(def.did={:?}, substs={:?}) = {:?}", - def.did, substs, result - ); + debug!("inner_resolve_instance: result={:?}", result); result }