Skip to content

Commit 273ab1f

Browse files
committed
downgrade instrument logging too
1 parent e5f8405 commit 273ab1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+139
-139
lines changed

compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ trait TypeOpInfo<'tcx> {
161161
error_region: Option<ty::Region<'tcx>>,
162162
) -> Option<DiagnosticBuilder<'tcx, ErrorGuaranteed>>;
163163

164-
#[instrument(level = "debug", skip(self, mbcx))]
164+
#[instrument(level = "trace", skip(self, mbcx))]
165165
fn report_error(
166166
&self,
167167
mbcx: &mut MirBorrowckCtxt<'_, 'tcx>,
@@ -374,7 +374,7 @@ impl<'tcx> TypeOpInfo<'tcx> for crate::type_check::InstantiateOpaqueType<'tcx> {
374374
}
375375
}
376376

377-
#[instrument(skip(ocx), level = "debug")]
377+
#[instrument(skip(ocx), level = "trace")]
378378
fn try_extract_error_from_fulfill_cx<'tcx>(
379379
ocx: &ObligationCtxt<'_, 'tcx>,
380380
placeholder_region: ty::Region<'tcx>,
@@ -395,7 +395,7 @@ fn try_extract_error_from_fulfill_cx<'tcx>(
395395
)
396396
}
397397

398-
#[instrument(level = "debug", skip(infcx, region_var_origin, universe_of_region))]
398+
#[instrument(level = "trace", skip(infcx, region_var_origin, universe_of_region))]
399399
fn try_extract_error_from_region_constraints<'tcx>(
400400
infcx: &InferCtxt<'tcx>,
401401
placeholder_region: ty::Region<'tcx>,

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
11691169
err
11701170
}
11711171

