mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
Auto merge of #88980 - tmiasko:instrument-debug, r=oli-obk
Use explicit log level in tracing instrument macro Specify a log level in tracing instrument macro explicitly. Additionally reduce the used log level from a default info level to a debug level (all of those appear to be developer oriented logs, so there should be no need to include them in release builds).
This commit is contained in:
commit
5438ee424c
@ -46,7 +46,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
/// Calling `universal_upper_bound` for such a region gives `fr_fn_body`,
|
||||
/// which has no `external_name` in which case we use `'empty` as the
|
||||
/// region to pass to `infer_opaque_definition_from_instantiation`.
|
||||
#[instrument(skip(self, infcx))]
|
||||
#[instrument(level = "debug", skip(self, infcx))]
|
||||
pub(crate) fn infer_opaque_types(
|
||||
&self,
|
||||
infcx: &InferCtxt<'_, 'tcx>,
|
||||
|
@ -30,7 +30,7 @@ pub fn provide(providers: &mut Providers) {
|
||||
/// Determine which generic parameters are used by the function/method/closure represented by
|
||||
/// `def_id`. Returns a bitset where bits representing unused parameters are set (`is_empty`
|
||||
/// indicates all parameters are used).
|
||||
#[instrument(skip(tcx))]
|
||||
#[instrument(level = "debug", skip(tcx))]
|
||||
fn unused_generic_params(tcx: TyCtxt<'_>, def_id: DefId) -> FiniteBitSet<u32> {
|
||||
if !tcx.sess.opts.debugging_opts.polymorphize {
|
||||
// If polymorphization disabled, then all parameters are used.
|
||||
@ -100,7 +100,7 @@ fn unused_generic_params(tcx: TyCtxt<'_>, def_id: DefId) -> FiniteBitSet<u32> {
|
||||
/// Some parameters are considered used-by-default, such as non-generic parameters and the dummy
|
||||
/// generic parameters from closures, this function marks them as used. `leaf_is_closure` should
|
||||
/// be `true` if the item that `unused_generic_params` was invoked on is a closure.
|
||||
#[instrument(skip(tcx, def_id, generics, unused_parameters))]
|
||||
#[instrument(level = "debug", skip(tcx, def_id, generics, unused_parameters))]
|
||||
fn mark_used_by_default_parameters<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
def_id: DefId,
|
||||
@ -158,7 +158,7 @@ fn mark_used_by_default_parameters<'tcx>(
|
||||
|
||||
/// Search the predicates on used generic parameters for any unused generic parameters, and mark
|
||||
/// those as used.
|
||||
#[instrument(skip(tcx, def_id))]
|
||||
#[instrument(level = "debug", skip(tcx, def_id))]
|
||||
fn mark_used_by_predicates<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
def_id: DefId,
|
||||
@ -196,7 +196,7 @@ fn mark_used_by_predicates<'tcx>(
|
||||
|
||||
/// Emit errors for the function annotated by `#[rustc_polymorphize_error]`, labelling each generic
|
||||
/// parameter which was unused.
|
||||
#[instrument(skip(tcx, generics))]
|
||||
#[instrument(level = "debug", skip(tcx, generics))]
|
||||
fn emit_unused_generic_params_error<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
def_id: DefId,
|
||||
@ -241,7 +241,7 @@ struct MarkUsedGenericParams<'a, 'tcx> {
|
||||
impl<'a, 'tcx> MarkUsedGenericParams<'a, 'tcx> {
|
||||
/// Invoke `unused_generic_params` on a body contained within the current item (e.g.
|
||||
/// a closure, generator or constant).
|
||||
#[instrument(skip(self, def_id, substs))]
|
||||
#[instrument(level = "debug", skip(self, def_id, substs))]
|
||||
fn visit_child_body(&mut self, def_id: DefId, substs: SubstsRef<'tcx>) {
|
||||
let unused = self.tcx.unused_generic_params(def_id);
|
||||
debug!(?self.unused_parameters, ?unused);
|
||||
@ -256,7 +256,7 @@ impl<'a, 'tcx> MarkUsedGenericParams<'a, 'tcx> {
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Visitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
|
||||
#[instrument(skip(self, local))]
|
||||
#[instrument(level = "debug", skip(self, local))]
|
||||
fn visit_local_decl(&mut self, local: Local, local_decl: &LocalDecl<'tcx>) {
|
||||
if local == Local::from_usize(1) {
|
||||
let def_kind = self.tcx.def_kind(self.def_id);
|
||||
@ -286,7 +286,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
|
||||
fn tcx_for_anon_const_substs(&self) -> Option<TyCtxt<'tcx>> {
|
||||
Some(self.tcx)
|
||||
}
|
||||
#[instrument(skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_const(&mut self, c: &'tcx Const<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
if !c.potentially_has_param_types_or_consts() {
|
||||
return ControlFlow::CONTINUE;
|
||||
@ -319,7 +319,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[instrument(skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
if !ty.potentially_has_param_types_or_consts() {
|
||||
return ControlFlow::CONTINUE;
|
||||
@ -361,7 +361,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for HasUsedGenericParams<'a, 'tcx> {
|
||||
Some(self.tcx)
|
||||
}
|
||||
|
||||
#[instrument(skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_const(&mut self, c: &'tcx Const<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
if !c.potentially_has_param_types_or_consts() {
|
||||
return ControlFlow::CONTINUE;
|
||||
@ -379,7 +379,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for HasUsedGenericParams<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[instrument(skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
if !ty.potentially_has_param_types_or_consts() {
|
||||
return ControlFlow::CONTINUE;
|
||||
|
@ -99,7 +99,7 @@ impl<K: DepKind> SerializedDepGraph<K> {
|
||||
impl<'a, K: DepKind + Decodable<opaque::Decoder<'a>>> Decodable<opaque::Decoder<'a>>
|
||||
for SerializedDepGraph<K>
|
||||
{
|
||||
#[instrument(skip(d))]
|
||||
#[instrument(level = "debug", skip(d))]
|
||||
fn decode(d: &mut opaque::Decoder<'a>) -> Result<SerializedDepGraph<K>, String> {
|
||||
let start_position = d.position();
|
||||
|
||||
@ -187,7 +187,7 @@ impl<K: DepKind> EncoderState<K> {
|
||||
}
|
||||
}
|
||||
|
||||
#[instrument(skip(self, record_graph))]
|
||||
#[instrument(level = "debug", skip(self, record_graph))]
|
||||
fn encode_node(
|
||||
&mut self,
|
||||
node: &NodeInfo<K>,
|
||||
|
@ -499,7 +499,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||
/// - `substs`, the substs used to instantiate this opaque type
|
||||
/// - `instantiated_ty`, the inferred type C1 -- fully resolved, lifted version of
|
||||
/// `opaque_defn.concrete_ty`
|
||||
#[instrument(skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn infer_opaque_definition_from_instantiation(
|
||||
&self,
|
||||
opaque_type_key: OpaqueTypeKey<'tcx>,
|
||||
@ -863,7 +863,7 @@ struct Instantiator<'a, 'tcx> {
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Instantiator<'a, 'tcx> {
|
||||
#[instrument(skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn instantiate_opaque_types_in_map<T: TypeFoldable<'tcx>>(&mut self, value: T) -> T {
|
||||
let tcx = self.infcx.tcx;
|
||||
value.fold_with(&mut BottomUpFolder {
|
||||
|
Loading…
Reference in New Issue
Block a user