]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/in-trait/lifetime-mismatch.rs
Rollup merge of #105340 - estebank:ice-ice-baby, r=compiler-errors
[rust.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() {}