Skip to content

Commit

Permalink
only use discard_impls_shadowed_by_env outside of coherence
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Feb 9, 2024
1 parent 50ea079 commit 4e023f0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions compiler/rustc_trait_selection/src/solve/assembly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,12 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {

self.assemble_param_env_candidates(goal, &mut candidates);

self.assemble_coherence_unknowable_candidates(goal, &mut candidates);

self.discard_impls_shadowed_by_env(goal, &mut candidates);
match self.solver_mode() {
SolverMode::Normal => self.discard_impls_shadowed_by_env(goal, &mut candidates),
SolverMode::Coherence => {
self.assemble_coherence_unknowable_candidates(goal, &mut candidates)
}
}

candidates
}
Expand Down Expand Up @@ -795,11 +798,6 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
candidates: &mut Vec<Candidate<'tcx>>,
) {
let tcx = self.tcx();
match self.solver_mode() {
SolverMode::Normal => return,
SolverMode::Coherence => {}
};

let result = self.probe_misc_candidate("coherence unknowable").enter(|ecx| {
let trait_ref = goal.predicate.trait_ref(tcx);
#[derive(Debug)]
Expand Down

0 comments on commit 4e023f0

Please sign in to comment.