Skip to content

Commit 4b8856f

Browse files
committed
Catch tokens different from IDENTIFIER
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 <lucboari@gmail.com>
1 parent 13e0940 commit 4b8856f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

gcc/rust/parse/rust-parse-impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9671,7 +9671,7 @@ Parser<ManagedTokenSource>::parse_bare_function_type (
96719671
return nullptr;
96729672

96739673
auto t = lexer.peek_token ();
9674-
if (t->get_id () == IDENTIFIER)
9674+
if (t->get_id () != LEFT_PAREN)
96759675
{
96769676
Error error (t->get_locus (),
96779677
"unexpected token %qs - expected bare function",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
impl Foo for
2-
fn main() {// { dg-error "unexpected token .identifier. - expected bare function" }
2+
fn main() {// { dg-error "unexpected token ..*. - expected bare function" }
33
// { dg-error "could not parse type in trait impl" "" { target *-*-* } .-1 }
44
}

0 commit comments

Comments
 (0)