]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.stderr
slice_patterns: remove gates in tests
[rust.git] / src / test / ui / borrowck / borrowck-vec-pattern-tail-element-loan.stderr
index 0a5f773159f475c7682345dde11f846ba2a3db23..7e21c55f21b5fa7e901eba7b7136f3892ab2fb5d 100644 (file)
@@ -1,18 +1,12 @@
-error[E0597]: `vec` does not live long enough
-  --> $DIR/borrowck-vec-pattern-tail-element-loan.rs:5:26
+error[E0515]: cannot return value referencing local variable `vec`
+  --> $DIR/borrowck-vec-pattern-tail-element-loan.rs:8:5
    |
 LL |     let vec: &[isize] = &vec;
-   |                          ^^^ borrowed value does not live long enough
+   |                         ---- `vec` is borrowed here
 ...
-LL | }
-   | - borrowed value only lives until here
-   |
-note: borrowed value must be valid for the lifetime 'a as defined on the function body at 3:6...
-  --> $DIR/borrowck-vec-pattern-tail-element-loan.rs:3:6
-   |
-LL | fn a<'a>() -> &'a isize {
-   |      ^^
+LL |     tail
+   |     ^^^^ returns a value referencing data owned by the current function
 
 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 E0515`.