add ui test for issue-69276
This commit is contained in:
parent
aeb473803d
commit
29a41f0d86
3 changed files with 25 additions and 1 deletions
12
src/test/ui/async-await/issue-69276.rs
Normal file
12
src/test/ui/async-await/issue-69276.rs
Normal 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() {}
|
||||
8
src/test/ui/async-await/issue-69276.stderr
Normal file
8
src/test/ui/async-await/issue-69276.stderr
Normal 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue