Uh oh!
There was an error while loading. Please reload this page.
Show five traits implementation in help when there are exactly five - #39804
Conversation
rust-highfive
commented
Feb 14, 2017
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @eddyb (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
a9d451b to
882f4a8Compareeddyb
commented
Feb 14, 2017
There was a problem hiding this comment.
Are those two backticks at the end of the line intentional?
All other tests within ui/did_you_mean/ use a separate .stderr file. I think it's not possible to use this inline error notation here.
There was a problem hiding this comment.
You are right, I copied it from src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs which has both but I did not noticed the stderr file.
There was a problem hiding this comment.
Maybe you could add two more test cases (within this same file): one if there are just four implementations found and one if there are six (so that it says 'and 2 others').
There was a problem hiding this comment.
This looks like a complex way to compute cmp::min(5, impl_candidates.len())
EDIT: yet it is not, if impl_candidates.len() is greater than 5, this computation returns 4
There was a problem hiding this comment.
How about
let end = if impl_candidates.len() <= 5{
impl_candidates.len()}else{4};? At least for me, it would make it easier to immediately grasp the behaviour.
There was a problem hiding this comment.
Good idea. I've added it and squashed the commits.
d3b96e3 to
d400ea0Compared400ea0 to
ca54fc7Comparesophiajt
commented
Feb 14, 2017
Looks good. Thanks for the PR! @bors r+ |
bors
commented
Feb 14, 2017
📌 Commit ca54fc7 has been approved by |
…jonathandturner Show five traits implementation in help when there are exactly five Fixesrust-lang#39802
…jonathandturner Show five traits implementation in help when there are exactly five Fixesrust-lang#39802
…jonathandturner Show five traits implementation in help when there are exactly five Fixesrust-lang#39802
…jonathandturner Show five traits implementation in help when there are exactly five Fixesrust-lang#39802
Fixes#39802