Skip to content

Commit affe297

Browse files
committed
Auto merge of #48576 - ishitatsuyuki:dup-fix, r=nikomatsakis
Bring back ParamEnv deduplication Fix #48551
2 parents 29f5c69 + f297f56 commit affe297

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/librustc/traits/project.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,11 @@ impl<'tcx> ProjectionTyCandidateSet<'tcx> {
142142
true
143143
}
144144
Single(current) => {
145-
// No duplicates are expected.
146-
assert_ne!(current, &candidate);
145+
// Duplicates can happen inside ParamEnv. In the case, we
146+
// perform a lazy deduplication.
147+
if current == &candidate {
148+
return false;
149+
}
147150
// Prefer where-clauses. As in select, if there are multiple
148151
// candidates, we prefer where-clause candidates over impls. This
149152
// may seem a bit surprising, since impls are the source of

0 commit comments

Comments
 (0)