The parser was too agressive and did reject any line beginning with
default even if this was a macro call.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_item): Relax constraints
around default identifier at item scope to accept "default" macros.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
return parse_vis_item (std::move (outer_attrs));
// or should this go straight to parsing union?
}
- else if (t->get_str () == "default")
+ else if (t->get_str () == "default"
+ && lexer.peek_token (1)->get_id () != EXCLAM)
{
add_error (Error (t->get_locus (),
"%qs is only allowed on items within %qs blocks",