]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-static-bound.stderr
Rollup merge of #106043 - c410-f3r:moar-errors, r=petrochenkov
[rust.git] / src / test / ui / regions / regions-static-bound.stderr
1 warning: unnecessary lifetime parameter `'a`
2   --> $DIR/regions-static-bound.rs:2:11
3    |
4 LL |     where 'a: 'static { t }
5    |           ^^
6    |
7    = help: you can use the `'static` lifetime directly, in place of `'a`
8
9 warning: unnecessary lifetime parameter `'b`
10   --> $DIR/regions-static-bound.rs:6:19
11    |
12 LL |     where 'a: 'b, 'b: 'static { t }
13    |                   ^^
14    |
15    = help: you can use the `'static` lifetime directly, in place of `'b`
16
17 error: lifetime may not live long enough
18   --> $DIR/regions-static-bound.rs:10:5
19    |
20 LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
21    |                        -- lifetime `'a` defined here
22 LL |     t
23    |     ^ returning this value requires that `'a` must outlive `'static`
24
25 error[E0521]: borrowed data escapes outside of function
26   --> $DIR/regions-static-bound.rs:15:5
27    |
28 LL | fn error(u: &(), v: &()) {
29    |          -  - let's call the lifetime of this reference `'1`
30    |          |
31    |          `u` is a reference that is only valid in the function body
32 LL |     static_id(&u);
33    |     ^^^^^^^^^^^^^
34    |     |
35    |     `u` escapes the function body here
36    |     argument requires that `'1` must outlive `'static`
37
38 error[E0521]: borrowed data escapes outside of function
39   --> $DIR/regions-static-bound.rs:17:5
40    |
41 LL | fn error(u: &(), v: &()) {
42    |                  -  - let's call the lifetime of this reference `'2`
43    |                  |
44    |                  `v` is a reference that is only valid in the function body
45 ...
46 LL |     static_id_indirect(&v);
47    |     ^^^^^^^^^^^^^^^^^^^^^^
48    |     |
49    |     `v` escapes the function body here
50    |     argument requires that `'2` must outlive `'static`
51
52 error: aborting due to 3 previous errors; 2 warnings emitted
53
54 For more information about this error, try `rustc --explain E0521`.