Skip to content

Commit 4e023f0

Browse files
committed
only use discard_impls_shadowed_by_env outside of coherence
1 parent 50ea079 commit 4e023f0

File tree

1 file changed

+6
-8
lines changed
  • compiler/rustc_trait_selection/src/solve/assembly

1 file changed

+6
-8
lines changed

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

+6-8
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,12 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
306306

307307
self.assemble_param_env_candidates(goal, &mut candidates);
308308

309-
self.assemble_coherence_unknowable_candidates(goal, &mut candidates);
310-
311-
self.discard_impls_shadowed_by_env(goal, &mut candidates);
309+
match self.solver_mode() {
310+
SolverMode::Normal => self.discard_impls_shadowed_by_env(goal, &mut candidates),
311+
SolverMode::Coherence => {
312+
self.assemble_coherence_unknowable_candidates(goal, &mut candidates)
313+
}
314+
}
312315

313316
candidates
314317
}
@@ -795,11 +798,6 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
795798
candidates: &mut Vec<Candidate<'tcx>>,
796799
) {
797800
let tcx = self.tcx();
798-
match self.solver_mode() {
799-
SolverMode::Normal => return,
800-
SolverMode::Coherence => {}
801-
};
802-
803801
let result = self.probe_misc_candidate("coherence unknowable").enter(|ecx| {
804802
let trait_ref = goal.predicate.trait_ref(tcx);
805803
#[derive(Debug)]

0 commit comments

Comments
 (0)