Closed
Description
Related to #89970
Code
#![feature(generic_associated_types)]
trait T<'ctx> {
type Fut<'out>
where
'ctx: 'out,
Self: 'out;
fn test<'me, 'out>(&'me self, ctx: &'ctx i32) -> Self::Fut<'out>
where
'me: 'out,
'ctx: 'out;
}
Basically I want to desugar async fn
. For this I need to describe Fut
GAT that lives the smallest of the 'me
and 'ctx
, but I get compiler error with requirement that doesn't really make sense to me.
error: Missing required bounds on Fut
--> src/lib.rs:4:5
|
4 | / type Fut<'out>
5 | | where
6 | | 'ctx: 'out,
7 | | Self: 'out;
| | ^ help: add the required where clauses: `, 'out: 'ctx`
| |___________________|
|
error: could not compile `playground` due to previous error
'out
cant't outlive 'ctx
.
Meta
fails on 1.58.0-nightly (2021-11-18 cc946fcd326f7d85d4af)
Playground