Skip to content

Commit

Permalink
Removing one suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
kper committed Oct 15, 2022
1 parent 1d970c3 commit 8fbd19d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_parse/src/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1320,16 +1320,15 @@ impl<'a> Parser<'a> {
IsStandalone::Maybe => {
let Ok(base_src) = self.span_to_snippet(base.span)
else { return help_base_case(err, base) };
let sugg1 = match kind.fixity {
let sugg = match kind.fixity {
UnaryFixity::Pre => self.prefix_inc_dec_suggest(base_src, kind, spans),
UnaryFixity::Post => self.postfix_inc_dec_suggest(base_src, kind, spans),
};
let sugg2 = self.inc_dec_standalone_suggest(kind, spans);
MultiSugg::emit_many(
&mut err,
"use `+= 1` instead",
Applicability::Unspecified,
[sugg1, sugg2].into_iter(),
[sugg].into_iter(),
)
}
}
Expand Down

0 comments on commit 8fbd19d

Please sign in to comment.