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.1 KiB30 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
7   |     ^ returning this value requires that `'a` must outlive `'static`
8   |
9   = help: consider replacing `'a` with `'static`
10
11error[E0621]: explicit lifetime required in the type of `u`
12  --> $DIR/regions-static-bound.rs:14:5
13   |
14LL | fn error(u: &(), v: &()) {
15   |             --- help: add explicit lifetime `'static` to the type of `u`: `&'static ()`
16LL |     static_id(&u);
17   |     ^^^^^^^^^^^^^ lifetime `'static` required
18
19error[E0621]: explicit lifetime required in the type of `v`
20  --> $DIR/regions-static-bound.rs:16:5
21   |
22LL | fn error(u: &(), v: &()) {
23   |                     --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`
24...
25LL |     static_id_indirect(&v);
26   |     ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
27
28error: aborting due to 3 previous errors
29
30For more information about this error, try `rustc --explain E0621`.