]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-close-object-into-object-2.nll.stderr
Change NLL compare mode to borrowck=migrate.
[rust.git] / src / test / ui / regions / regions-close-object-into-object-2.nll.stderr
1 error: unsatisfied lifetime constraints
2   --> $DIR/regions-close-object-into-object-2.rs:20:5
3    |
4 LL | fn g<'a, T: 'static>(v: Box<A<T>+'a>) -> Box<X+'static> {
5    |      -- lifetime `'a` defined here
6 LL |     box B(&*v) as Box<X> //~ ERROR cannot infer
7    |     ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
8
9 error[E0597]: `*v` does not live long enough
10   --> $DIR/regions-close-object-into-object-2.rs:20:11
11    |
12 LL |     box B(&*v) as Box<X> //~ ERROR cannot infer
13    |           ^^^ borrowed value does not live long enough
14 LL | }
15    | - `*v` dropped here while still borrowed
16    |
17    = note: borrowed value must be valid for the static lifetime...
18
19 error: aborting due to 2 previous errors
20
21 For more information about this error, try `rustc --explain E0597`.