Skip to content

Commit

Permalink
Change tests to support changes to suggestion
Browse files Browse the repository at this point in the history
`rustc` will start marking the suggestions for prefacing unused bindings
with underscores as "maybe incorrect", which makes them no longer auto
applicable by `rustfix`.

Change done at rust-lang/rust#120470.
  • Loading branch information
estebank committed Feb 1, 2024
1 parent aa18926 commit 88bafd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/testsuite/fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,7 @@ fn fix_shared_cross_workspace() {
// [FIXED] bar/src/../../foo/src/shared.rs (2 fixes)
// [FIXED] foo/src/shared.rs (2 fixes)
p.cargo("fix --allow-no-vcs")
.env("__CARGO_FIX_YOLO", "1")
.with_stderr_unordered(
"\
[CHECKING] foo v0.1.0 [..]
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn deduplicate_messages_basic() {
let rustc_message = raw_rustc_output(&p, "src/lib.rs", &[]);
let expected_output = format!(
"{}\
warning: `foo` (lib) generated 1 warning (run `cargo fix --lib -p foo` to apply 1 suggestion)
warning: `foo` (lib) generated 1 warning[..]
warning: `foo` (lib test) generated 1 warning (1 duplicate)
[FINISHED] [..]
[EXECUTABLE] unittests src/lib.rs (target/debug/deps/foo-[..][EXE])
Expand Down Expand Up @@ -103,7 +103,7 @@ fn deduplicate_messages_mismatched_warnings() {
let expected_output = format!(
"\
{}\
warning: `foo` (lib) generated 1 warning (run `cargo fix --lib -p foo` to apply 1 suggestion)
warning: `foo` (lib) generated 1 warning[..]
{}\
warning: `foo` (lib test) generated 2 warnings (1 duplicate)
[FINISHED] [..]
Expand Down

0 comments on commit 88bafd1

Please sign in to comment.