Skip to content

Commit 41ebd16

Browse files
committed
solve: replace all debug with trace
1 parent 8b64adc commit 41ebd16

File tree

13 files changed

+63
-63
lines changed

13 files changed

+63
-63
lines changed

Diff for: compiler/rustc_trait_selection/src/solve/alias_relate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_middle::traits::solve::{Certainty, Goal, QueryResult};
2020
use rustc_middle::ty;
2121

2222
impl<'tcx> EvalCtxt<'_, 'tcx> {
23-
#[instrument(level = "debug", skip(self), ret)]
23+
#[instrument(level = "trace", skip(self), ret)]
2424
pub(super) fn compute_alias_relate_goal(
2525
&mut self,
2626
goal: Goal<'tcx, (ty::Term<'tcx>, ty::Term<'tcx>, ty::AliasRelationDirection)>,
@@ -50,7 +50,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
5050
self.try_evaluate_added_goals()?;
5151
let lhs = self.resolve_vars_if_possible(lhs);
5252
let rhs = self.resolve_vars_if_possible(rhs);
53-
debug!(?lhs, ?rhs);
53+
trace!(?lhs, ?rhs);
5454

5555
let variance = match direction {
5656
ty::AliasRelationDirection::Equate => ty::Variance::Invariant,

Diff for: compiler/rustc_trait_selection/src/solve/assembly/mod.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
282282
};
283283

284284
if normalized_self_ty.is_ty_var() {
285-
debug!("self type has been normalized to infer");
285+
trace!("self type has been normalized to infer");
286286
return self.forced_ambiguity(MaybeCause::Ambiguity).into_iter().collect();
287287
}
288288

@@ -331,7 +331,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
331331
.enter(|this| this.evaluate_added_goals_and_make_canonical_response(certainty))
332332
}
333333

334-
#[instrument(level = "debug", skip_all)]
334+
#[instrument(level = "trace", skip_all)]
335335
fn assemble_non_blanket_impl_candidates<G: GoalKind<'tcx>>(
336336
&mut self,
337337
goal: Goal<'tcx, G>,
@@ -447,7 +447,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
447447
}
448448
}
449449

450-
#[instrument(level = "debug", skip_all)]
450+
#[instrument(level = "trace", skip_all)]
451451
fn assemble_blanket_impl_candidates<G: GoalKind<'tcx>>(
452452
&mut self,
453453
goal: Goal<'tcx, G>,
@@ -470,7 +470,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
470470
}
471471
}
472472

473-
#[instrument(level = "debug", skip_all)]
473+
#[instrument(level = "trace", skip_all)]
474474
fn assemble_builtin_impl_candidates<G: GoalKind<'tcx>>(
475475
&mut self,
476476
goal: Goal<'tcx, G>,
@@ -544,7 +544,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
544544
}
545545
}
546546

547-
#[instrument(level = "debug", skip_all)]
547+
#[instrument(level = "trace", skip_all)]
548548
fn assemble_param_env_candidates<G: GoalKind<'tcx>>(
549549
&mut self,
550550
goal: Goal<'tcx, G>,
@@ -561,7 +561,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
561561
}
562562
}
563563

564-
#[instrument(level = "debug", skip_all)]
564+
#[instrument(level = "trace", skip_all)]
565565
fn assemble_alias_bound_candidates<G: GoalKind<'tcx>>(
566566
&mut self,
567567
goal: Goal<'tcx, G>,
@@ -665,7 +665,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
665665
}
666666
}
667667

