blob: f32509737a1ddecffce42926a79ce76900e08877 [file] [log] [blame]
error[E0515]: cannot return value referencing local variable `vec`
--> $DIR/borrowck-vec-pattern-element-loan.rs:20:5
|
LL | let vec: &[isize] = &vec; //~ ERROR does not live long enough
| ---- `vec` is borrowed here
...
LL | tail
| ^^^^ returns a value referencing data owned by the current function
error[E0515]: cannot return value referencing local variable `vec`
--> $DIR/borrowck-vec-pattern-element-loan.rs:30:5
|
LL | let vec: &[isize] = &vec; //~ ERROR does not live long enough
| ---- `vec` is borrowed here
...
LL | init
| ^^^^ returns a value referencing data owned by the current function
error[E0515]: cannot return value referencing local variable `vec`
--> $DIR/borrowck-vec-pattern-element-loan.rs:40:5
|
LL | let vec: &[isize] = &vec; //~ ERROR does not live long enough
| ---- `vec` is borrowed here
...
LL | slice
| ^^^^^ returns a value referencing data owned by the current function
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0515`.