gccrs: Handle async
keyword for regular implementations
Fixes #2788 gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_inherent_impl_item): Added switch-case for ASYNC token. gcc/testsuite/ChangeLog: * rust/compile/issue-2788.rs: New test. Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
This commit is contained in:
parent
f7c8a712be
commit
7a0c487d2c
2 changed files with 11 additions and 0 deletions
|
@ -5600,6 +5600,7 @@ Parser<ManagedTokenSource>::parse_inherent_impl_item ()
|
|||
return nullptr;
|
||||
}
|
||||
}
|
||||
case ASYNC:
|
||||
case EXTERN_KW:
|
||||
case UNSAFE:
|
||||
case FN_KW:
|
||||
|
|
10
gcc/testsuite/rust/compile/issue-2788.rs
Normal file
10
gcc/testsuite/rust/compile/issue-2788.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// { dg-additional-options "-frust-compile-until=lowering" }
|
||||
struct Foo {
|
||||
arg_1: u32,
|
||||
arg_2: i32,
|
||||
}
|
||||
|
||||
impl Foo {
|
||||
async fn asynchronous_function_1(&self) {}
|
||||
async fn asynchronous_function_2() {}
|
||||
}
|
Loading…
Add table
Reference in a new issue