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