-
Notifications
You must be signed in to change notification settings - Fork 14k
dangling pointer from temp cleanup #148490
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
base: main
Are you sure you want to change the base?
Conversation
|
BTW help vs note: help should be used to show changes the user can possibly make to fix the problem. note should be used for everything else, such as other context, information and facts, online resources to read, etc. -- https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-levels Should probably change a lot of these helps to notes... |
0ef89d7 to
09188da
Compare
|
@rustbot ready |
09188da to
9fb5a03
Compare
| .note_safe = a dangling pointer is safe, but dereferencing one is undefined behavior | ||
| .note_more_info = for more information, see <https://doc.rust-lang.org/reference/destructors.html> | ||
| lint_dangling_pointers_from_temporaries = dangling pointer because temporary `{$ty}` is dropped at end of statement |
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.
I'm not a native English speaker but I think it's missing a word that links "dangling pointer" and "because temporary [...]", maybe "created" or "made"?
dangling pointer created because
{$ty}temporary is dropped at end of statement
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.
I suppose there is an implied "there is a" at the beginning, but I suppose instead of "dangling pointer", "pointer is dangling" is not that much longer. Would that make it better?
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.
Sure, that works to.
Continuation of #148348
r? @Urgau