Skip to content

Commit f297f56

Browse files
committedFeb 27, 2018
Bring back ParamEnv deduplication
1 parent 29f5c69 commit f297f56

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)
Please sign in to comment.