Auto merge of #54088 - matthewjasper:use-reason-in-dlle-errors, r=pnkfelix
[NLL] Suggest let binding Closes #49821 Also adds an alternative to `explain_why_borrow_contains_point` that allows changing error messages based on the reason that will be given. This will also be useful for #51026, #51169 and maybe further changes to does not live long enough messages.
This commit is contained in:
commit
052d24e6c8
15 changed files with 133 additions and 32 deletions
|
|
@ -8,6 +8,7 @@ LL | x = &id(3); //~ ERROR borrowed value does not live long enough
|
|||
LL | assert_eq!(*x, 3);
|
||||
| ------------------ borrow later used here
|
||||
|
|
||||
= note: consider using a `let` binding to create a longer lived value
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue