-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Showing
4 changed files
with
52 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
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,5 @@ | ||
// { dg-additional-options "-frust-edition=2018" } | ||
|
||
pub async fn a() -> u32 { | ||
1 | ||
} |
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,5 @@ | ||
// { dg-additional-options "-frust-edition=2015" } | ||
|
||
pub async fn a() -> u32 { // { dg-error "'async fn' is not permitted in Rust 2015" } | ||
1 | ||
} |