about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2018-09-14 23:13:24 +0200
committerDavid Wood <david@davidtw.co>2018-09-23 14:18:34 +0200
commit876774bf71765cd7a1f2a8dfd775392bb162aae8 (patch)
tree81c8a9fdd3f6e34559468f2b29d26182df152c27 /src/test
parent9eb8d1179c220e44b3eec9edb69e1fbd04988538 (diff)
downloadrust-876774bf71765cd7a1f2a8dfd775392bb162aae8.tar.gz
rust-876774bf71765cd7a1f2a8dfd775392bb162aae8.zip
Improve 'dropped here' note.
Start mentioning function name that the variable is valid within in
notes to provide context.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/issues/issue-30438-c.nll.stderr2
-rw-r--r--src/test/ui/nll/borrowed-universal-error-2.stderr2
-rw-r--r--src/test/ui/nll/issue-52534-1.stderr6
-rw-r--r--src/test/ui/nll/issue-52534.stderr2
-rw-r--r--src/test/ui/regions/regions-nested-fns-2.nll.stderr2
-rw-r--r--src/test/ui/regions/regions-nested-fns.nll.stderr2
6 files changed, 8 insertions, 8 deletions
diff --git a/src/test/ui/issues/issue-30438-c.nll.stderr b/src/test/ui/issues/issue-30438-c.nll.stderr
index 6d8a750d3d0..11dbe5fcaca 100644
--- a/src/test/ui/issues/issue-30438-c.nll.stderr
+++ b/src/test/ui/issues/issue-30438-c.nll.stderr
@@ -10,7 +10,7 @@ LL |     &x
    |     ^^ `x` would have to be valid for `'y`
 LL |     //~^ ERROR: `x` does not live long enough
 LL | }
-   | - but `x` dropped here while still borrowed
+   | - ...but `x` is only valid for the duration of the `silly` function, so it is dropped here while still borrowed
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/nll/borrowed-universal-error-2.stderr b/src/test/ui/nll/borrowed-universal-error-2.stderr
index b414c399884..c8b473d2b2c 100644
--- a/src/test/ui/nll/borrowed-universal-error-2.stderr
+++ b/src/test/ui/nll/borrowed-universal-error-2.stderr
@@ -10,7 +10,7 @@ LL |     &v
    |     ^^ `v` would have to be valid for `'a`
 LL |     //~^ ERROR `v` does not live long enough [E0597]
 LL | }
-   | - but `v` dropped here while still borrowed
+   | - ...but `v` is only valid for the duration of the `foo` function, so it is dropped here while still borrowed
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/nll/issue-52534-1.stderr b/src/test/ui/nll/issue-52534-1.stderr
index 7b89336dabf..233ed471630 100644
--- a/src/test/ui/nll/issue-52534-1.stderr
+++ b/src/test/ui/nll/issue-52534-1.stderr
@@ -9,7 +9,7 @@ LL |         let x = 22;
 LL |         &x
    |         ^^ `x` would have to be valid for `'0`
 LL |     }
-   |     - but `x` dropped here while still borrowed
+   |     - ...but `x` is only valid for the duration of the `bar` function, so it is dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
   --> $DIR/issue-52534-1.rs:25:5
@@ -22,7 +22,7 @@ LL |     let x = 22;
 LL |     &x
    |     ^^ `x` would have to be valid for `'0`
 LL | }
-   | - but `x` dropped here while still borrowed
+   | - ...but `x` is only valid for the duration of the `foo` function, so it is dropped here while still borrowed
 
 error[E0597]: `x` does not live long enough
   --> $DIR/issue-52534-1.rs:30:6
@@ -35,7 +35,7 @@ LL |     let x = 22;
 LL |     &&x
    |      ^^ `x` would have to be valid for `'0`
 LL | }
-   | - but `x` dropped here while still borrowed
+   | - ...but `x` is only valid for the duration of the `baz` function, so it is dropped here while still borrowed
 
 error[E0597]: borrowed value does not live long enough
   --> $DIR/issue-52534-1.rs:30:6
diff --git a/src/test/ui/nll/issue-52534.stderr b/src/test/ui/nll/issue-52534.stderr
index c92a4230e1e..032aa218d4a 100644
--- a/src/test/ui/nll/issue-52534.stderr
+++ b/src/test/ui/nll/issue-52534.stderr
@@ -6,7 +6,7 @@ LL |     foo(|a| &x)
    |           |
    |           has type `&'0 u32`
 LL | }
-   | - but `x` dropped here while still borrowed
+   | - ...but `x` is only valid for the duration of the `bar` function, so it is dropped here while still borrowed
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/regions/regions-nested-fns-2.nll.stderr b/src/test/ui/regions/regions-nested-fns-2.nll.stderr
index 3f64806cc0f..90e0f1b7e07 100644
--- a/src/test/ui/regions/regions-nested-fns-2.nll.stderr
+++ b/src/test/ui/regions/regions-nested-fns-2.nll.stderr
@@ -8,7 +8,7 @@ LL |             if false { &y } else { z }
    |                         ^ `y` would have to be valid for `'0`
 LL |         });
 LL | }
-   | - but `y` dropped here while still borrowed
+   | - ...but `y` is only valid for the duration of the `nested` function, so it is dropped here while still borrowed
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/regions/regions-nested-fns.nll.stderr b/src/test/ui/regions/regions-nested-fns.nll.stderr
index eab06e8b90f..e8309beb0ae 100644
--- a/src/test/ui/regions/regions-nested-fns.nll.stderr
+++ b/src/test/ui/regions/regions-nested-fns.nll.stderr
@@ -31,7 +31,7 @@ LL |         ay = &y;
    |               ^ `y` would have to be valid for `'0`
 ...
 LL | }
-   | - but `y` dropped here while still borrowed
+   | - ...but `y` is only valid for the duration of the `nested` function, so it is dropped here while still borrowed
 
 error: unsatisfied lifetime constraints
   --> $DIR/regions-nested-fns.rs:23:68