]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-return-variable-on-stack-via-clone.stderr
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-return-variable-on-stack-via-clone.stderr
1 error[E0515]: cannot return value referencing function parameter `x`
2   --> $DIR/borrowck-return-variable-on-stack-via-clone.rs:7:5
3    |
4 LL |     (&x).clone()
5    |     ----^^^^^^^^
6    |     |
7    |     returns a value referencing data owned by the current function
8    |     `x` is borrowed here
9
10 error: aborting due to previous error
11
12 For more information about this error, try `rustc --explain E0515`.