668-
#[instrument(level = "debug", skip_all)]
668+
#[instrument(level = "trace", skip_all)]
669669
fn assemble_object_bound_candidates<G: GoalKind<'tcx>>(
670670
&mut self,
671671
goal: Goal<'tcx, G>,
@@ -756,7 +756,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
756756
///
757757
/// To do so we add an ambiguous candidate in case such an unknown impl could
758758
/// apply to the current goal.
759-
#[instrument(level = "debug", skip_all)]
759+
#[instrument(level = "trace", skip_all)]
760760
fn assemble_coherence_unknowable_candidates<G: GoalKind<'tcx>>(
761761
&mut self,
762762
goal: Goal<'tcx, G>,
@@ -785,7 +785,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
785785
// FIXME(@lcnr): The current structure here makes me unhappy and feels ugly. idk how
786786
// to improve this however. However, this should make it fairly straightforward to refine
787787
// the filtering going forward, so it seems alright-ish for now.
788-
#[instrument(level = "debug", skip(self, goal))]
788+
#[instrument(level = "trace", skip(self, goal))]
789789
fn discard_impls_shadowed_by_env<G: GoalKind<'tcx>>(
790790
&mut self,
791791
goal: Goal<'tcx, G>,
@@ -814,7 +814,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
814814
Certainty::Yes => {
815815
candidates.retain(|c| match c.source {
816816
CandidateSource::Impl(_) | CandidateSource::BuiltinImpl(_) => {
817-
debug!(?c, "discard impl candidate");
817+
trace!(?c, "discard impl candidate");
818818
false
819819
}
820820
CandidateSource::ParamEnv(_) | CandidateSource::AliasBound => true,
@@ -825,7 +825,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
825825
// to be ambig and wait for inference constraints. See
826826
// tests/ui/traits/next-solver/env-shadows-impls/ambig-env-no-shadow.rs
827827
Certainty::Maybe(cause) => {
828-
debug!(?cause, "force ambiguity");
828+
trace!(?cause, "force ambiguity");
829829
*candidates = self.forced_ambiguity(cause).into_iter().collect();
830830
}
831831
}
@@ -836,7 +836,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
836836
/// If there are multiple ways to prove a trait or projection goal, we have
837837
/// to somehow try to merge the candidates into one. If that fails, we return
838838
/// ambiguity.
839-
#[instrument(level = "debug", skip(self), ret)]
839+
#[instrument(level = "trace", skip(self), ret)]
840840
pub(super) fn merge_candidates(
841841
&mut self,
842842
candidates: Vec<Candidate<'tcx>>,

Diff for: compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::solve::EvalCtxt;
1717
//
1818
// For types with an "existential" binder, i.e. coroutine witnesses, we also
1919
// instantiate the binder with placeholders eagerly.
20-
#[instrument(level = "debug", skip(ecx), ret)]
20+
#[instrument(level = "trace", skip(ecx), ret)]
2121
pub(in crate::solve) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
2222
ecx: &EvalCtxt<'_, 'tcx>,
2323
ty: Ty<'tcx>,
@@ -96,7 +96,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
9696
}
9797
}
9898

99-
#[instrument(level = "debug", skip(ecx), ret)]
99+
#[instrument(level = "trace", skip(ecx), ret)]
100100
pub(in crate::solve) fn instantiate_constituent_tys_for_sized_trait<'tcx>(
101101
ecx: &EvalCtxt<'_, 'tcx>,
102102
ty: Ty<'tcx>,
@@ -160,7 +160,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_sized_trait<'tcx>(
160160
}
161161
}
162162

163-
#[instrument(level = "debug", skip(ecx), ret)]
163+
#[instrument(level = "trace", skip(ecx), ret)]
164164
pub(in crate::solve) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
165165
ecx: &EvalCtxt<'_, 'tcx>,
166166
ty: Ty<'tcx>,

