]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-ref-in-fn-arg.nll.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / regions / regions-ref-in-fn-arg.nll.stderr
1 error[E0716]: temporary value dropped while borrowed
2   --> $DIR/regions-ref-in-fn-arg.rs:14:13
3    |
4 LL | fn arg_item(box ref x: Box<isize>) -> &'static isize {
5    |             ^^^^^^^^^ creates a temporary which is freed while still in use
6 LL |     x //~^ ERROR borrowed value does not live long enough
7 LL | }
8    | - temporary value is freed at the end of this statement
9    |
10    = note: borrowed value must be valid for the static lifetime...
11
12 error[E0716]: temporary value dropped while borrowed
13   --> $DIR/regions-ref-in-fn-arg.rs:21:11
14    |
15 LL |     with(|box ref x| x) //~ ERROR borrowed value does not live long enough
16    |           ^^^^^^^^^  - temporary value is freed at the end of this statement
17    |           |
18    |           creates a temporary which is freed while still in use
19
20 error: aborting due to 2 previous errors
21
22 For more information about this error, try `rustc --explain E0716`.