Skip to content

Commit 81537ee

Browse files
committed
Auto merge of #9571 - sunjay:fix_deny_warnings_but_not_others, r=alexcrichton
Change how the fix_deny_warnings_but_not_others test works This changes how the `fix_deny_warnings_but_not_others` test works to avoid breakage from a new compiler suggestion that affects rustfix. It should still test the same thing, but through a slightly different mechanism to avoid breaking when new compiler suggestion are added. Relevant PR for rust-lang/rust: rust-lang/rust#83004 Full explanation in this comment: rust-lang/rust#83004 (comment) Please let me know if you have a better suggestion for this fix. I believe [we're trying to land this ASAP because the beta is being cut tomorrow](rust-lang/rust#83004 (comment)), so I will try to get back to any feedback as soon as possible. cc `@pnkfelix`
2 parents c3a16b3 + f68cdb9 commit 81537ee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/testsuite/fix.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,10 @@ fn fix_deny_warnings_but_not_others() {
561561
x
562562
}
563563
564-
fn bar() {}
564+
pub fn bar() {
565+
#[allow(unused_mut)]
566+
let mut _y = 4;
567+
}
565568
",
566569
)
567570
.build();
@@ -570,7 +573,7 @@ fn fix_deny_warnings_but_not_others() {
570573
.env("__CARGO_FIX_YOLO", "1")
571574
.run();
572575
assert!(!p.read_file("src/lib.rs").contains("let mut x = 3;"));
573-
assert!(p.read_file("src/lib.rs").contains("fn bar() {}"));
576+
assert!(p.read_file("src/lib.rs").contains("let mut _y = 4;"));
574577
}
575578

576579
#[cargo_test]

0 commit comments

Comments
 (0)