Closed
Description
Originally reported in #63383 (comment).
#![feature(async_await)]
#![feature(nll)]
// Without it you also get //~^ ERROR cannot infer an appropriate lifetime
struct A;
impl A {
async fn foo(&self, f: &u32) -> &A {
self
}
}
should compile (it does if you remove async
or write async fn foo<'a, 'b>(&'a self, f: &'b u32) -> &'a A
) but does not (playground):
error[E0106]: missing lifetime specifier
--> src/lib.rs:7:37
|
7 | async fn foo(&self, f: &u32) -> &A {
| ^
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
This seems like a rather serious usability bug as compared to what you expect from normal Rust.
cc #63209
cc @nikomatsakis @cramertj