Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion gcc/rust/parse/rust-parse-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,10 @@ Parser<ManagedTokenSource>::parse_attr_input ()
return attr_input_lit;
}
break;
case RIGHT_PAREN:
case RIGHT_SQUARE:
case RIGHT_CURLY:
case END_OF_FILE:
// means AttrInput is missing, which is allowed
return nullptr;
default:
Expand Down Expand Up @@ -11911,7 +11914,7 @@ Parser<ManagedTokenSource>::skip_after_end_attribute ()
{
const_TokenPtr t = lexer.peek_token ();

while (t->get_id () != RIGHT_SQUARE)
while (t->get_id () != RIGHT_SQUARE && t->get_id () != END_OF_FILE)
{
lexer.skip_token ();
t = lexer.peek_token ();
Expand Down
7 changes: 7 additions & 0 deletions gcc/testsuite/rust/compile/macros/mbe/meta-param.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
macro_rules! foo {
($x:meta) => {0}
}

pub fn main() -> i32 {
foo!(Clone)
}