about summary refs log tree commit diff
path: root/src/test/ui/span
diff options
context:
space:
mode:
authorMikhail Modin <mikhailm1@gmail.com>2018-09-23 16:30:46 +0100
committerMikhail Modin <mikhailm1@gmail.com>2018-09-25 15:23:56 +0100
commit5fc0b743d752f57d39cbd7ff10450211affe79a0 (patch)
treee1ee7b6b3938d98f71dfc7bda762a1dba5785371 /src/test/ui/span
parentae366637fedf6f34185e54fc7b2d725b1a458ff6 (diff)
downloadrust-5fc0b743d752f57d39cbd7ff10450211affe79a0.tar.gz
rust-5fc0b743d752f57d39cbd7ff10450211affe79a0.zip
add "temporary value dropped while borrowed" error
Issue #54131
Diffstat (limited to 'src/test/ui/span')
-rw-r--r--src/test/ui/span/borrowck-let-suggestion-suffixes.nll.stderr20
-rw-r--r--src/test/ui/span/issue-15480.nll.stderr8
-rw-r--r--src/test/ui/span/regions-close-over-borrowed-ref-in-obj.nll.stderr8
-rw-r--r--src/test/ui/span/slice-borrow.nll.stderr8
4 files changed, 22 insertions, 22 deletions
diff --git a/src/test/ui/span/borrowck-let-suggestion-suffixes.nll.stderr b/src/test/ui/span/borrowck-let-suggestion-suffixes.nll.stderr
index 001eba4b039..765d8b36b0e 100644
--- a/src/test/ui/span/borrowck-let-suggestion-suffixes.nll.stderr
+++ b/src/test/ui/span/borrowck-let-suggestion-suffixes.nll.stderr
@@ -1,36 +1,36 @@
-error[E0597]: borrowed value does not live long enough
+error[E0714]: temporary value dropped while borrowed
   --> $DIR/borrowck-let-suggestion-suffixes.rs:28:14
    |
 LL |     v3.push(&id('x'));           // statement 6
-   |              ^^^^^^^ - temporary value only lives until here
+   |              ^^^^^^^ - temporary value is freed at the end of this statement
    |              |
-   |              temporary value does not live long enough
+   |              creates a temporary which is freed while still in use
 ...
 LL |     (v1, v2, v3, /* v4 is above. */ v5).use_ref();
    |              -- borrow later used here
    |
    = note: consider using a `let` binding to create a longer lived value
 
-error[E0597]: borrowed value does not live long enough
+error[E0714]: temporary value dropped while borrowed
   --> $DIR/borrowck-let-suggestion-suffixes.rs:38:18
    |
 LL |         v4.push(&id('y'));
-   |                  ^^^^^^^ - temporary value only lives until here
+   |                  ^^^^^^^ - temporary value is freed at the end of this statement
    |                  |
-   |                  temporary value does not live long enough
+   |                  creates a temporary which is freed while still in use
 ...
 LL |         v4.use_ref();
    |         -- borrow later used here
    |
    = note: consider using a `let` binding to create a longer lived value
 
-error[E0597]: borrowed value does not live long enough
+error[E0714]: temporary value dropped while borrowed
   --> $DIR/borrowck-let-suggestion-suffixes.rs:49:14
    |
 LL |     v5.push(&id('z'));
-   |              ^^^^^^^ - temporary value only lives until here
+   |              ^^^^^^^ - temporary value is freed at the end of this statement
    |              |
-   |              temporary value does not live long enough
+   |              creates a temporary which is freed while still in use
 ...
 LL |     (v1, v2, v3, /* v4 is above. */ v5).use_ref();
    |                                     -- borrow later used here
@@ -39,4 +39,4 @@ LL |     (v1, v2, v3, /* v4 is above. */ v5).use_ref();
 
 error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0714`.
diff --git a/src/test/ui/span/issue-15480.nll.stderr b/src/test/ui/span/issue-15480.nll.stderr
index 8dcf486f830..098e1ce62a8 100644
--- a/src/test/ui/span/issue-15480.nll.stderr
+++ b/src/test/ui/span/issue-15480.nll.stderr
@@ -1,10 +1,10 @@
-error[E0597]: borrowed value does not live long enough
+error[E0714]: temporary value dropped while borrowed
   --> $DIR/issue-15480.rs:15:10
    |
 LL |         &id(3)
-   |          ^^^^^ temporary value does not live long enough
+   |          ^^^^^ creates a temporary which is freed while still in use
 LL |     ];
-   |      - temporary value only lives until here
+   |      - temporary value is freed at the end of this statement
 ...
 LL |     for &&x in &v {
    |                -- borrow later used here
@@ -13,4 +13,4 @@ LL |     for &&x in &v {
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0714`.
diff --git a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.nll.stderr b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.nll.stderr
index 3788b5a3284..0e5fc749d96 100644
--- a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.nll.stderr
+++ b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.nll.stderr
@@ -1,11 +1,11 @@
-error[E0597]: borrowed value does not live long enough
+error[E0714]: temporary value dropped while borrowed
   --> $DIR/regions-close-over-borrowed-ref-in-obj.rs:22:27
    |
 LL |         let ss: &isize = &id(1);
-   |                           ^^^^^ temporary value does not live long enough
+   |                           ^^^^^ creates a temporary which is freed while still in use
 ...
 LL |     }
-   |     - temporary value only lives until here
+   |     - temporary value is freed at the end of this statement
 LL | }
    | - borrow later used here, when `blah` is dropped
    |
@@ -13,4 +13,4 @@ LL | }
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0714`.
diff --git a/src/test/ui/span/slice-borrow.nll.stderr b/src/test/ui/span/slice-borrow.nll.stderr
index 4a15d8ff455..0aeb549d95e 100644
--- a/src/test/ui/span/slice-borrow.nll.stderr
+++ b/src/test/ui/span/slice-borrow.nll.stderr
@@ -1,11 +1,11 @@
-error[E0597]: borrowed value does not live long enough
+error[E0714]: temporary value dropped while borrowed
   --> $DIR/slice-borrow.rs:16:28
    |
 LL |         let x: &[isize] = &vec![1, 2, 3, 4, 5];
-   |                            ^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
+   |                            ^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
 ...
 LL |     }
-   |     - temporary value only lives until here
+   |     - temporary value is freed at the end of this statement
 LL |     y.use_ref();
    |     - borrow later used here
    |
@@ -14,4 +14,4 @@ LL |     y.use_ref();
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0714`.