Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove needless dedup from projection #48315

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove needless dedup from projection
  • Loading branch information
ishitatsuyuki committed Feb 18, 2018
commit 253ebd17e0b999cf82e336daa18214ef3133c39a
10 changes: 0 additions & 10 deletions src/librustc/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,16 +835,6 @@ fn project_type<'cx, 'gcx, 'tcx>(
return Err(ProjectionTyError::TooManyCandidates);
}

// Drop duplicates.
//
// Note: `candidates.vec` seems to be on the critical path of the
// compiler. Replacing it with an HashSet was also tried, which would
// render the following dedup unnecessary. The original comment indicated
// that it was 9% slower, but that data is now obsolete and a new
// benchmark should be performed.
candidates.vec.sort_unstable();
candidates.vec.dedup();

// 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