From 0757d5f83f4bc4faca896c85932cf1e4a0cd6031 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Thu, 6 Oct 2022 18:35:53 +0200 Subject: Fix condition for "missing `struct`" diagnostic on tuple structs The check previously matched this, and suggested adding a missing `struct`: pub Foo(...): It was probably intended to match this instead (semicolon instead of colon): pub Foo(...); --- compiler/rustc_parse/src/parser/item.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_parse/src') diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index d72c7d8cabc..32ffc9306f2 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -412,7 +412,7 @@ impl<'a> Parser<'a> { } else if self.check(&token::OpenDelim(Delimiter::Brace)) { self.bump(); // `{` ("fn", kw_name, false) - } else if self.check(&token::Colon) { + } else if self.check(&token::Semi) { let kw = "struct"; (kw, kw, false) } else { -- cgit 1.4.1-3-g733a5