Skip to content

Commit 5438ee4

Browse files
committed
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).
2 parents 6c33a0a + b6b19f3 commit 5438ee4

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
4646
/// Calling `universal_upper_bound` for such a region gives `fr_fn_body`,
4747
/// which has no `external_name` in which case we use `'empty` as the
4848
/// region to pass to `infer_opaque_definition_from_instantiation`.
49-
#[instrument(skip(self, infcx))]
49+
#[instrument(level = "debug", skip(self, infcx))]
5050
pub(crate) fn infer_opaque_types(
5151
&self,
5252
infcx: &InferCtxt<'_, 'tcx>,

compiler/rustc_monomorphize/src/polymorphize.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn provide(providers: &mut Providers) {
3030
/// Determine which generic parameters are used by the function/method/closure represented by
3131
/// `def_id`. Returns a bitset where bits representing unused parameters are set (`is_empty`
3232
/// indicates all parameters are used).
33-
#[instrument(skip(tcx))]
33+
#[instrument(level = "debug", skip(tcx))]
3434
fn unused_generic_params(tcx: TyCtxt<'_>, def_id: DefId) -> FiniteBitSet<u32> {
3535
if !tcx.sess.opts.debugging_opts.polymorphize {
3636
// If polymorphization disabled, then all parameters are used.
@@ -100,7 +100,7 @@ fn unused_generic_params(tcx: TyCtxt<'_>, def_id: DefId) -> FiniteBitSet<u32> {
100100
/// Some parameters are considered used-by-default, such as non-generic parameters and the dummy
101101
/// generic parameters from closures, this function marks them as used. `leaf_is_closure` should
102102
/// be `true` if the item that `unused_generic_params` was invoked on is a closure.
103-
#[instrument(skip(tcx, def_id, generics, unused_parameters))]
103+
#[instrument(level = "debug", skip(tcx, def_id, generics, unused_parameters))]
104104
fn mark_used_by_default_parameters<'tcx>(
105105
tcx: TyCtxt<'tcx>,
106106
def_id: DefId,
@@ -158,7 +158,7 @@ fn mark_used_by_default_parameters<'tcx>(
158158

159159
/// Search the predicates on used generic parameters for any unused generic parameters, and mark
160160
/// those as used.
161-
#[instrument(skip(tcx, def_id))]
161+
#[instrument(level = "debug", skip(tcx, def_id))]
162162
fn mark_used_by_predicates<'tcx>(
163163
tcx: TyCtxt<'tcx>,
164164
def_id: DefId,
@@ -196,7 +196,7 @@ fn mark_used_by_predicates<'tcx>(
196196

197197
/// Emit errors for the function annotated by `#[rustc_polymorphize_error]`, labelling each generic
198198
/// parameter which was unused.
199-
#[instrument(skip(tcx, generics))]
199+
#[instrument(level = "debug", skip(tcx, generics))]
200200
fn emit_unused_generic_params_error<'tcx>(
201201
tcx: TyCtxt<'tcx>,
202202
def_id: DefId,
@@ -241,7 +241,7 @@ struct MarkUsedGenericParams<'a, 'tcx> {
241241
impl<'a, 'tcx> MarkUsedGenericParams<'a, 'tcx> {
242242
/// Invoke `unused_generic_params` on a body contained within the current item (e.g.
243243
/// a closure, generator or constant).
244-
#[instrument(skip(self, def_id, substs))]
244+
#[instrument(level = "debug", skip(self, def_id, substs))]
245245
fn visit_child_body(&mut self, def_id: DefId, substs: SubstsRef<'tcx>) {
246246
let unused = self.tcx.unused_generic_params(def_id);
247247
debug!(?self.unused_parameters, ?unused);
@@ -256,7 +256,7 @@ impl<'a, 'tcx> MarkUsedGenericParams<'a, 'tcx> {
256256
}
257257

258258
impl<'a, 'tcx> Visitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
259-
#[instrument(skip(self, local))]
259+
#[instrument(level = "debug", skip(self, local))]
260260
fn visit_local_decl(&mut self, local: Local, local_decl: &LocalDecl<'tcx>) {
261261
if local == Local::from_usize(1) {
262262
let def_kind = self.tcx.def_kind(self.def_id);
@@ -286,7 +286,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
286286
fn tcx_for_anon_const_substs(&self) -> Option<TyCtxt<'tcx>> {
287287
Some(self.tcx)
288288
}
289-
#[instrument(skip(self))]
289+
#[instrument(level = "debug", skip(self))]
290290
fn visit_const(&mut self, c: &'tcx Const<'tcx>) -> ControlFlow<Self::BreakTy> {
291291
if !c.potentially_has_param_types_or_consts() {
292292
return ControlFlow::CONTINUE;
@@ -319,7 +319,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
319319
}
320320
}
321321

322-
#[instrument(skip(self))]
322+
#[instrument(level = "debug", skip(self))]
323323
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
324324
if !ty.potentially_has_param_types_or_consts() {
325325
return ControlFlow::CONTINUE;
@@ -361,7 +361,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for HasUsedGenericParams<'a, 'tcx> {
361361
Some(self.tcx)
362362
}
363363

364-
#[instrument(skip(self))]
364+
#[instrument(level = "debug", skip(self))]
365365
fn visit_const(&mut self, c: &'tcx Const<'tcx>) -> ControlFlow<Self::BreakTy> {
366366
if !c.potentially_has_param_types_or_consts() {
367367
return ControlFlow::CONTINUE;
@@ -379,7 +379,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for HasUsedGenericParams<'a, 'tcx> {
379379
}
380380
}
381381

382-
#[instrument(skip(self))]
382+
#[instrument(level = "debug", skip(self))]
383383
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
384384
if !ty.potentially_has_param_types_or_consts() {
385385
return ControlFlow::CONTINUE;

compiler/rustc_query_system/src/dep_graph/serialized.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<K: DepKind> SerializedDepGraph<K> {
9999
impl<'a, K: DepKind + Decodable<opaque::Decoder<'a>>> Decodable<opaque::Decoder<'a>>
100100
for SerializedDepGraph<K>
101101
{
102-
#[instrument(skip(d))]
102+
#[instrument(level = "debug", skip(d))]
103103
fn decode(d: &mut opaque::Decoder<'a>) -> Result<SerializedDepGraph<K>, String> {
104104
let start_position = d.position();
105105

@@ -187,7 +187,7 @@ impl<K: DepKind> EncoderState<K> {
187187
}
188188
}
189189

190-
#[instrument(skip(self, record_graph))]
190+
#[instrument(level = "debug", skip(self, record_graph))]
191191
fn encode_node(
192192
&mut self,
193193
node: &NodeInfo<K>,

compiler/rustc_trait_selection/src/opaque_types.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
499499
/// - `substs`, the substs used to instantiate this opaque type
500500
/// - `instantiated_ty`, the inferred type C1 -- fully resolved, lifted version of
501501
/// `opaque_defn.concrete_ty`
502-
#[instrument(skip(self))]
502+
#[instrument(level = "debug", skip(self))]
503503
fn infer_opaque_definition_from_instantiation(
504504
&self,
505505
opaque_type_key: OpaqueTypeKey<'tcx>,
@@ -863,7 +863,7 @@ struct Instantiator<'a, 'tcx> {
863863
}
864864

865865
impl<'a, 'tcx> Instantiator<'a, 'tcx> {
866-
#[instrument(skip(self))]
866+
#[instrument(level = "debug", skip(self))]
867867
fn instantiate_opaque_types_in_map<T: TypeFoldable<'tcx>>(&mut self, value: T) -> T {
868868
let tcx = self.infcx.tcx;
869869
value.fold_with(&mut BottomUpFolder {

0 commit comments

Comments
 (0)