Skip to content

Commit 361dcd5

Browse files
committed
Use debug log level for developer oriented logs
The information logged here is of limited general interest, while at the same times makes it impractical to simply enable logging and share the resulting logs due to the amount of the output produced. Reduce log level from info to debug for developer oriented information. For example, when building cargo, this reduces the amount of logs generated by `RUSTC_LOG=info cargo build` from 265 MB to 79 MB. Continuation of changes from 81350.
1 parent dd4851d commit 361dcd5

File tree

7 files changed

+16
-10
lines changed

7 files changed

+16
-10
lines changed

compiler/rustc_mir/src/transform/inline.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl Inliner<'tcx> {
159159
}
160160
}
161161

162-
#[instrument(skip(self, caller_body))]
162+
#[instrument(level = "debug", skip(self, caller_body))]
163163
fn is_mir_available(&self, callee: Instance<'tcx>, caller_body: &Body<'tcx>) -> bool {
164164
match callee.def {
165165
InstanceDef::Item(_) => {
@@ -258,7 +258,7 @@ impl Inliner<'tcx> {
258258
None
259259
}
260260

261-
#[instrument(skip(self, callee_body))]
261+
#[instrument(level = "debug", skip(self, callee_body))]
262262
fn should_inline(&self, callsite: CallSite<'tcx>, callee_body: &Body<'tcx>) -> bool {
263263
let tcx = self.tcx;
264264

compiler/rustc_mir/src/transform/inline/cycle.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_middle::ty::{self, subst::SubstsRef, InstanceDef, TyCtxt};
77

88
// FIXME: check whether it is cheaper to precompute the entire call graph instead of invoking
99
// this query riddiculously often.
10-
#[instrument(skip(tcx, root, target))]
10+
#[instrument(level = "debug", skip(tcx, root, target))]
1111
crate fn mir_callgraph_reachable(
1212
tcx: TyCtxt<'tcx>,
1313
(root, target): (ty::Instance<'tcx>, LocalDefId),
@@ -27,7 +27,10 @@ crate fn mir_callgraph_reachable(
2727
!tcx.is_constructor(root.def_id()),
2828
"you should not call `mir_callgraph_reachable` on enum/struct constructor functions"
2929
);
30-
#[instrument(skip(tcx, param_env, target, stack, seen, recursion_limiter, caller))]
30+
#[instrument(
31+
level = "debug",
32+
skip(tcx, param_env, target, stack, seen, recursion_limiter, caller)
33+
)]
3134
fn process(
3235
tcx: TyCtxt<'tcx>,
3336
param_env: ty::ParamEnv<'tcx>,

compiler/rustc_mir_build/src/thir/pattern/usefulness.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,10 @@ impl<'tcx> Witness<'tcx> {
10791079
/// `is_under_guard` is used to inform if the pattern has a guard. If it
10801080
/// has one it must not be inserted into the matrix. This shouldn't be
10811081
/// relied on for soundness.
1082-
#[instrument(skip(cx, matrix, witness_preference, hir_id, is_under_guard, is_top_level))]
1082+
#[instrument(
1083+
level = "debug",
1084+
skip(cx, matrix, witness_preference, hir_id, is_under_guard, is_top_level)
1085+
)]
10831086
fn is_useful<'p, 'tcx>(
10841087
cx: &MatchCheckCtxt<'p, 'tcx>,
10851088
matrix: &Matrix<'p, 'tcx>,

compiler/rustc_span/src/hygiene.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1405,8 +1405,8 @@ fn update_disambiguator(expn_id: ExpnId) {
14051405
});
14061406

14071407
if modified {
1408-
info!("Set disambiguator for {:?} (hash {:?})", expn_id, first_hash);
1409-
info!("expn_data = {:?}", expn_id.expn_data());
1408+
debug!("Set disambiguator for {:?} (hash {:?})", expn_id, first_hash);
1409+
debug!("expn_data = {:?}", expn_id.expn_data());
14101410

14111411
// Verify that the new disambiguator makes the hash unique
14121412
#[cfg(debug_assertions)]

compiler/rustc_trait_selection/src/traits/codegen.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub fn codegen_fulfill_obligation<'tcx>(
9191
});
9292
let impl_source = drain_fulfillment_cx_or_panic(&infcx, &mut fulfill_cx, impl_source);
9393

94-
info!("Cache miss: {:?} => {:?}", trait_ref, impl_source);
94+
debug!("Cache miss: {:?} => {:?}", trait_ref, impl_source);
9595
Ok(impl_source)
9696
})
9797
}

compiler/rustc_trait_selection/src/traits/fulfill.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
647647
ProcessResult::Unchanged
648648
}
649649
Err(selection_err) => {
650-
info!("selecting trait at depth {} yielded Err", obligation.recursion_depth);
650+
debug!("selecting trait at depth {} yielded Err", obligation.recursion_depth);
651651

652652
ProcessResult::Error(CodeSelectionError(selection_err))
653653
}

compiler/rustc_traits/src/dropck_outlives.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn dropck_outlives<'tcx>(
8080
let cause = ObligationCause::dummy();
8181
let mut constraints = DtorckConstraint::empty();
8282
while let Some((ty, depth)) = ty_stack.pop() {
83-
info!(
83+
debug!(
8484
"{} kinds, {} overflows, {} ty_stack",
8585
result.kinds.len(),
8686
result.overflows.len(),

0 commit comments

Comments
 (0)