add ui test for issue-69276

This commit is contained in:
csmoe 2020-05-11 14:24:57 +08:00
parent aeb473803d
commit 29a41f0d86
3 changed files with 25 additions and 1 deletions

View file

@ -0,0 +1,12 @@
// edition:2018
struct S<'a>(&'a i32);
impl<'a> S<'a> {
async fn new(i: &'a i32) -> Self {
//~^ ERROR `async fn` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
S(&22)
}
}
fn main() {}

View file

@ -0,0 +1,8 @@
error: `async fn` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
--> $DIR/issue-69276.rs:6:33
|
LL | async fn new(i: &'a i32) -> Self {
| ^^^^
error: aborting due to previous error