gccrs: Handle `async` functions in traits
commitf46fdb6399d91d56f095088c8cf0f1fd6d971e25
authorKushal Pal <kushalpal109@gmail.com>
Wed, 3 Jan 2024 10:32:07 +0000 (3 16:02 +0530)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 11:36:51 +0000 (30 12:36 +0100)
tree6baae6c9dad4ce80c6682db26cd327dfd59ee769
parent8b7d6adbbb886039f8c6e14a581dcbc9c63ce380
gccrs: Handle `async` functions in traits

Fixes #2785

gcc/rust/ChangeLog:

* checks/errors/rust-ast-validation.cc (ASTValidation::visit):
Added check for `async` functions inside trait.
* parse/rust-parse-impl.h (Parser::parse_trait_item):
Added switch-case for ASYNC token.

gcc/testsuite/ChangeLog:

* rust/compile/issue-2785.rs: New test.

Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
gcc/rust/checks/errors/rust-ast-validation.cc
gcc/rust/parse/rust-parse-impl.h
gcc/testsuite/rust/compile/issue-2785.rs [new file with mode: 0644]