mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
94 lines
3.9 KiB
Plaintext
94 lines
3.9 KiB
Plaintext
error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait`
|
|
--> $DIR/issue-88236-2.rs:15:61
|
|
|
|
|
LL | fn make_impl() -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {}
|
|
| ^^
|
|
|
|
|
note: lifetime declared here
|
|
--> $DIR/issue-88236-2.rs:15:28
|
|
|
|
|
LL | fn make_impl() -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {}
|
|
| ^^
|
|
|
|
error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait`
|
|
--> $DIR/issue-88236-2.rs:18:80
|
|
|
|
|
LL | fn make_weird_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
|
|
| ^^
|
|
|
|
|
note: lifetime declared here
|
|
--> $DIR/issue-88236-2.rs:18:47
|
|
|
|
|
LL | fn make_weird_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
|
|
| ^^
|
|
|
|
error: implementation of `Hrtb` is not general enough
|
|
--> $DIR/issue-88236-2.rs:20:5
|
|
|
|
|
LL | &()
|
|
| ^^^ implementation of `Hrtb` is not general enough
|
|
|
|
|
= note: `Hrtb<'0>` would have to be implemented for the type `&()`, for any lifetime `'0`...
|
|
= note: ...but `Hrtb<'1>` is actually implemented for the type `&'1 ()`, for some specific lifetime `'1`
|
|
|
|
error: implementation of `Hrtb` is not general enough
|
|
--> $DIR/issue-88236-2.rs:20:5
|
|
|
|
|
LL | &()
|
|
| ^^^ implementation of `Hrtb` is not general enough
|
|
|
|
|
= note: `Hrtb<'a>` would have to be implemented for the type `&()`
|
|
= note: ...but `Hrtb<'0>` is actually implemented for the type `&'0 ()`, for some specific lifetime `'0`
|
|
|
|
error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait`
|
|
--> $DIR/issue-88236-2.rs:25:78
|
|
|
|
|
LL | fn make_bad_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
|
|
| ^^
|
|
|
|
|
note: lifetime declared here
|
|
--> $DIR/issue-88236-2.rs:25:45
|
|
|
|
|
LL | fn make_bad_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
|
|
| ^^
|
|
|
|
error: lifetime may not live long enough
|
|
--> $DIR/issue-88236-2.rs:27:5
|
|
|
|
|
LL | fn make_bad_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
|
|
| -- lifetime `'b` defined here
|
|
LL |
|
|
LL | x
|
|
| ^ returning this value requires that `'b` must outlive `'static`
|
|
|
|
|
help: to declare that `impl for<'a> Hrtb<'a, Assoc = impl Send + '_>` captures data from argument `x`, you can add an explicit `'b` lifetime bound
|
|
|
|
|
LL | fn make_bad_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> + 'b {
|
|
| ++++
|
|
help: to declare that `impl Send + 'a` captures data from argument `x`, you can add an explicit `'b` lifetime bound
|
|
|
|
|
LL | fn make_bad_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a + 'b> {
|
|
| ++++
|
|
|
|
error: implementation of `Hrtb` is not general enough
|
|
--> $DIR/issue-88236-2.rs:27:5
|
|
|
|
|
LL | x
|
|
| ^ implementation of `Hrtb` is not general enough
|
|
|
|
|
= note: `Hrtb<'0>` would have to be implemented for the type `&()`, for any lifetime `'0`...
|
|
= note: ...but `Hrtb<'1>` is actually implemented for the type `&'1 ()`, for some specific lifetime `'1`
|
|
|
|
error: implementation of `Hrtb` is not general enough
|
|
--> $DIR/issue-88236-2.rs:27:5
|
|
|
|
|
LL | x
|
|
| ^ implementation of `Hrtb` is not general enough
|
|
|
|
|
= note: `Hrtb<'a>` would have to be implemented for the type `&()`
|
|
= note: ...but `Hrtb<'0>` is actually implemented for the type `&'0 ()`, for some specific lifetime `'0`
|
|
|
|
error: aborting due to 8 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0657`.
|