about summary refs log tree commit diff
path: root/src/test/ui/regions
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-09-14 15:45:02 +0000
committerbors <bors@rust-lang.org>2018-09-14 15:45:02 +0000
commit052d24e6c827577dadac28fb2b782dbe5445eab7 (patch)
treeb57ab46dc6b56328f2cd77a7b05b98b2eff5a479 /src/test/ui/regions
parent85da24527adc45adc6b503d92fca2a29331ddab5 (diff)
parent54f73115878a46d8591bfd6689e0a9fc60d89d43 (diff)
downloadrust-052d24e6c827577dadac28fb2b782dbe5445eab7.tar.gz
rust-052d24e6c827577dadac28fb2b782dbe5445eab7.zip
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.
Diffstat (limited to 'src/test/ui/regions')
-rw-r--r--src/test/ui/regions/regions-var-type-out-of-scope.nll.stderr1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/ui/regions/regions-var-type-out-of-scope.nll.stderr b/src/test/ui/regions/regions-var-type-out-of-scope.nll.stderr
index 54b1a6fa970..aa744a3ae8a 100644
--- a/src/test/ui/regions/regions-var-type-out-of-scope.nll.stderr
+++ b/src/test/ui/regions/regions-var-type-out-of-scope.nll.stderr
@@ -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