Add tests for static async functions in traits
This patch adds test cases for AFIT, the majority of which are currently expected to run as `check-fail`.
This commit is contained in:
parent
0da281b606
commit
97423d331f
19 changed files with 530 additions and 0 deletions
17
src/test/ui/async-await/in-trait/async-example.rs
Normal file
17
src/test/ui/async-await/in-trait/async-example.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
// check-pass
|
||||
// edition: 2021
|
||||
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait MyTrait {
|
||||
async fn foo(&self) -> i32;
|
||||
}
|
||||
|
||||
impl MyTrait for i32 {
|
||||
async fn foo(&self) -> i32 {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue