Skip to content

blame the furthest statement in borrowck errors #113917

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

Closed
wants to merge 1 commit into from

Conversation

aliemjay
Copy link
Member

This should generate a more correct span for lifetime errors.
Fixes #113041

r? @estebank

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 21, 2023
Comment on lines 40 to +41
LL | Self { field }
| ^^^^^ this usage requires that `'a` must outlive `'1`
| ^^^^^^^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes seem to be perfectly reasonable, except the ones where we are now pointing to an entire struct expression instead of the field. This reduces the amount of actionable information a little bit, making people have to go to the struct's definition. This might be a worthwhile "regression", but would you be interested in exploring if we could improve these cases as part of this PR?

@apiraino
Copy link
Contributor

Switching to waiting on author to incorporate changes. Feel free to request a review with @rustbot ready, thanks!

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 24, 2023
@tgross35
Copy link
Contributor

tgross35 commented Sep 9, 2023

Does this help with the example I had in #112519?

@bors
Copy link
Collaborator

bors commented Nov 21, 2023

☔ The latest upstream changes (presumably #118107) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC
Copy link
Member

@aliemjay any updates on this?

@Dylan-DPC
Copy link
Member

Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks

@Dylan-DPC Dylan-DPC closed this Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unhelpful diagnostic regarding inferred 'static bound
7 participants