Skip to content

Commit eeeb9b4

Browse files
committed
add additional logging
1 parent dc00e8c commit eeeb9b4

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15161516
/// In case there is still ambiguity, the returned type may be an inference
15171517
/// variable. This is different from `structurally_resolve_type` which errors
15181518
/// in this case.
1519+
#[instrument(level = "debug", skip(self, sp), ret)]
15191520
pub fn try_structurally_resolve_type(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx> {
15201521
let ty = self.resolve_vars_with_obligations(ty);
15211522

compiler/rustc_trait_selection/src/solve/assembly/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
777777
// FIXME(@lcnr): The current structure here makes me unhappy and feels ugly. idk how
778778
// to improve this however. However, this should make it fairly straightforward to refine
779779
// the filtering going forward, so it seems alright-ish for now.
780+
#[instrument(level = "debug", skip(self, goal))]
780781
fn discard_impls_shadowed_by_env<G: GoalKind<'tcx>>(
781782
&mut self,
782783
goal: Goal<'tcx, G>,
@@ -799,14 +800,18 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
799800
// This feels dangerous.
800801
Certainty::Yes => {
801802
candidates.retain(|c| match c.source {
802-
CandidateSource::Impl(_) | CandidateSource::BuiltinImpl(_) => false,
803+
CandidateSource::Impl(_) | CandidateSource::BuiltinImpl(_) => {
804+
debug!(?c, "discard impl candidate");
805+
false
806+
}
803807
CandidateSource::ParamEnv(_) | CandidateSource::AliasBound => true,
804808
});
805809
}
806810
// If it is still ambiguous we instead just force the whole goal
807811
// to be ambig and wait for inference constraints. See
808812
// tests/ui/traits/next-solver/env-shadows-impls/ambig-env-no-shadow.rs
809813
Certainty::Maybe(cause) => {
814+
debug!(?cause, "force ambiguity");
810815
*candidates = self.forced_ambiguity(cause);
811816
}
812817
}

compiler/rustc_trait_selection/src/solve/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
267267
/// This function is necessary in nearly all cases before matching on a type.
268268
/// Not doing so is likely to be incomplete and therefore unsound during
269269
/// coherence.
270+
#[instrument(level = "debug", skip(self, param_env), ret)]
270271
fn structurally_normalize_ty(
271272
&mut self,
272273
param_env: ty::ParamEnv<'tcx>,

0 commit comments

Comments
 (0)