]> git.proxmox.com Git - rustc.git/blob - src/test/ui/async-await/in-trait/lifetime-mismatch.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / async-await / in-trait / lifetime-mismatch.rs
1 // edition:2021
2
3 #![feature(async_fn_in_trait)]
4 //~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
5
6 trait MyTrait {
7 async fn foo<'a>(&self);
8 async fn bar(&self);
9 }
10
11 impl MyTrait for i32 {
12 async fn foo(&self) {}
13 //~^ ERROR lifetime parameters or bounds on method `foo` do not match the trait declaration
14
15 async fn bar(&self) {
16 self.foo();
17 }
18 }
19
20 fn main() {}