async fn foo<T>()
async fn foo<'a, T>(x: &'a u8) {}
fn foo<'a, T>(x: &'a u8) -> impl Future<Output = ()> + 'a {}
fn foo<'async, 'a, T>(x: &'a u8) -> impl Future<Output = ()> + 'async
where 'a: 'async, T: 'async
{ }
// but the "defining scope" of the `Foo` is the fn itself
existential type Foo<'a, T>: Future<Output = ()>;
fn foo<'a, T>(x: &'a u8) -> Foo<'a, T> {..}
async fn foo<T>(x: &u8, y: &u8) -> ()
existential type Foo<'a, 'b, T>: Future<Output = ()>;
fn foo<'a, 'b, T>(x: &'a u8, y: &'b u8) -> Foo<'a, 'b, T>
fn foo(x: Box<dyn Write {+ 'static}>)
impl Foo for &u8
// lower to a implicit, early-bound parameter on the impl
fn foo(x: &u8)
// lower to a late-bound parameter on the fn
impl Foo for &u8 { } =>
impl<'a> Foo for &'a u8
impl Foo for &Box<dyn Write> { } =>
impl<'a> Foo for &'a Box<dyn Write + 'static>
“lifetime issues”
async fn foo<T>()
async fn foo<'a, T>(x: &'a u8) {}
fn foo<'a, T>(x: &'a u8) -> impl Future<Output = ()> + 'a {}
fn foo<'async, 'a, T>(x: &'a u8) -> impl Future<Output = ()> + 'async
where 'a: 'async, T: 'async
{ }
// but the "defining scope" of the `Foo` is the fn itself
existential type Foo<'a, T>: Future<Output = ()>;
fn foo<'a, T>(x: &'a u8) -> Foo<'a, T> {..}
async fn foo<T>(x: &u8, y: &u8) -> ()
existential type Foo<'a, 'b, T>: Future<Output = ()>;
fn foo<'a, 'b, T>(x: &'a u8, y: &'b u8) -> Foo<'a, 'b, T>
fn foo(x: Box<dyn Write {+ 'static}>)
side bar: lifetimes in lowering omg
impl Foo for &u8
// lower to a implicit, early-bound parameter on the impl
fn foo(x: &u8)
// lower to a late-bound parameter on the fn
impl Foo for &u8 { } =>
impl<'a> Foo for &'a u8
impl Foo for &Box<dyn Write> { } =>
impl<'a> Foo for &'a Box<dyn Write + 'static>
vague plan: