-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Update lifetime errors to specifically note temporaries #36171
Conversation
} | ||
//~^ borrowed value must be valid until here | ||
//~^ NOTE temporary value needs to live until here |
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.
Nit: can we make this a UI test?
@jonathandturner r=me if we move the "suggestions" to a |
@bors r=nikomatsakis |
📌 Commit 5112b40 has been approved by |
//~| NOTE does not live long enough | ||
//~| NOTE borrowed value only valid until here | ||
//~| HELP consider using a `let` binding to increase its lifetime | ||
//~| NOTE temporary value created here |
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.
Trailing whitespace. make tidy
won't be happy.
5112b40
to
439afcd
Compare
@bors r=nikomatsakis |
📌 Commit 439afcd has been approved by |
@frewsxcv - thanks for the catch with tidy :) |
@bors rollup |
…nikomatsakis Update lifetime errors to specifically note temporaries This PR updates the error message we give in the case of a temporary value not living long enough. Before: <img width="497" alt="screen shot 2016-08-31 at 10 02 47 am" src="https://cloud.githubusercontent.com/assets/547158/18138551/27a06794-6f62-11e6-9ee2-bdf8bed75ca7.png"> Now: <img width="488" alt="screen shot 2016-08-31 at 10 03 01 am" src="https://cloud.githubusercontent.com/assets/547158/18138557/2e5cf322-6f62-11e6-9047-4a78abf3d78c.png"> Specifically, it makes the following changes: * Detects if a temporary is being used. If so, it changes the labels to mention that a temporary value specifically is in question * Simplifies wording of the existing labels to focus on lifetimes rather than values being valid * Changes the help to a note, since the help+span wasn't as helpful (and sometimes more confusing) than just a note. r? @nikomatsakis
…nikomatsakis Update lifetime errors to specifically note temporaries This PR updates the error message we give in the case of a temporary value not living long enough. Before: <img width="497" alt="screen shot 2016-08-31 at 10 02 47 am" src="https://cloud.githubusercontent.com/assets/547158/18138551/27a06794-6f62-11e6-9ee2-bdf8bed75ca7.png"> Now: <img width="488" alt="screen shot 2016-08-31 at 10 03 01 am" src="https://cloud.githubusercontent.com/assets/547158/18138557/2e5cf322-6f62-11e6-9047-4a78abf3d78c.png"> Specifically, it makes the following changes: * Detects if a temporary is being used. If so, it changes the labels to mention that a temporary value specifically is in question * Simplifies wording of the existing labels to focus on lifetimes rather than values being valid * Changes the help to a note, since the help+span wasn't as helpful (and sometimes more confusing) than just a note. r? @nikomatsakis
…nikomatsakis Update lifetime errors to specifically note temporaries This PR updates the error message we give in the case of a temporary value not living long enough. Before: <img width="497" alt="screen shot 2016-08-31 at 10 02 47 am" src="https://cloud.githubusercontent.com/assets/547158/18138551/27a06794-6f62-11e6-9ee2-bdf8bed75ca7.png"> Now: <img width="488" alt="screen shot 2016-08-31 at 10 03 01 am" src="https://cloud.githubusercontent.com/assets/547158/18138557/2e5cf322-6f62-11e6-9047-4a78abf3d78c.png"> Specifically, it makes the following changes: * Detects if a temporary is being used. If so, it changes the labels to mention that a temporary value specifically is in question * Simplifies wording of the existing labels to focus on lifetimes rather than values being valid * Changes the help to a note, since the help+span wasn't as helpful (and sometimes more confusing) than just a note. r? @nikomatsakis
Yay :) |
This PR updates the error message we give in the case of a temporary value not living long enough.
Before:
Now:
Specifically, it makes the following changes:
r? @nikomatsakis