3 #![feature(const_result)]
4 #![warn(clippy::redundant_pattern_matching)]
5 #![allow(clippy::match_like_matches_macro, unused)]
7 // Test that results are linted with the feature enabled.
9 const fn issue_5697() {
10 if Ok::<i32, i32>(42).is_ok() {}
12 if Err::<i32, i32>(42).is_err() {}
14 while Ok::<i32, i32>(10).is_ok() {}
16 while Ok::<i32, i32>(10).is_err() {}
18 Ok::<i32, i32>(42).is_ok();
20 Err::<i32, i32>(42).is_err();
22 // These should not be linted until `const_option` is implemented.
23 // See https://github.com/rust-lang/rust/issues/67441
25 if let Some(_) = Some(42) {}
27 if let None = None::<()> {}
29 while let Some(_) = Some(42) {}
31 while let None = None::<()> {}