diff options
| author | Xiretza <xiretza@xiretza.xyz> | 2022-10-06 18:35:53 +0200 |
|---|---|---|
| committer | Xiretza <xiretza@xiretza.xyz> | 2023-02-01 21:50:34 +0100 |
| commit | 0757d5f83f4bc4faca896c85932cf1e4a0cd6031 (patch) | |
| tree | a10dccb1ef78f9869c3fdcc87a647023cfa9a787 /compiler/rustc_parse/src | |
| parent | a84adba55239b5bfa702ee4937a7f14b36aab181 (diff) | |
| download | rust-0757d5f83f4bc4faca896c85932cf1e4a0cd6031.tar.gz rust-0757d5f83f4bc4faca896c85932cf1e4a0cd6031.zip | |
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(...);
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |
