]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-vec-pattern-element-loan.stderr
Rollup merge of #107306 - compiler-errors:correct-sugg-for-closure-arg-needs-borrow...
[rust.git] / tests / ui / borrowck / borrowck-vec-pattern-element-loan.stderr
1 error[E0515]: cannot return value referencing local variable `vec`
2   --> $DIR/borrowck-vec-pattern-element-loan.rs:8:5
3    |
4 LL |     let vec: &[isize] = &vec;
5    |                         ---- `vec` is borrowed here
6 ...
7 LL |     tail
8    |     ^^^^ returns a value referencing data owned by the current function
9
10 error[E0515]: cannot return value referencing local variable `vec`
11   --> $DIR/borrowck-vec-pattern-element-loan.rs:18:5
12    |
13 LL |     let vec: &[isize] = &vec;
14    |                         ---- `vec` is borrowed here
15 ...
16 LL |     init
17    |     ^^^^ returns a value referencing data owned by the current function
18
19 error[E0515]: cannot return value referencing local variable `vec`
20   --> $DIR/borrowck-vec-pattern-element-loan.rs:28:5
21    |
22 LL |     let vec: &[isize] = &vec;
23    |                         ---- `vec` is borrowed here
24 ...
25 LL |     slice
26    |     ^^^^^ returns a value referencing data owned by the current function
27
28 error: aborting due to 3 previous errors
29
30 For more information about this error, try `rustc --explain E0515`.