diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 0421d6cb80e..d9b524f372e 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -5418,7 +5418,7 @@ Parser::parse_impl (AST::Visibility vis, else { // type path must both be valid and next token is for, so trait impl - if (!skip_token (FOR)) + if (!skip_token (FOR) || !skip_token (IDENTIFIER)) { skip_after_next_block (); return nullptr;