forked from Rust-GCC/gccrs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate error for
async
trait fucntions
Fixes Rust-GCC#2767 gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Added check for `async` function inside trait. gcc/testsuite/ChangeLog: * rust/compile/issue-2767.rs: New test. Signed-off-by: Kushal Pal <[email protected]>
- Loading branch information
1 parent
3973664
commit 4e88167
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// { dg-additional-options "-frust-edition=2018" } | ||
trait Foo { | ||
fn f() -> u32; | ||
} | ||
|
||
impl Foo for u32 { | ||
async fn f() -> u32 { | ||
// { dg-error "functions in traits cannot be declared .async." "" { target *-*-* } .-1 } | ||
22 | ||
} | ||
} | ||
|
||
fn main() {} |