1 error[E0261]: use of undeclared lifetime name `'short`
2 --> $DIR/issue-107090.rs:4:9
4 LL | Foo<'short, 'out, T>: Convert<'a, 'b>;
5 | ^^^^^^ undeclared lifetime
7 = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
8 help: consider making the bound lifetime-generic with a new `'short` lifetime
10 LL | for<'short> Foo<'short, 'out, T>: Convert<'a, 'b>;
12 help: consider introducing lifetime `'short` here
14 LL | struct Foo<'short, 'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>)
17 error[E0261]: use of undeclared lifetime name `'out`
18 --> $DIR/issue-107090.rs:4:17
20 LL | Foo<'short, 'out, T>: Convert<'a, 'b>;
21 | ^^^^ undeclared lifetime
23 help: consider making the bound lifetime-generic with a new `'out` lifetime
25 LL | for<'out> Foo<'short, 'out, T>: Convert<'a, 'b>;
27 help: consider introducing lifetime `'out` here
29 LL | struct Foo<'out, 'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>)
32 error[E0261]: use of undeclared lifetime name `'b`
33 --> $DIR/issue-107090.rs:13:47
35 LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
36 | - ^^ undeclared lifetime
38 | help: consider introducing lifetime `'b` here: `'b,`
40 error[E0261]: use of undeclared lifetime name `'out`
41 --> $DIR/issue-107090.rs:13:67
43 LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
44 | - help: consider introducing lifetime `'out` here: `'out,` ^^^^ undeclared lifetime
46 error[E0261]: use of undeclared lifetime name `'out`
47 --> $DIR/issue-107090.rs:17:49
49 LL | fn cast(&'long self) -> &'short Foo<'short, 'out, T> {
50 | ^^^^ undeclared lifetime
52 help: consider introducing lifetime `'out` here
54 LL | fn cast<'out>(&'long self) -> &'short Foo<'short, 'out, T> {
56 help: consider introducing lifetime `'out` here
58 LL | impl<'out, 'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
61 error[E0261]: use of undeclared lifetime name `'short`
62 --> $DIR/issue-107090.rs:24:68
64 LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T {
65 | - ^^^^^^ undeclared lifetime
67 | help: consider introducing lifetime `'short` here: `'short,`
69 error[E0308]: mismatched types
70 --> $DIR/issue-107090.rs:4:27
72 LL | Foo<'short, 'out, T>: Convert<'a, 'b>;
73 | ^^^^^^^^^^^^^^^ lifetime mismatch
75 = note: expected trait `Convert<'static, 'static>`
76 found trait `Convert<'a, 'b>`
77 note: the lifetime `'a` as defined here...
78 --> $DIR/issue-107090.rs:2:12
80 LL | struct Foo<'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>)
82 = note: ...does not necessarily outlive the static lifetime
84 error[E0308]: mismatched types
85 --> $DIR/issue-107090.rs:4:27
87 LL | Foo<'short, 'out, T>: Convert<'a, 'b>;
88 | ^^^^^^^^^^^^^^^ lifetime mismatch
90 = note: expected trait `Convert<'static, 'static>`
91 found trait `Convert<'a, 'b>`
92 note: the lifetime `'b` as defined here...
93 --> $DIR/issue-107090.rs:2:16
95 LL | struct Foo<'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>)
97 = note: ...does not necessarily outlive the static lifetime
99 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'long` due to conflicting requirements
100 --> $DIR/issue-107090.rs:13:55
102 LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
103 | ^^^^^^^^^^^^^^^^^^^^
105 note: first, the lifetime cannot outlive the lifetime `'short` as defined here...
106 --> $DIR/issue-107090.rs:13:21
108 LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
110 = note: ...but the lifetime must also be valid for the static lifetime...
111 note: ...so that the types are compatible
112 --> $DIR/issue-107090.rs:13:55
114 LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
115 | ^^^^^^^^^^^^^^^^^^^^
116 = note: expected `Convert<'short, 'static>`
117 found `Convert<'_, 'static>`
119 error: incompatible lifetime on type
120 --> $DIR/issue-107090.rs:24:29
122 LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T {
125 note: because this has an unmet lifetime requirement
126 --> $DIR/issue-107090.rs:4:27
128 LL | Foo<'short, 'out, T>: Convert<'a, 'b>;
129 | ^^^^^^^^^^^^^^^ introduces a `'static` lifetime requirement
130 note: the lifetime `'out` as defined here...
131 --> $DIR/issue-107090.rs:24:17
133 LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T {
135 note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
136 --> $DIR/issue-107090.rs:13:1
138 LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
139 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
141 error[E0759]: `x` has lifetime `'in_` but it needs to satisfy a `'static` lifetime requirement
142 --> $DIR/issue-107090.rs:24:29
144 LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T {
147 | this data with lifetime `'in_`...
148 | ...is used and required to live as long as `'static` here
150 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'long` due to conflicting requirements
151 --> $DIR/issue-107090.rs:17:13
153 LL | fn cast(&'long self) -> &'short Foo<'short, 'out, T> {
156 note: first, the lifetime cannot outlive the lifetime `'short` as defined here...
157 --> $DIR/issue-107090.rs:13:21
159 LL | impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
161 = note: ...but the lifetime must also be valid for the static lifetime...
162 note: ...so that the types are compatible
163 --> $DIR/issue-107090.rs:17:13
165 LL | fn cast(&'long self) -> &'short Foo<'short, 'out, T> {
167 = note: expected `Convert<'short, 'static>`
168 found `Convert<'_, 'static>`
170 error: aborting due to 12 previous errors
172 Some errors have detailed explanations: E0261, E0308, E0495, E0759.
173 For more information about an error, try `rustc --explain E0261`.