rust/src/test/ui/regions/regions-static-bound.nll.stderr

24 lines
797 B
Plaintext
Raw Normal View History

2018-12-11 15:49:40 -06:00
error: lifetime may not live long enough
2018-12-25 08:56:47 -07:00
--> $DIR/regions-static-bound.rs:9:5
2018-08-08 14:28:26 +02:00
|
LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
| -- lifetime `'a` defined here
LL | t
2018-08-14 21:26:33 +01:00
| ^ returning this value requires that `'a` must outlive `'static`
2018-11-28 15:05:36 -06:00
2018-08-08 14:28:26 +02:00
error[E0621]: explicit lifetime required in the type of `u`
2018-12-25 08:56:47 -07:00
--> $DIR/regions-static-bound.rs:14:5
2018-08-08 14:28:26 +02:00
|
LL | static_id(&u);
2018-08-08 14:28:26 +02:00
| ^^^^^^^^^^^^^ lifetime `'static` required
error[E0621]: explicit lifetime required in the type of `v`
2018-12-25 08:56:47 -07:00
--> $DIR/regions-static-bound.rs:16:5
2018-08-08 14:28:26 +02:00
|
LL | static_id_indirect(&v);
2018-08-08 14:28:26 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
error: aborting due to 3 previous errors
2018-08-08 14:28:26 +02:00
For more information about this error, try `rustc --explain E0621`.