3 #![feature(const_if_match)]
4 #![feature(const_loop)]
5 #![feature(const_result)]
6 #![warn(clippy::redundant_pattern_matching)]
9 // Test that results are linted with the feature enabled.
11 const fn issue_5697() {
12 if let Ok(_) = Ok::<i32, i32>(42) {}
14 if let Err(_) = Err::<i32, i32>(42) {}
16 while let Ok(_) = Ok::<i32, i32>(10) {}
18 while let Err(_) = Ok::<i32, i32>(10) {}
20 match Ok::<i32, i32>(42) {
25 match Err::<i32, i32>(42) {
30 // These should not be linted until `const_option` is implemented.
31 // See https://github.com/rust-lang/rust/issues/67441
33 if let Some(_) = Some(42) {}
35 if let None = None::<()> {}
37 while let Some(_) = Some(42) {}
39 while let None = None::<()> {}