-
Notifications
You must be signed in to change notification settings - Fork 197
Add check for token at parse_bare_function_type #4316
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
base: master
Are you sure you want to change the base?
Conversation
|
Not sure if I'm doing things right, but I had to delete my previous branch to rebase to the current gccrs |
No this doesn't feel right. You don't have to delete anything to rebase your work on top of master. If you maintain a master branch on your fork then you can simply fetch it from the main repository and rebase it, either with your local git or online using the "sync fork" button. |
|
I pushed the button and suddenly all the compiler checks failed, but I guess I could just delete my local branch |
|
Alpine build couldn't run properly because It couldn't download gettext-0.22.tar.gz |
gcc/rust/parse/rust-parse-impl.h
Outdated
| return nullptr; | ||
|
|
||
| auto t = lexer.peek_token (); | ||
| if (t->get_id () == IDENTIFIER) |
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.
You should probably replace this condition with != LEFT_PAREN
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.
unless this is just intended to cover the identifier 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.
It definitely wouldn't be right to check for just one case
gcc/rust/parse/rust-parse-impl.h
Outdated
| if (!skip_token (LEFT_PAREN)) | ||
| return nullptr; |
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.
This condition can be removed, we've already checked for a LEFT_PAREN and returned a nullptr, we only need to skip it.
gcc/rust/ChangeLog: * parse/rust-parse-impl.h: new error Signed-off-by: Lúcio Boari Fleury <[email protected]>
gcc/testsuite/ChangeLog: * rust/compile/invalid_impl_for.rs: triggers check for identifier Signed-off-by: Lúcio Boari Fleury <[email protected]>
gcc/rust/ChangeLog: * parse/rust-parse-impl.h: (parse_bare_function_type) broadens check gcc/testsuite/ChangeLog: * rust/compile/invalid_impl_for.rs: broadens regex Signed-off-by: Lúcio Boari Fleury <[email protected]>
gcc/testsuite/ChangeLog: * rust/compile/invalid_impl_for.rs: nothing should change in principle Signed-off-by: Lúcio Boari Fleury <[email protected]>
gcc/rust/ChangeLog: * parse/rust-parse-impl.h: (parse_bare_function_type) remove redundancy Signed-off-by: Lúcio Boari Fleury <[email protected]>
previously the compiler emmited:
now it emmits:
code example: