-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
union pseudo keyword is no longer accepted in enum variant position as of 2019-11-25 #66943
Comments
Interesting note: this does not apply to |
Regression introduced in #66641. My bad... should have remembered that The fix should be to make changes around here: rust/src/librustc_parse/parser/item.rs Line 1742 in 4007d4e
You'll want to use look-ahead to ensure that an identifier follows Also, add a regression test for |
@rustbot claim @kamleshbhalui |
@rustbot assign @kamleshbhalui |
You'll need to change fn recover_nested_adt_item(&mut self, keyword: Symbol) -> PResult<'a, bool> {
if self.token.is_keyword(kw::Enum) ||
self.token.is_keyword(kw::Struct) ||
self.token.is_keyword(kw::Union)
{ to something along the lines of fn recover_nested_adt_item(&mut self, keyword: Symbol) -> PResult<'a, bool> {
if (self.token.is_keyword(kw::Enum) ||
self.token.is_keyword(kw::Struct) ||
self.token.is_keyword(kw::Union))
&& self.look_ahead(1, |t| t.is_ident())
{ |
playground
Initially reported in arabidopsis/typescript-definitions#4 and then pest-parser/pest#429.
My best guess is #66592; cc @estebank
This issue has been assigned to @kamleshbhalui via this comment.
The text was updated successfully, but these errors were encountered: