We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b70583 commit e123a61Copy full SHA for e123a61
compiler/rustc_parse/src/parser/item.rs
@@ -1291,12 +1291,10 @@ impl<'a> Parser<'a> {
1291
/// Parses an enum declaration.
1292
fn parse_item_enum(&mut self) -> PResult<'a, ItemInfo> {
1293
if self.token.is_keyword(kw::Struct) {
1294
- let mut err = self.struct_span_err(
1295
- self.prev_token.span.to(self.token.span),
1296
- "`enum` and `struct` are mutually exclusive",
1297
- );
+ let span = self.prev_token.span.to(self.token.span);
+ let mut err = self.struct_span_err(span, "`enum` and `struct` are mutually exclusive");
1298
err.span_suggestion(
1299
+ span,
1300
"replace `enum struct` with",
1301
"enum",
1302
Applicability::MachineApplicable,
0 commit comments