]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-ref-in-fn-arg.stderr
Apply suggestions from code review
[rust.git] / src / test / ui / regions / regions-ref-in-fn-arg.stderr
1 error[E0515]: cannot return value referencing function parameter
2   --> $DIR/regions-ref-in-fn-arg.rs:5:5
3    |
4 LL | fn arg_item(box ref x: Box<isize>) -> &'static isize {
5    |             --------- function parameter borrowed here
6 LL |     x
7    |     ^ returns a value referencing data owned by the current function
8
9 error[E0515]: cannot return value referencing function parameter
10   --> $DIR/regions-ref-in-fn-arg.rs:11:22
11    |
12 LL |     with(|box ref x| x)
13    |           ---------  ^ returns a value referencing data owned by the current function
14    |           |
15    |           function parameter borrowed here
16
17 error: aborting due to 2 previous errors
18
19 For more information about this error, try `rustc --explain E0515`.