Skip to content

Commit 930b4f6

Browse files
authored
Use a different lint for the fix_only_once_for_duplicates test (#15713)
### What does this PR try to resolve? This PR changes the triggering `rustc` lint in the `fix_only_once_for_duplicates` test from `unused_must_use` to `forgetting_references`, because we are changing in rust-lang/rust#143030 the interaction between that lint and macros. This is required as it blocking the rust PR, rust-lang/rust#143030 (comment). ### How to test and review this PR? Look at the test changes.
2 parents 37ac0c2 + c5fee7d commit 930b4f6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/testsuite/fix.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,7 +2410,8 @@ fn fix_only_once_for_duplicates() {
24102410
r#"
24112411
macro_rules! foo {
24122412
() => {
2413-
&1;
2413+
let x = Box::new(1);
2414+
std::mem::forget(&x);
24142415
};
24152416
}
24162417
@@ -2438,7 +2439,8 @@ fn main() {
24382439
24392440
macro_rules! foo {
24402441
() => {
2441-
let _ = &1;
2442+
let x = Box::new(1);
2443+
let _ = &x;
24422444
};
24432445
}
24442446

0 commit comments

Comments
 (0)