From 5b527d81360014dca5c4cc705c1b979f460de7e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Thu, 1 Feb 2024 03:47:27 +0000 Subject: [PATCH] Change tests to support changes to suggestion `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 https://github.com/rust-lang/rust/pull/120470. --- tests/testsuite/fix.rs | 1 + tests/testsuite/messages.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/fix.rs b/tests/testsuite/fix.rs index 87b23b89063..7b1a5d12fc9 100644 --- a/tests/testsuite/fix.rs +++ b/tests/testsuite/fix.rs @@ -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 [..] diff --git a/tests/testsuite/messages.rs b/tests/testsuite/messages.rs index fb92593bccb..604d77d3268 100644 --- a/tests/testsuite/messages.rs +++ b/tests/testsuite/messages.rs @@ -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]) @@ -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] [..]