@@ -31,43 +31,31 @@ LL | let x: Box<Foo + 'static> = Box::new(v);
31
31
| ^^^^^^^^^^^ lifetime `'static` required
32
32
33
33
error[E0621]: explicit lifetime required in the type of `v`
34
- --> $DIR/region-object-lifetime-in-coercion.rs:23:38
34
+ --> $DIR/region-object-lifetime-in-coercion.rs:24:5
35
35
|
36
- LL | fn b(v: &[u8]) -> Box<Foo + 'static> {
37
- | _________-----________________________^
38
- | | |
39
- | | help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]`
40
- LL | | Box::new(v)
41
- LL | | //~^ ERROR explicit lifetime required in the type of `v` [E0621]
42
- LL | | }
43
- | |_^ lifetime `'static` required
36
+ LL | fn b(v: &[u8]) -> Box<Foo + 'static> {
37
+ | ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]`
38
+ LL | Box::new(v)
39
+ | ^^^^^^^^^^^ lifetime `'static` required
44
40
45
41
error[E0621]: explicit lifetime required in the type of `v`
46
- --> $DIR/region-object-lifetime-in-coercion.rs:28:28
42
+ --> $DIR/region-object-lifetime-in-coercion.rs:31:5
47
43
|
48
- LL | fn c(v: &[u8]) -> Box<Foo> {
49
- | _________-----______________^
50
- | | |
51
- | | help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]`
52
- LL | | // same as previous case due to RFC 599
53
- LL | |
54
- LL | | Box::new(v)
55
- LL | | //~^ ERROR explicit lifetime required in the type of `v` [E0621]
56
- LL | | }
57
- | |_^ lifetime `'static` required
44
+ LL | fn c(v: &[u8]) -> Box<Foo> {
45
+ | ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]`
46
+ ...
47
+ LL | Box::new(v)
48
+ | ^^^^^^^^^^^ lifetime `'static` required
58
49
59
50
error: unsatisfied lifetime constraints
60
- --> $DIR/region-object-lifetime-in-coercion.rs:35:41
51
+ --> $DIR/region-object-lifetime-in-coercion.rs:36:5
61
52
|
62
- LL | fn d<'a,'b>(v: &'a [u8]) -> Box<Foo+'b> {
63
- | ______--_--______________________________^
64
- | | | |
65
- | | | lifetime `'b` defined here
66
- | | lifetime `'a` defined here
67
- LL | | Box::new(v)
68
- LL | | //~^ ERROR cannot infer an appropriate lifetime due to conflicting
69
- LL | | }
70
- | |_^ returning this value requires that `'a` must outlive `'b`
53
+ LL | fn d<'a,'b>(v: &'a [u8]) -> Box<Foo+'b> {
54
+ | -- -- lifetime `'b` defined here
55
+ | |
56
+ | lifetime `'a` defined here
57
+ LL | Box::new(v)
58
+ | ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b`
71
59
72
60
error: aborting due to 4 previous errors
73
61
0 commit comments