2023-06-21 16:56:34 -05:00
error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyBound(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a), T, ReEarlyBound(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a)])` captures lifetime that does not appear in bounds
2022-02-14 10:10:22 -06:00
--> $DIR/impl-trait-captures.rs:11:5
2017-12-10 09:23:45 -06:00
|
2019-03-31 11:07:56 -05:00
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
2023-02-20 21:58:38 -06:00
| -- ------------ opaque type defined here
| |
2023-03-05 16:29:57 -06:00
| hidden type `&ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)) T` captures the anonymous lifetime defined here
2022-02-14 10:10:22 -06:00
LL | x
| ^
2019-10-24 00:20:58 -05:00
|
2023-06-21 16:56:34 -05:00
help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyBound(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a), T, ReEarlyBound(DefId(0:14 ~ impl_trait_captures[aeb9]::foo::{opaque#0}::'a), 2, 'a)])` captures `ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))` lifetime bound
2018-08-06 12:56:24 -05:00
|
2023-02-11 10:51:04 -06:00
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)) {
2022-06-19 15:57:05 -05:00
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2017-12-10 09:23:45 -06:00
error: aborting due to previous error
2021-09-23 10:21:01 -05:00
For more information about this error, try `rustc --explain E0700`.