]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/2229_closure_analysis/issue-88118-2.rs
Merge commit '1480cea393d0cee195e59949eabdfbcf1230f7f9' into clippyup
[rust.git] / tests / ui / closures / 2229_closure_analysis / issue-88118-2.rs
1 // edition:2021
2 // run-pass
3 #![feature(if_let_guard)]
4 #[allow(unused_must_use)]
5 #[allow(dead_code)]
6
7 fn print_error_count(registry: &Registry) {
8     |x: &Registry| {
9         match &x {
10             Registry if let _ = registry.try_find_description() => { }
11             //~^ WARNING: irrefutable `if let` guard pattern
12             _ => {}
13         }
14     };
15 }
16
17 struct Registry;
18 impl Registry {
19     pub fn try_find_description(&self) {
20         unimplemented!()
21     }
22 }
23
24 fn main() {}