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 'elided' from lifetime resolution error #42415

Merged
merged 1 commit into from
Jun 7, 2017

Conversation

stephen-lazaro
Copy link
Contributor

Removes 'elided' from lifetime resolution errors
Removes 'elided' from relevant error messaging tests

This PR resolves #29094

r? @Mark-Simulacrum

Removes 'elided' from lifetime resolution errors
Removes 'elided' from relevant error messaging tests
@rust-highfive
Copy link
Collaborator

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.

@frewsxcv frewsxcv closed this Jun 3, 2017
@frewsxcv frewsxcv reopened this Jun 3, 2017
@@ -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
Copy link
Member

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'

Copy link
Member

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.

@Mark-Simulacrum
Copy link
Member

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?

@Mark-Simulacrum Mark-Simulacrum added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 4, 2017
@arielb1
Copy link
Contributor

arielb1 commented Jun 4, 2017

@bors r+ rollup

@nikomatsakis is trying to change how elision works, but this should work for now.

@bors
Copy link
Contributor

bors commented Jun 4, 2017

📌 Commit 7ed771f has been approved by arielb1

@estebank
Copy link
Contributor

estebank commented Jun 4, 2017

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?

@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 'a as one of the possible lifetimes.

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jun 5, 2017
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
bors added a commit that referenced this pull request Jun 5, 2017
Rollup of 4 pull requests

- Successful merges: #42304, #42415, #42429, #42438
- Failed merges:
@arielb1 arielb1 added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 6, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Jun 7, 2017
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
bors added a commit that referenced this pull request Jun 7, 2017
Rollup of 7 pull requests

- Successful merges: #42409, #42415, #42429, #42438, #42466, #42469, #42485
- Failed merges:
@bors bors merged commit 7ed771f into rust-lang:master Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ambiguous elided lifetime error claims non-elided lifetime is elided
7 participants