about summary refs log tree commit diff
path: root/compiler/rustc_parse
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2022-03-23 17:26:59 -0700
committerNoah Lev <camelidcamel@gmail.com>2022-03-23 22:31:57 -0700
commit86220d6e517225d13c145fd12acfc96f78358170 (patch)
treee8d5f4bcb5f800c7a654d5270bf543b8888b2bad /compiler/rustc_parse
parent725cde42d5673d1957ad58c6b2fada28a6a4edbd (diff)
downloadrust-86220d6e517225d13c145fd12acfc96f78358170.tar.gz
rust-86220d6e517225d13c145fd12acfc96f78358170.zip
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.
Diffstat (limited to 'compiler/rustc_parse')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 0e0954d6ee2..bab4ac9d08a 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -1326,7 +1326,7 @@ impl<'a> Parser<'a> {
                 MultiSugg::emit_many(
                     &mut err,
                     "use `+= 1` instead",
-                    Applicability::MaybeIncorrect,
+                    Applicability::Unspecified,
                     [sugg1, sugg2].into_iter(),
                 )
             }