We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa94da6 commit 9ce026cCopy full SHA for 9ce026c
compiler/rustc_parse/src/parser/ty.rs
@@ -405,10 +405,9 @@ impl<'a> Parser<'a> {
405
err.span_label(self.token.span, "expected type");
406
// self.maybe_annotate_with_ascription(&mut err, true);
407
408
- // `struct` is a strict keyword, so we can check it here as
409
- // we will be erroring otherwise
410
- // FIXME: or should we not?
411
- if self.token.is_keyword(kw::Struct) {
+ if allow_anonymous_types == AllowAnonymousTypes::OnlyRecover
+ && self.token.is_keyword(kw::Struct)
+ {
412
// Recover the parser from anonymous types anywhere other than field types.
413
let snapshot = self.create_snapshot_for_diagnostic();
414
match self.parse_anonymous_ty(lo) {
0 commit comments