Diff for: compiler/rustc_trait_selection/src/solve/eval_ctxt/canonical.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
8383
/// the values inferred while solving the instantiated goal.
8484
/// - `external_constraints`: additional constraints which aren't expressible
8585
/// using simple unification of inference variables.
86-
#[instrument(level = "debug", skip(self), ret)]
86+
#[instrument(level = "trace", skip(self), ret)]
8787
pub(in crate::solve) fn evaluate_added_goals_and_make_canonical_response(
8888
&mut self,
8989
certainty: Certainty,
@@ -166,15 +166,15 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
166166
/// external constraints do not need to record that opaque, since if it is
167167
/// further constrained by inference, that will be passed back in the var
168168
/// values.
169-
#[instrument(level = "debug", skip(self), ret)]
169+
#[instrument(level = "trace", skip(self), ret)]
170170
fn compute_external_query_constraints(
171171
&self,
172172
normalization_nested_goals: NestedNormalizationGoals<'tcx>,
173173
) -> Result<ExternalConstraintsData<'tcx>, NoSolution> {
174174
// We only check for leaks from universes which were entered inside
175175
// of the query.
176176
self.infcx.leak_check(self.max_input_universe, None).map_err(|e| {
177-
debug!(?e, "failed the leak check");
177+
trace!(?e, "failed the leak check");
178178
NoSolution
179179
})?;
180180

@@ -334,7 +334,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
334334
/// whether an alias is rigid by using the trait solver. When instantiating a response
335335
/// from the solver we assume that the solver correctly handled aliases and therefore
336336
/// always relate them structurally here.
337-
#[instrument(level = "debug", skip(infcx))]
337+
#[instrument(level = "trace", skip(infcx))]
338338
fn unify_query_var_values(
339339
infcx: &InferCtxt<'tcx>,
340340
param_env: ty::ParamEnv<'tcx>,
@@ -407,7 +407,7 @@ pub(in crate::solve) fn make_canonical_state<'tcx, T: TypeFoldable<TyCtxt<'tcx>>
407407
/// This currently assumes that unifying the var values trivially succeeds.
408408
/// Adding any inference constraints which weren't present when originally
409409
/// computing the canonical query can result in bugs.
410-
#[instrument(level = "debug", skip(infcx, span, param_env))]
410+
#[instrument(level = "trace", skip(infcx, span, param_env))]
411411
pub(in crate::solve) fn instantiate_canonical_state<'tcx, T: TypeFoldable<TyCtxt<'tcx>>>(
412412
infcx: &InferCtxt<'tcx>,
413413
span: Span,

Diff for: compiler/rustc_trait_selection/src/solve/eval_ctxt/mod.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl<'tcx> InferCtxt<'tcx> {
137137
///
138138
/// Using this while inside of the solver is wrong as it uses a new
139139
/// search graph which would break cycle detection.
140-
#[instrument(level = "debug", skip(self))]
140+
#[instrument(level = "trace", skip(self))]
141141
fn evaluate_root_goal(
142142
&self,
143143
goal: Goal<'tcx, ty::Predicate<'tcx>>,
@@ -276,7 +276,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
276276
/// Instead of calling this function directly, use either [EvalCtxt::evaluate_goal]
277277
/// if you're inside of the solver or [InferCtxtEvalExt::evaluate_root_goal] if you're
278278
/// outside of it.
279-
#[instrument(level = "debug", skip(tcx, search_graph, goal_evaluation), ret)]
279+
#[instrument(level = "trace", skip(tcx, search_graph, goal_evaluation), ret)]
280280
fn evaluate_canonical_goal(
281281
tcx: TyCtxt<'tcx>,
282282
search_graph: &'a mut search_graph::SearchGraph<'tcx>,
@@ -458,21 +458,21 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
458458
}
459459
}
460460

461-
#[instrument(level = "debug", skip(self))]
461+
#[instrument(level = "trace", skip(self))]
462462
pub(super) fn add_normalizes_to_goal(&mut self, goal: Goal<'tcx, ty::NormalizesTo<'tcx>>) {
463463
self.inspect.add_normalizes_to_goal(self.infcx, self.max_input_universe, goal);
464464
self.nested_goals.normalizes_to_goals.push(goal);
465465
}
466466

467-
#[instrument(level = "debug", skip(self))]
467+
#[instrument(level = "trace", skip(self))]
468468
pub(super) fn add_goal(&mut self, source: GoalSource, goal: Goal<'tcx, ty::Predicate<'tcx>>) {
469469
self.inspect.add_goal(self.infcx, self.max_input_universe, source, goal);
470470
self.nested_goals.goals.push((source, goal));
471471
}
472472

473473
// Recursively evaluates all the goals added to this `EvalCtxt` to completion, returning
474474
// the certainty of all the goals.
475-
#[instrument(level = "debug", skip(self))]
475+
#[instrument(level = "trace", skip(self))]
476476
pub(super) fn try_evaluate_added_goals(&mut self) -> Result<Certainty, NoSolution> {
477477
self.inspect.start_evaluate_added_goals();
478478
let mut response = Ok(Certainty::overflow(false));
@@ -526,7 +526,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
526526
unconstrained_goal,
527527
)?;
528528
// Add the nested goals from normalization to our own nested goals.
529-
debug!(?nested_goals);
529+
trace!(?nested_goals);
530530
goals.goals.extend(nested_goals);
531531

532532
// Finally, equate the goal's RHS with the unconstrained var.
@@ -622,7 +622,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
622622
///
623623
/// This is the case if the `term` does not occur in any other part of the predicate
624624
/// and is able to name all other placeholder and inference variables.
625-
#[instrument(level = "debug", skip(self), ret)]
625+
#[instrument(level = "trace", skip(self), ret)]
626626
pub(super) fn term_is_fully_unconstrained(
627627
&self,
628628
goal: Goal<'tcx, ty::NormalizesTo<'tcx>>,
@@ -718,7 +718,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
718718
&& goal.param_env.visit_with(&mut visitor).is_continue()
719719
}
720720

721-
#[instrument(level = "debug", skip(self, param_env), ret)]
721+
#[instrument(level = "trace", skip(self, param_env), ret)]
722722
pub(super) fn eq<T: ToTrace<'tcx>>(
723723
&mut self,
724724
param_env: ty::ParamEnv<'tcx>,
@@ -733,7 +733,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
733733
self.add_goals(GoalSource::Misc, obligations.into_iter().map(|o| o.into()));
734734
})
735735
.map_err(|e| {
736-
debug!(?e, "failed to equate");
736+
trace!(?e, "failed to equate");
737737
NoSolution
738738
})
739739
}
@@ -743,7 +743,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
743743
/// Normally we emit a nested `AliasRelate` when equating an inference
744744
/// variable and an alias. This causes us to instead constrain the inference
745745
/// variable to the alias without emitting a nested alias relate goals.
746-
#[instrument(level = "debug", skip(self, param_env), ret)]
746+
#[instrument(level = "trace", skip(self, param_env), ret)]
747747
pub(super) fn relate_rigid_alias_non_alias(
748748
&mut self,
749749
param_env: ty::ParamEnv<'tcx>,
@@ -781,7 +781,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
781781
/// This sohuld only be used when we're either instantiating a previously
782782
/// unconstrained "return value" or when we're sure that all aliases in
783783
/// the types are rigid.
784-
#[instrument(level = "debug", skip(self, param_env), ret)]
784+
#[instrument(level = "trace", skip(self, param_env), ret)]
785785
pub(super) fn eq_structurally_relating_aliases<T: ToTrace<'tcx>>(
786786
&mut self,
787787
param_env: ty::ParamEnv<'tcx>,
@@ -798,7 +798,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
798798
Ok(())
799799
}
800800

801-
#[instrument(level = "debug", skip(self, param_env), ret)]
801+
#[instrument(level = "trace", skip(self, param_env), ret)]
802802
pub(super) fn sub<T: ToTrace<'tcx>>(
803803
&mut self,
804804
param_env: ty::ParamEnv<'tcx>,
@@ -813,12 +813,12 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
813813
self.add_goals(GoalSource::Misc, obligations.into_iter().map(|o| o.into()));
814814
})
815815
.map_err(|e| {
816-
debug!(?e, "failed to subtype");
816+
trace!(?e, "failed to subtype");
817817
NoSolution
818818
})
819819
}
820820

