diff --git a/tests/ui/option_if_let_else.fixed b/tests/ui/option_if_let_else.fixed index 44ab8ebb50a..8e59e4375d2 100644 --- a/tests/ui/option_if_let_else.fixed +++ b/tests/ui/option_if_let_else.fixed @@ -198,8 +198,6 @@ fn main() { let _ = res.map_or(1, |a| a + 1); let _ = res.map_or(1, |a| a + 1); let _ = res.map_or(5, |a| a + 1); - issue10729::reproduce(&None); - issue10729::reproduce2(&mut None); } #[allow(dead_code)] @@ -212,7 +210,7 @@ fn issue9742() -> Option<&'static str> { } mod issue10729 { - #![allow(clippy::unit_arg)] + #![allow(clippy::unit_arg, dead_code)] pub fn reproduce(initial: &Option) { // 👇 needs `.as_ref()` because initial is an `&Option<_>` diff --git a/tests/ui/option_if_let_else.rs b/tests/ui/option_if_let_else.rs index 9358c20ab95..e72edf2a8e3 100644 --- a/tests/ui/option_if_let_else.rs +++ b/tests/ui/option_if_let_else.rs @@ -239,8 +239,6 @@ fn main() { Ok(a) => a + 1, }; let _ = if let Ok(a) = res { a + 1 } else { 5 }; - issue10729::reproduce(&None); - issue10729::reproduce2(&mut None); } #[allow(dead_code)] @@ -253,7 +251,7 @@ fn issue9742() -> Option<&'static str> { } mod issue10729 { - #![allow(clippy::unit_arg)] + #![allow(clippy::unit_arg, dead_code)] pub fn reproduce(initial: &Option) { // 👇 needs `.as_ref()` because initial is an `&Option<_>` diff --git a/tests/ui/option_if_let_else.stderr b/tests/ui/option_if_let_else.stderr index fde27f21690..aa2da217400 100644 --- a/tests/ui/option_if_let_else.stderr +++ b/tests/ui/option_if_let_else.stderr @@ -272,7 +272,7 @@ LL | let _ = if let Ok(a) = res { a + 1 } else { 5 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `res.map_or(5, |a| a + 1)` error: use Option::map_or instead of an if let/else - --> $DIR/option_if_let_else.rs:260:9 + --> $DIR/option_if_let_else.rs:258:9 | LL | / match initial { LL | | Some(value) => do_something(value), @@ -281,7 +281,7 @@ LL | | } | |_________^ help: try: `initial.as_ref().map_or({}, |value| do_something(value))` error: use Option::map_or instead of an if let/else - --> $DIR/option_if_let_else.rs:267:9 + --> $DIR/option_if_let_else.rs:265:9 | LL | / match initial { LL | | Some(value) => do_something2(value),