fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.6 KiB48 linesraw
1error[E0309]: the parameter type `T` may not live long enough
2  --> $DIR/regions-struct-not-wf.rs:13:16
3   |
4LL |     type Out = &'a T;
5   |                ^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
6   |
7help: consider adding an explicit lifetime bound...
8   |
9LL | impl<'a, T: 'a> Trait<'a, T> for usize {
10   |           ++++
11
12error[E0309]: the parameter type `T` may not live long enough
13  --> $DIR/regions-struct-not-wf.rs:21:16
14   |
15LL |     type Out = RefOk<'a, T>;
16   |                ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
17   |
18note: ...that is required by this bound
19  --> $DIR/regions-struct-not-wf.rs:16:20
20   |
21LL | struct RefOk<'a, T:'a> {
22   |                    ^^
23help: consider adding an explicit lifetime bound...
24   |
25LL | impl<'a, T: 'a> Trait<'a, T> for u32 {
26   |           ++++
27
28error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
29  --> $DIR/regions-struct-not-wf.rs:25:16
30   |
31LL |     type Out = &'a &'b T;
32   |                ^^^^^^^^^
33   |
34note: the pointer is valid for the lifetime `'a` as defined here
35  --> $DIR/regions-struct-not-wf.rs:24:6
36   |
37LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
38   |      ^^
39note: but the referenced data is only valid for the lifetime `'b` as defined here
40  --> $DIR/regions-struct-not-wf.rs:24:10
41   |
42LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
43   |          ^^
44
45error: aborting due to 3 previous errors
46
47Some errors have detailed explanations: E0309, E0491.
48For more information about an error, try `rustc --explain E0309`.