821-
#[instrument(level = "debug", skip(self, param_env), ret)]
821+
#[instrument(level = "trace", skip(self, param_env), ret)]
822822
pub(super) fn relate<T: ToTrace<'tcx>>(
823823
&mut self,
824824
param_env: ty::ParamEnv<'tcx>,
@@ -834,7 +834,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
834834
self.add_goals(GoalSource::Misc, obligations.into_iter().map(|o| o.into()));
835835
})
836836
.map_err(|e| {
837-
debug!(?e, "failed to relate");
837+
trace!(?e, "failed to relate");
838838
NoSolution
839839
})
840840
}
@@ -859,7 +859,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
859859
obligations.into_iter().map(|o| o.into()).collect()
860860
})
861861
.map_err(|e| {
862-
debug!(?e, "failed to equate");
862+
trace!(?e, "failed to equate");
863863
NoSolution
864864
})
865865
}

Diff for: compiler/rustc_trait_selection/src/solve/fulfill.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl<'tcx> FulfillmentCtxt<'tcx> {
119119
}
120120

121121
impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
122-
#[instrument(level = "debug", skip(self, infcx))]
122+
#[instrument(level = "trace", skip(self, infcx))]
123123
fn register_predicate_obligation(
124124
&mut self,
125125
infcx: &InferCtxt<'tcx>,

0 commit comments

Comments
 (0)