diff options
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 5 | ||||
-rw-r--r-- | gcc/testsuite/rust/compile/torture/traits18.rs | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 14e4e80..8bddfcd 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -6239,9 +6239,7 @@ Parser<ManagedTokenSource>::parse_path_generic_args () const_TokenPtr t = lexer.peek_token (); Location locus = t->get_locus (); - const_TokenPtr t2 = lexer.peek_token (1); - while (t->get_id () == LIFETIME - && (t2->get_id () == COMMA || !is_right_angle_tok (t2->get_id ()))) + while (!is_right_angle_tok (t->get_id ())) { AST::Lifetime lifetime = parse_lifetime (); if (lifetime.is_error ()) @@ -6261,7 +6259,6 @@ Parser<ManagedTokenSource>::parse_path_generic_args () lexer.skip_token (); t = lexer.peek_token (); - t2 = lexer.peek_token (1); } // try to parse types second diff --git a/gcc/testsuite/rust/compile/torture/traits18.rs b/gcc/testsuite/rust/compile/torture/traits18.rs new file mode 100644 index 0000000..77cc5c2 --- /dev/null +++ b/gcc/testsuite/rust/compile/torture/traits18.rs @@ -0,0 +1,8 @@ +trait Foo<'a> {} + +trait Bar { + // { dg-warning "unused name .Bar." "" { target *-*-* } .-1 } + + type Item: for<'a> Foo<'a>; + // { dg-warning "unused name" "" { target *-*-* } .-1 } +} |