diff --git a/tests/ui/manual_filter.fixed b/tests/ui/manual_filter.fixed index b986dd5e2..ef6780dc9 100644 --- a/tests/ui/manual_filter.fixed +++ b/tests/ui/manual_filter.fixed @@ -139,6 +139,20 @@ fn main() { } else { None }; + + let allowed_integers = vec![3, 4, 5, 6]; + // Don't lint, since there's a side effect in the else branch + match Some(21) { + Some(x) => { + if allowed_integers.contains(&x) { + Some(x) + } else { + println!("Invalid integer: {x:?}"); + None + } + }, + None => None, + }; } fn maybe_some() -> Option { diff --git a/tests/ui/manual_filter.rs b/tests/ui/manual_filter.rs index 1e786b902..ea0ce8317 100644 --- a/tests/ui/manual_filter.rs +++ b/tests/ui/manual_filter.rs @@ -263,6 +263,20 @@ fn main() { } else { None }; + + let allowed_integers = vec![3, 4, 5, 6]; + // Don't lint, since there's a side effect in the else branch + match Some(21) { + Some(x) => { + if allowed_integers.contains(&x) { + Some(x) + } else { + println!("Invalid integer: {x:?}"); + None + } + }, + None => None, + }; } fn maybe_some() -> Option {