-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Improve reporting errors and suggestions for trait bounds #67665
Conversation
r? @zackmdavis (rust_highfive has picked a reviewer for you, use r? to override) |
Hi, I'd like to provide a bit of insight about the second part of my MR - it refers to the fn foo2<T>(_: T) where T: ?Sized {
//
}
First of all, the hint points at an unrelated piece of code - it's been done this way, because (presumably) it was easier than creating two distinct messages: one for humans (pointing at the trait bounds) and the other one for rustfix (pointing at the end of Second of all, the Third of all: current version is inconsistent when it comes to fn foo(x: impl ?Sized) {
//
}
fn foo2<X: ?Sized>(x: X) {
//
}
Notice how the first error message underlines the entire type ( Of course it's all just a suggestion and I'd like to hear what you think :-) Thanks for reviewing, Edit: also, I'd like to thank @VirrageS for pointing me in the right direction - his diff was higly helpful. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☔ The latest upstream changes (presumably #66942) made this pull request unmergeable. Please resolve the merge conflicts. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☔ The latest upstream changes (presumably #67764) made this pull request unmergeable. Please resolve the merge conflicts. |
According to @Centril's suggestion, I've split Taking the opportunity I've also modified the |
☔ The latest upstream changes (presumably #67917) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #67886) made this pull request unmergeable. Please resolve the merge conflicts. |
Hiya - since this branch is aging quite rapidly, maintaining it has become rather cumbersome; could someone please review it? :-) I'm not sure who to call, so @zackmdavis @Centril Thanks, |
@Patryk27 Thanks for your patience. Let me take a look tonight (I'm super behind on notifications and may need to resign from the reviewer queue 😰 😿 ) |
☔ The latest upstream changes (presumably #68078) made this pull request unmergeable. Please resolve the merge conflicts. |
(ugh, or tomorrow night, need to sleep now 😰 ) |
okay, I at least managed to pull-request my resignation from the reviewer queue, and now I have to go to my dayjob, and then tonight I'll actually review this, and if I break my word this time then, like, hit me with a stick |
Don't worry, take your time; there are more important things that my PR - like a proper sleep! :-) |
@@ -5,7 +5,7 @@ LL | for (i, n) in &v.iter().enumerate() { | |||
| -^^^^^^^^^^^^^^^^^^^^ | |||
| | | |||
| `&std::iter::Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterator | |||
| help: consider removing 1 leading `&`-references | |||
| help: consider removing the leading `&`-reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
@bors delegate+ |
✌️ @Patryk27 can now approve this pull request |
Hi - thanks for reviewing! :-) While I've been rebasing this branch, I noticed that apparently three days ago someone already split this huge |
☔ The latest upstream changes (presumably #68522) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r+ |
📌 Commit d2470eba0b74f91319e3ba4525ef25fc496f30c4 has been approved by |
⌛ Testing commit d2470eba0b74f91319e3ba4525ef25fc496f30c4 with merge 8b02e6cd91c65fdecb37173306b96261a38eebc3... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - checks-azure |
☔ The latest upstream changes (presumably #68377) made this pull request unmergeable. Please resolve the merge conflicts. |
Hi, I'm just reminding about this patch :-P |
@bors r+ |
📌 Commit a8d34c1 has been approved by |
Improve reporting errors and suggestions for trait bounds Fix #66802 - When printing errors for unsized function parameter, properly point at the parameter instead of function's body. - Improve `consider further restricting this bound` (and related) messages by separating human-oriented hints from the machine-oriented ones.
☀️ Test successful - checks-azure |
Fix #66802
consider further restricting this bound
(and related) messages by separating human-oriented hints from the machine-oriented ones.