-
Notifications
You must be signed in to change notification settings - Fork 13k
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 'elided' from lifetime resolution error #42415
Conversation
Removes 'elided' from lifetime resolution errors Removes 'elided' from relevant error messaging tests
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (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. |
@@ -17,19 +17,19 @@ struct S<'a> { | |||
|
|||
fn f(a: &S, b: i32) -> &i32 { | |||
//~^ ERROR missing lifetime specifier [E0106] | |||
//~^^ HELP does not say which one of `a`'s 2 elided lifetimes it is borrowed from | |||
//~^^ HELP does not say which one of `a`'s 2 lifetimes it is borrowed from |
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.
in my opinion, in this instance, the help message is clearer here with the word 'elided'
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.
Yeah, I'm not sure if we can detect this case though.
cc @estebank, you've worked with diagnostics quite a bit -- do you think removing elided is the best approach here or should we try to put more code in to deal with more cases? |
@bors r+ rollup @nikomatsakis is trying to change how elision works, but this should work for now. |
📌 Commit 7ed771f has been approved by |
@Mark-Simulacrum, I believe we don't track elided lifetimes, which would make for a much bigger PR in order to track that (I might be wrong about this though). I'm ok with this change (and it's been already +1'd) as long as we keep a ticket around to expand on this in the future. For example, in the cases presented in the original ticket, it should mention |
Remove 'elided' from lifetime resolution error Removes 'elided' from lifetime resolution errors Removes 'elided' from relevant error messaging tests This PR resolves rust-lang#29094 r? @Mark-Simulacrum
Remove 'elided' from lifetime resolution error Removes 'elided' from lifetime resolution errors Removes 'elided' from relevant error messaging tests This PR resolves rust-lang#29094 r? @Mark-Simulacrum
Removes 'elided' from lifetime resolution errors
Removes 'elided' from relevant error messaging tests
This PR resolves #29094
r? @Mark-Simulacrum