Skip to content

Commit

Permalink
Auto merge of rust-lang#48576 - ishitatsuyuki:dup-fix, r=nikomatsakis
Browse files Browse the repository at this point in the history
Bring back ParamEnv deduplication

Fix rust-lang#48551
  • Loading branch information
bors committed Feb 27, 2018
2 parents 29f5c69 + f297f56 commit affe297
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/librustc/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ impl<'tcx> ProjectionTyCandidateSet<'tcx> {
true
}
Single(current) => {
// No duplicates are expected.
assert_ne!(current, &candidate);
// Duplicates can happen inside ParamEnv. In the case, we
// perform a lazy deduplication.
if current == &candidate {
return false;
}
// Prefer where-clauses. As in select, if there are multiple
// candidates, we prefer where-clause candidates over impls. This
// may seem a bit surprising, since impls are the source of
Expand Down

0 comments on commit affe297

Please sign in to comment.