]> git.lizzy.rs Git - rust.git/blob - src/test/ui/wf/wf-static-method.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / wf / wf-static-method.stderr
1 error[E0312]: lifetime of reference outlives lifetime of borrowed content...
2   --> $DIR/wf-static-method.rs:27:9
3    |
4 LL |         u //~ ERROR E0312
5    |         ^
6    |
7 note: ...the reference is valid for the lifetime 'a as defined on the impl at 24:6...
8   --> $DIR/wf-static-method.rs:24:6
9    |
10 LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
11    |      ^^
12 note: ...but the borrowed content is only valid for the lifetime 'b as defined on the impl at 24:10
13   --> $DIR/wf-static-method.rs:24:10
14    |
15 LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
16    |          ^^
17
18 error[E0478]: lifetime bound not satisfied
19   --> $DIR/wf-static-method.rs:36:18
20    |
21 LL |         let me = Self::make_me(); //~ ERROR lifetime bound not satisfied
22    |                  ^^^^^^^^^^^^^
23    |
24 note: lifetime parameter instantiated with the lifetime 'b as defined on the impl at 33:10
25   --> $DIR/wf-static-method.rs:33:10
26    |
27 LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
28    |          ^^
29 note: but lifetime parameter must outlive the lifetime 'a as defined on the impl at 33:6
30   --> $DIR/wf-static-method.rs:33:6
31    |
32 LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
33    |      ^^
34
35 error[E0312]: lifetime of reference outlives lifetime of borrowed content...
36   --> $DIR/wf-static-method.rs:43:9
37    |
38 LL |         u //~ ERROR E0312
39    |         ^
40    |
41 note: ...the reference is valid for the lifetime 'a as defined on the impl at 41:6...
42   --> $DIR/wf-static-method.rs:41:6
43    |
44 LL | impl<'a, 'b> Evil<'a, 'b> {
45    |      ^^
46 note: ...but the borrowed content is only valid for the lifetime 'b as defined on the impl at 41:10
47   --> $DIR/wf-static-method.rs:41:10
48    |
49 LL | impl<'a, 'b> Evil<'a, 'b> {
50    |          ^^
51
52 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
53   --> $DIR/wf-static-method.rs:51:5
54    |
55 LL |     <()>::static_evil(b) //~ ERROR cannot infer an appropriate lifetime
56    |     ^^^^^^^^^^^^^^^^^
57    |
58 note: first, the lifetime cannot outlive the lifetime 'b as defined on the function body at 50:13...
59   --> $DIR/wf-static-method.rs:50:13
60    |
61 LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
62    |             ^^
63 note: ...so that reference does not outlive borrowed content
64   --> $DIR/wf-static-method.rs:51:23
65    |
66 LL |     <()>::static_evil(b) //~ ERROR cannot infer an appropriate lifetime
67    |                       ^
68 note: but, the lifetime must be valid for the lifetime 'a as defined on the function body at 50:9...
69   --> $DIR/wf-static-method.rs:50:9
70    |
71 LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
72    |         ^^
73 note: ...so that reference does not outlive borrowed content
74   --> $DIR/wf-static-method.rs:51:5
75    |
76 LL |     <()>::static_evil(b) //~ ERROR cannot infer an appropriate lifetime
77    |     ^^^^^^^^^^^^^^^^^^^^
78
79 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
80   --> $DIR/wf-static-method.rs:55:5
81    |
82 LL |     <IndirectEvil>::static_evil(b)
83    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
84    |
85 note: first, the lifetime cannot outlive the lifetime 'b as defined on the function body at 54:22...
86   --> $DIR/wf-static-method.rs:54:22
87    |
88 LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
89    |                      ^^
90 note: ...so that reference does not outlive borrowed content
91   --> $DIR/wf-static-method.rs:55:33
92    |
93 LL |     <IndirectEvil>::static_evil(b)
94    |                                 ^
95 note: but, the lifetime must be valid for the lifetime 'a as defined on the function body at 54:18...
96   --> $DIR/wf-static-method.rs:54:18
97    |
98 LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
99    |                  ^^
100 note: ...so that reference does not outlive borrowed content
101   --> $DIR/wf-static-method.rs:55:5
102    |
103 LL |     <IndirectEvil>::static_evil(b)
104    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
105
106 error: aborting due to 5 previous errors
107
108 Some errors occurred: E0312, E0478, E0495.
109 For more information about an error, try `rustc --explain E0312`.