-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle async
keyword for regular implementations
#2789
Conversation
@braw-lee You don't need You're right though when saying that it won't be easy to test as we cannot lower async yet. We only want to make sure the syntax is correct. Here is what you can do, since you modified the parser you could test that it behaves correctly. To do so you need to create an async rust snippet and add it to the testsuite under // { dg-additional-options "-frust-compile-until=lowering" } This tells the testsuite to pass a flag to the compiler in order to stop before the lowering step. There are a multiple other compile steps, tune the value to your needs but keep in mind the compiler will stop before the selected step. |
thanks, I will try this soon |
Fixes Rust-GCC#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 <[email protected]>
@P-E-P as the compiler will stop before lowering step, I made the test case as minimal as possible. Let me know if you were expecting a more verbose test case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test looks good! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #2788
I am not sure how to test this as we don't have to check for error. I was reading up on
async
functions usage and I think Tokio is required to write small code snippets, which isn't supported by gccrs yet.