]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr
Change NLL compare mode to borrowck=migrate.
[rust.git] / src / test / ui / regions / region-object-lifetime-in-coercion.nll.stderr
1 error[E0621]: explicit lifetime required in the type of `v`
2   --> $DIR/region-object-lifetime-in-coercion.rs:18:12
3    |
4 LL | fn a(v: &[u8]) -> Box<Foo + 'static> {
5    |         ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]`
6 LL |     let x: Box<Foo + 'static> = Box::new(v);
7    |            ^^^^^^^^^^^^^^^^^^ lifetime `'static` required
8
9 error[E0621]: explicit lifetime required in the type of `v`
10   --> $DIR/region-object-lifetime-in-coercion.rs:24:5
11    |
12 LL | fn b(v: &[u8]) -> Box<Foo + 'static> {
13    |         ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]`
14 LL |     Box::new(v)
15    |     ^^^^^^^^^^^ lifetime `'static` required
16
17 error[E0621]: explicit lifetime required in the type of `v`
18   --> $DIR/region-object-lifetime-in-coercion.rs:31:5
19    |
20 LL | fn c(v: &[u8]) -> Box<Foo> {
21    |         ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]`
22 ...
23 LL |     Box::new(v)
24    |     ^^^^^^^^^^^ lifetime `'static` required
25
26 error: unsatisfied lifetime constraints
27   --> $DIR/region-object-lifetime-in-coercion.rs:36:5
28    |
29 LL | fn d<'a,'b>(v: &'a [u8]) -> Box<Foo+'b> {
30    |      -- -- lifetime `'b` defined here
31    |      |
32    |      lifetime `'a` defined here
33 LL |     Box::new(v)
34    |     ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b`
35
36 error: aborting due to 4 previous errors
37
38 For more information about this error, try `rustc --explain E0621`.