Skip to content

Commit

Permalink
Auto merge of #9571 - sunjay:fix_deny_warnings_but_not_others, r=alex…
Browse files Browse the repository at this point in the history
…crichton

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`
  • Loading branch information
bors committed Jun 11, 2021
2 parents c3a16b3 + f68cdb9 commit 81537ee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/testsuite/fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,10 @@ fn fix_deny_warnings_but_not_others() {
x
}
fn bar() {}
pub fn bar() {
#[allow(unused_mut)]
let mut _y = 4;
}
",
)
.build();
Expand All @@ -570,7 +573,7 @@ fn fix_deny_warnings_but_not_others() {
.env("__CARGO_FIX_YOLO", "1")
.run();
assert!(!p.read_file("src/lib.rs").contains("let mut x = 3;"));
assert!(p.read_file("src/lib.rs").contains("fn bar() {}"));
assert!(p.read_file("src/lib.rs").contains("let mut _y = 4;"));
}

#[cargo_test]
Expand Down

0 comments on commit 81537ee

Please sign in to comment.