We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84946fe commit a3e2314Copy full SHA for a3e2314
compiler/rustc_parse/src/parser/item.rs
@@ -1283,12 +1283,10 @@ impl<'a> Parser<'a> {
1283
/// Parses an enum declaration.
1284
fn parse_item_enum(&mut self) -> PResult<'a, ItemInfo> {
1285
if self.token.is_keyword(kw::Struct) {
1286
- let mut err = self.struct_span_err(
1287
- self.prev_token.span.to(self.token.span),
1288
- "`enum` and `struct` are mutually exclusive",
1289
- );
+ let span = self.prev_token.span.to(self.token.span);
+ let mut err = self.struct_span_err(span, "`enum` and `struct` are mutually exclusive");
1290
err.span_suggestion(
1291
+ span,
1292
"replace `enum struct` with",
1293
"enum",
1294
Applicability::MachineApplicable,
0 commit comments