fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.2 KiB28 linesraw
1error: lifetime may not live long enough
2  --> $DIR/regions-static-bound.rs:9:5
3   |
4LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
5   |                        -- lifetime `'a` defined here
6LL |     t //[ll]~ ERROR E0312
7   |     ^ returning this value requires that `'a` must outlive `'static`
8
9error[E0621]: explicit lifetime required in the type of `u`
10  --> $DIR/regions-static-bound.rs:14:5
11   |
12LL | fn error(u: &(), v: &()) {
13   |             --- help: add explicit lifetime `'static` to the type of `u`: `&'static ()`
14LL |     static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621]
15   |     ^^^^^^^^^^^^^ lifetime `'static` required
16
17error[E0621]: explicit lifetime required in the type of `v`
18  --> $DIR/regions-static-bound.rs:16:5
19   |
20LL | fn error(u: &(), v: &()) {
21   |                     --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`
22...
23LL |     static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
24   |     ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
25
26error: aborting due to 3 previous errors
27
28For more information about this error, try `rustc --explain E0621`.