We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 29f5c69 + f297f56 commit affe297Copy full SHA for affe297
src/librustc/traits/project.rs
@@ -142,8 +142,11 @@ impl<'tcx> ProjectionTyCandidateSet<'tcx> {
142
true
143
}
144
Single(current) => {
145
- // No duplicates are expected.
146
- assert_ne!(current, &candidate);
+ // Duplicates can happen inside ParamEnv. In the case, we
+ // perform a lazy deduplication.
147
+ if current == &candidate {
148
+ return false;
149
+ }
150
// Prefer where-clauses. As in select, if there are multiple
151
// candidates, we prefer where-clause candidates over impls. This
152
// may seem a bit surprising, since impls are the source of
0 commit comments