1172-
#[instrument(level = "debug", skip(self, err))]
1172+
#[instrument(level = "trace", skip(self, err))]
11731173
fn suggest_using_local_if_applicable(
11741174
&self,
11751175
err: &mut Diagnostic,
@@ -1651,7 +1651,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
16511651
/// short a lifetime. (But sometimes it is more useful to report
16521652
/// it as a more direct conflict between the execution of a
16531653
/// `Drop::drop` with an aliasing borrow.)
1654-
#[instrument(level = "debug", skip(self))]
1654+
#[instrument(level = "trace", skip(self))]
16551655
pub(crate) fn report_borrowed_value_does_not_live_long_enough(
16561656
&mut self,
16571657
location: Location,
@@ -2008,7 +2008,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
20082008
err
20092009
}
20102010

2011-
#[instrument(level = "debug", skip(self))]
2011+
#[instrument(level = "trace", skip(self))]
20122012
fn report_temporary_value_does_not_live_long_enough(
20132013
&mut self,
20142014
location: Location,
@@ -2223,7 +2223,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
22232223
Some(err)
22242224
}
22252225

2226-
#[instrument(level = "debug", skip(self))]
2226+
#[instrument(level = "trace", skip(self))]
22272227
fn report_escaping_closure_capture(
22282228
&mut self,
22292229
use_span: UseSpans<'tcx>,

compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
359359
/// - second half is the place being accessed
360360
///
361361
/// [d]: https://rust-lang.github.io/rfcs/2094-nll.html#leveraging-intuition-framing-errors-in-terms-of-points
362-
#[instrument(level = "debug", skip(self))]
362+
#[instrument(level = "trace", skip(self))]
363363
pub(crate) fn explain_why_borrow_contains_point(
364364
&self,
365365
location: Location,
@@ -461,7 +461,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
461461
/// First span returned points to the location of the conflicting use
462462
/// Second span if `Some` is returned in the case of closures and points
463463
/// to the use of the path
464-
#[instrument(level = "debug", skip(self))]
464+
#[instrument(level = "trace", skip(self))]
465465
fn later_use_kind(
466466
&self,
467467
borrow: &BorrowData<'tcx>,

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
641641
/// LL | ref_obj(x)
642642
/// | ^^^^^^^^^^ `x` escapes the function body here
643643
/// ```
644-
#[instrument(level = "debug", skip(self))]
644+
#[instrument(level = "trace", skip(self))]
645645
fn report_escaping_data_error(
646646
&self,
647647
errci: &ErrorConstraintInfo<'tcx>,
@@ -941,7 +941,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
941941
self.suggest_constrain_dyn_trait_in_impl(diag, &visitor.0, ident, self_ty);
942942
}
943943

944-
#[instrument(skip(self, err), level = "debug")]
944+
#[instrument(skip(self, err), level = "trace")]
945945
fn suggest_constrain_dyn_trait_in_impl(
946946
&self,
947947
err: &mut Diagnostic,

compiler/rustc_borrowck/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fn mir_borrowck(tcx: TyCtxt<'_>, def: LocalDefId) -> &BorrowCheckResult<'_> {
155155
/// Use `consumer_options: None` for the default behavior of returning
156156
/// [`BorrowCheckResult`] only. Otherwise, return [`BodyWithBorrowckFacts`] according
157157
/// to the given [`ConsumerOptions`].
158-
#[instrument(skip(infcx, input_body, input_promoted), fields(id=?input_body.source.def_id()), level = "debug")]
158+
#[instrument(skip(infcx, input_body, input_promoted), fields(id=?input_body.source.def_id()), level = "trace")]
159159
fn do_mir_borrowck<'tcx>(
160160
infcx: &InferCtxt<'tcx>,
161161
input_body: &Body<'tcx>,
@@ -491,7 +491,7 @@ impl<'cx, 'tcx> BorrowckInferCtxt<'cx, 'tcx> {
491491
next_region
492492
}
493493

494-
#[instrument(skip(self, get_ctxt_fn), level = "debug")]
494+
#[instrument(skip(self, get_ctxt_fn), level = "trace")]
495495
pub(crate) fn next_nll_region_var<F>(
496496
&self,
497497
origin: NllRegionVariableOrigin,
@@ -1022,7 +1022,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
10221022
}
10231023
}
10241024

1025-
#[instrument(level = "debug", skip(self, flow_state))]
1025+
#[instrument(level = "trace", skip(self, flow_state))]
10261026
fn check_access_for_conflict(
10271027
&mut self,
10281028
location: Location,
@@ -1485,7 +1485,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
14851485

14861486
/// Checks whether a borrow of this place is invalidated when the function
14871487
/// exits
1488-
#[instrument(level = "debug", skip(self))]
1488+
#[instrument(level = "trace", skip(self))]
14891489
fn check_for_invalidation_at_exit(
14901490
&mut self,
14911491
location: Location,

compiler/rustc_borrowck/src/nll.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub(crate) struct NllOutput<'tcx> {
5555
/// Rewrites the regions in the MIR to use NLL variables, also scraping out the set of universal
5656
/// regions (e.g., region parameters) declared on the function. That set will need to be given to
5757
/// `compute_regions`.
58-
#[instrument(skip(infcx, param_env, body, promoted), level = "debug")]
58+
#[instrument(skip(infcx, param_env, body, promoted), level = "trace")]
5959
pub(crate) fn replace_regions_in_mir<'tcx>(
6060
infcx: &BorrowckInferCtxt<'_, 'tcx>,
6161
param_env: ty::ParamEnv<'tcx>,

compiler/rustc_borrowck/src/places_conflict.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn places_conflict<'tcx>(
4646
/// access depth. The `bias` parameter is used to determine how the unknowable (comparing runtime
4747
/// array indices, for example) should be interpreted - this depends on what the caller wants in
4848
/// order to make the conservative choice and preserve soundness.
49-
#[instrument(level = "debug", skip(tcx, body))]
49+
#[instrument(level = "trace", skip(tcx, body))]
5050
pub(super) fn borrow_conflicts_with_place<'tcx>(
5151
tcx: TyCtxt<'tcx>,
5252
body: &Body<'tcx>,

compiler/rustc_borrowck/src/region_infer/mod.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ pub enum ExtraConstraintInfo {
245245
PlaceholderFromPredicate(Span),
246246
}
247247

248-
#[instrument(skip(infcx, sccs), level = "debug")]
248+
#[instrument(skip(infcx, sccs), level = "trace")]
249249
fn sccs_info<'cx, 'tcx>(
250250
infcx: &'cx BorrowckInferCtxt<'cx, 'tcx>,
251251
sccs: Rc<Sccs<RegionVid, ConstraintSccIndex>>,
@@ -655,7 +655,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
655655
/// Performs region inference and report errors if we see any
656656
/// unsatisfiable constraints. If this is a closure, returns the
657657
/// region requirements to propagate to our creator, if any.
658-
#[instrument(skip(self, infcx, body, polonius_output), level = "debug")]
658+
#[instrument(skip(self, infcx, body, polonius_output), level = "trace")]
659659
pub(super) fn solve(
660660
&mut self,
661661
infcx: &InferCtxt<'tcx>,
@@ -717,7 +717,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
717717
/// for each region variable until all the constraints are
718718
/// satisfied. Note that some values may grow **too** large to be
719719
/// feasible, but we check this later.
720-
#[instrument(skip(self, _body), level = "debug")]
720+
#[instrument(skip(self, _body), level = "trace")]
721721
fn propagate_constraints(&mut self, _body: &Body<'tcx>) {
722722
trace!("constraints={:#?}", {
723723
let mut constraints: Vec<_> = self.outlives_constraints().collect();
@@ -746,7 +746,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
746746
/// computed, by unioning the values of its successors.
747747
/// Assumes that all successors have been computed already
748748
/// (which is assured by iterating over SCCs in dependency order).
749-
#[instrument(skip(self), level = "debug")]
749+
#[instrument(skip(self), level = "trace")]
750750
fn compute_value_for_scc(&mut self, scc_a: ConstraintSccIndex) {
751751
let constraint_sccs = self.constraint_sccs.clone();
752752

@@ -787,7 +787,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
787787
/// is considered a *lower bound*. If possible, we will modify
788788
/// the constraint to set it equal to one of the option regions.
789789
/// If we make any changes, returns true, else false.
790-
#[instrument(skip(self, member_constraint_index), level = "debug")]
790+
#[instrument(skip(self, member_constraint_index), level = "trace")]
791791
fn apply_member_constraint(
792792
&mut self,
793793
scc: ConstraintSccIndex,
@@ -1014,7 +1014,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
10141014
/// The idea then is to lower the `T: 'X` constraint into multiple
10151015
/// bounds -- e.g., if `'X` is the union of two free lifetimes,
10161016
/// `'1` and `'2`, then we would create `T: '1` and `T: '2`.
1017-
#[instrument(level = "debug", skip(self, infcx, propagated_outlives_requirements))]
1017+
#[instrument(level = "trace", skip(self, infcx, propagated_outlives_requirements))]
10181018
fn try_promote_type_test(
10191019
&self,
10201020
infcx: &InferCtxt<'tcx>,
@@ -1114,7 +1114,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
11141114
/// variables in the type `T` with an equal universal region from the
11151115
/// closure signature.
11161116
/// This is not always possible, so this is a fallible process.
1117-
#[instrument(level = "debug", skip(self, infcx))]
1117+
#[instrument(level = "trace", skip(self, infcx))]
11181118
fn try_promote_type_test_subject(
11191119
&self,
11201120
infcx: &InferCtxt<'tcx>,
@@ -1195,7 +1195,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
11951195
/// include the CFG anyhow.
11961196
/// - For each `end('x)` element in `'r`, compute the mutual LUB, yielding
11971197
/// a result `'y`.
1198-
#[instrument(skip(self), level = "debug", ret)]
1198+
#[instrument(skip(self), level = "trace", ret)]
11991199
pub(crate) fn universal_upper_bound(&self, r: RegionVid) -> RegionVid {
12001200
trace!(r = %self.region_value_str(r));
12011201

@@ -1221,7 +1221,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
12211221
/// Therefore, this method should only be used in diagnostic code,
12221222
/// where displaying *some* named universal region is better than
12231223
/// falling back to 'static.
1224-
#[instrument(level = "debug", skip(self))]
1224+
#[instrument(level = "trace", skip(self))]
12251225
pub(crate) fn approx_universal_upper_bound(&self, r: RegionVid) -> RegionVid {
12261226
trace!("{}", self.region_value_str(r));
12271227

@@ -1372,7 +1372,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
13721372
}
13731373

13741374
// Evaluate whether `sup_region: sub_region`.
1375-
#[instrument(skip(self), level = "debug", ret)]
1375+
#[instrument(skip(self), level = "trace", ret)]
13761376
fn eval_outlives(&self, sup_region: RegionVid, sub_region: RegionVid) -> bool {
13771377
trace!(
13781378
"sup_region's value = {:?} universal={:?}",
@@ -1589,7 +1589,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
15891589
///
15901590
/// Things that are to be propagated are accumulated into the
15911591
/// `outlives_requirements` vector.
1592-
#[instrument(skip(self, propagated_outlives_requirements, errors_buffer), level = "debug")]
1592+
#[instrument(skip(self, propagated_outlives_requirements, errors_buffer), level = "trace")]
15931593
fn check_universal_region(
15941594
&self,
15951595
longer_fr: RegionVid,
@@ -1760,7 +1760,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
17601760
trace!("check_bound_universal_region: all bounds satisfied");
17611761
}
17621762

1763-
#[instrument(level = "debug", skip(self, infcx, errors_buffer))]
1763+
#[instrument(level = "trace", skip(self, infcx, errors_buffer))]
17641764
fn check_member_constraints(
17651765
&self,
17661766
infcx: &InferCtxt<'tcx>,
@@ -2042,7 +2042,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20422042
/// creating a constraint path that forces `R` to outlive
20432043
/// `from_region`, and then finding the best choices within that
20442044
/// path to blame.
2045-
#[instrument(level = "debug", skip(self, target_test))]
2045+
#[instrument(level = "trace", skip(self, target_test))]
20462046
pub(crate) fn best_blame_constraint(
20472047
&self,
20482048
from_region: RegionVid,

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
5757
/// Calling `universal_upper_bound` for such a region gives `fr_fn_body`,
5858
/// which has no `external_name` in which case we use `'empty` as the
5959
/// region to pass to `infer_opaque_definition_from_instantiation`.
60-
#[instrument(level = "debug", skip(self, infcx), ret)]
60+
#[instrument(level = "trace", skip(self, infcx), ret)]
6161
pub(crate) fn infer_opaque_types(
6262
&self,
6363
infcx: &InferCtxt<'tcx>,
@@ -243,7 +243,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
243243
/// - `substs`, the substs used to instantiate this opaque type
244244
/// - `instantiated_ty`, the inferred type C1 -- fully resolved, lifted version of
245245
/// `opaque_defn.concrete_ty`
246-
#[instrument(level = "debug", skip(self))]
246+
#[instrument(level = "trace", skip(self))]
247247
fn infer_opaque_definition_from_instantiation(
248248
&self,
249249
opaque_type_key: OpaqueTypeKey<'tcx>,

compiler/rustc_borrowck/src/renumber.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_span::{Span, Symbol};
1212

1313
/// Replaces all free regions appearing in the MIR with fresh
1414
/// inference variables, returning the number of variables created.
15-
#[instrument(skip(infcx, body, promoted), level = "debug")]
15+
#[instrument(skip(infcx, body, promoted), level = "trace")]
1616
pub fn renumber_mir<'tcx>(
1717
infcx: &BorrowckInferCtxt<'_, 'tcx>,
1818
body: &mut Body<'tcx>,
@@ -86,37 +86,37 @@ impl<'a, 'tcx> MutVisitor<'tcx> for RegionRenumberer<'a, 'tcx> {
8686
self.infcx.tcx
8787
}
8888

89-
#[instrument(skip(self), level = "debug")]
89+
#[instrument(skip(self), level = "trace")]
9090
fn visit_ty(&mut self, ty: &mut Ty<'tcx>, ty_context: TyContext) {
9191
*ty = self.renumber_regions(*ty, || RegionCtxt::TyContext(ty_context));
9292

9393
trace!(?ty);
9494
}
9595

96-
#[instrument(skip(self), level = "debug")]
96+
#[instrument(skip(self), level = "trace")]
9797
fn visit_substs(&mut self, substs: &mut SubstsRef<'tcx>, location: Location) {
9898
*substs = self.renumber_regions(*substs, || RegionCtxt::Location(location));
9999

100100
trace!(?substs);
101101
}
102102

103-
#[instrument(skip(self), level = "debug")]
103+
#[instrument(skip(self), level = "trace")]
104104
fn visit_region(&mut self, region: &mut ty::Region<'tcx>, location: Location) {
105105
let old_region = *region;
106106
*region = self.renumber_regions(old_region, || RegionCtxt::Location(location));
107107

108108
trace!(?region);
109109
}
110110

111-
#[instrument(skip(self), level = "debug")]
111+
#[instrument(skip(self), level = "trace")]
112112
fn visit_ty_const(&mut self, ct: &mut ty::Const<'tcx>, location: Location) {
113113
let old_ct = *ct;
114114
*ct = self.renumber_regions(old_ct, || RegionCtxt::Location(location));
115115

116116
trace!(?ct);
117117
}
118118

119-
#[instrument(skip(self), level = "debug")]
119+
#[instrument(skip(self), level = "trace")]
120120
fn visit_constant(&mut self, constant: &mut Constant<'tcx>, location: Location) {
121121
let literal = constant.literal;
122122
constant.literal = self.renumber_regions(literal, || RegionCtxt::Location(location));

compiler/rustc_borrowck/src/type_check/canonical.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
8181
instantiated
8282
}
8383

84-
#[instrument(skip(self), level = "debug")]
84+
#[instrument(skip(self), level = "trace")]
8585
pub(super) fn prove_trait_ref(
8686
&mut self,
8787
trait_ref: ty::TraitRef<'tcx>,
@@ -99,7 +99,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
9999
);
100100
}
101101

102-
#[instrument(level = "debug", skip(self))]
102+
#[instrument(level = "trace", skip(self))]
103103
pub(super) fn normalize_and_prove_instantiated_predicates(
104104
&mut self,
105105
// Keep this parameter for now, in case we start using
@@ -127,7 +127,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
127127
}
128128
}
129129

130-
#[instrument(skip(self), level = "debug")]
130+
#[instrument(skip(self), level = "trace")]
131131
pub(super) fn prove_predicate(
132132
&mut self,
133133
predicate: impl ToPredicate<'tcx> + std::fmt::Debug,
@@ -150,7 +150,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
150150
self.normalize_with_category(value, location, ConstraintCategory::Boring)
151151
}
152152

153-
#[instrument(skip(self), level = "debug")]
153+
#[instrument(skip(self), level = "trace")]
154154
pub(super) fn normalize_with_category<T>(
155155
&mut self,
156156
value: T,
@@ -169,7 +169,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
169169
result.unwrap_or(value)
170170
}
171171

172-
#[instrument(skip(self), level = "debug")]
172+
#[instrument(skip(self), level = "trace")]
173173
pub(super) fn ascribe_user_type(
174174
&mut self,
175175
mir_ty: Ty<'tcx>,
@@ -186,7 +186,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
186186
/// *Incorrectly* skips the WF checks we normally do in `ascribe_user_type`.
187187
///
188188
/// FIXME(#104478, #104477): This is a hack for backward-compatibility.
189-
#[instrument(skip(self), level = "debug")]
189+
#[instrument(skip(self), level = "trace")]
190190
pub(super) fn ascribe_user_type_skip_wf(
191191
&mut self,
192192
mir_ty: Ty<'tcx>,

0 commit comments

Comments
 (0)