diff options
author | M V V S Manoj Kumar <mvvsmanojkumar@gmail.com> | 2023-11-21 22:04:24 +0530 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2023-11-21 17:49:55 +0000 |
commit | 50fe556cc37e41af0d103f8723896c3e9ca39353 (patch) | |
tree | 8759e69cd4583e6969751005d543114677ad0d6d /gcc/rust/parse/rust-parse.h | |
parent | 34479e5427159b29aeb7685a5de58080e7899e8c (diff) | |
download | gcc-50fe556cc37e41af0d103f8723896c3e9ca39353.zip gcc-50fe556cc37e41af0d103f8723896c3e9ca39353.tar.gz gcc-50fe556cc37e41af0d103f8723896c3e9ca39353.tar.bz2 |
Added support to Parse ASYNC function
Fixes issue #2650
The parser now parses ASYNC functions. Added ASYNC case to parse_item
Added a new function parse_async_item which is called in
parse_vis_item to handle the ASYNC case. Parse_async_item
also checks the current Rust edition and generates an error if the
edition is 2015
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_item): Likewise.
(Parser::parse_vis_item): Likewise.
(Parser::parse_async_item): Likewise.
* parse/rust-parse.h: Made declaration for parse_async_item.
gcc/testsuite/ChangeLog:
* rust/compile/issue-2650-1.rs: New test.(edition=2018)
* rust/compile/issue-2650-2.rs: New test.(edition=2015)
Signed-off-by: M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse.h')
-rw-r--r-- | gcc/rust/parse/rust-parse.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h index e873d52..d371846 100644 --- a/gcc/rust/parse/rust-parse.h +++ b/gcc/rust/parse/rust-parse.h @@ -357,6 +357,8 @@ private: std::unique_ptr<AST::ExternBlock> parse_extern_block (AST::Visibility vis, AST::AttrVec outer_attrs); std::unique_ptr<AST::Function> parse_method (); + std::unique_ptr<AST::Function> parse_async_item (AST::Visibility vis, + AST::AttrVec outer_attrs); // Expression-related (Pratt parsed) std::unique_ptr<AST::Expr> |