Fix rustfix panic on test

`run-rustfix` applies all suggestions regardless of their Applicability.
There's a flag, `rustfix-only-machine-applicable`, that does what it
says, but then the produced `.fixed` file would have invalid code from
the suggestions that weren't applied. So, I moved the cases of postfix
increment, in which case multiple suggestions are given, to the
`-notfixed` test, which does not run rustfix.

I also changed the Applicability to Unspecified since MaybeIncorrect
requires that the code be valid, even if it's incorrect.
This commit is contained in:
Noah Lev 2022-03-23 17:26:59 -07:00
parent 725cde42d5
commit 86220d6e51
6 changed files with 144 additions and 123 deletions

View file

@ -1326,7 +1326,7 @@ impl<'a> Parser<'a> {
MultiSugg::emit_many(
&mut err,
"use `+= 1` instead",
Applicability::MaybeIncorrect,
Applicability::Unspecified,
[sugg1, sugg2].into_iter(),
)
}