]> git.lizzy.rs Git - rust.git/commit
bail out of selection when there are multiple surviving candidates
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>
Sat, 22 Apr 2017 12:05:18 +0000 (15:05 +0300)
committerAriel Ben-Yehuda <ariel.byd@gmail.com>
Sat, 22 Apr 2017 18:02:50 +0000 (21:02 +0300)
commita660ad84b3c27de5c0abfb683fb178ba4e4ca87e
tree93665674d9ec3bbe6fa88502a81c6c32a0a592f0
parenta0f145ba8c96feb25ae059e0917c55ef6dae01e8
bail out of selection when there are multiple surviving candidates

In some cases (e.g. <[int-var] as Add<[int-var]>>), selection can turn up
a large number of candidates. Bailing out early avoids O(n^2) performance.

This improves item-type checking time by quite a bit, resulting in ~2% of total
time-to-typeck.
src/librustc/traits/select.rs