]> git.ipfire.org Git - thirdparty/gcc.git/commit
Handle `async` functions in traits
authorKushal Pal <kushalpal109@gmail.com>
Wed, 3 Jan 2024 10:32:07 +0000 (16:02 +0530)
committerCohenArthur <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 14:43:32 +0000 (14:43 +0000)
commitf54df95296a58cdba4c87968ef837264ccd203c9
treefb0333ece6348eafac55afde877490f4e79209a5
parent3fcd86e404cac6763e40ca032aff942a3da09666
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]