]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/collapsible_match.rs
Move MSRV tests into the lint specific test files
[rust.git] / tests / ui / collapsible_match.rs
index 603ae7dc9eb117308cdfa37116187803750c4927..1d7a72846419f48bc3c60990672dc3471a52886b 100644 (file)
@@ -1,9 +1,10 @@
 #![warn(clippy::collapsible_match)]
 #![allow(
+    clippy::equatable_if_let,
     clippy::needless_return,
     clippy::no_effect,
     clippy::single_match,
-    clippy::equatable_if_let
+    clippy::uninlined_format_args
 )]
 
 fn lint_cases(opt_opt: Option<Option<u32>>, res_opt: Result<Option<u32>, String>) {
@@ -252,6 +253,27 @@ enum E<T> {
     };
 }
 
+pub enum Issue9647 {
+    A { a: Option<Option<u8>>, b: () },
+    B,
+}
+
+pub fn test_1(x: Issue9647) {
+    if let Issue9647::A { a, .. } = x {
+        if let Some(u) = a {
+            println!("{u:?}")
+        }
+    }
+}
+
+pub fn test_2(x: Issue9647) {
+    if let Issue9647::A { a: Some(a), .. } = x {
+        if let Some(u) = a {
+            println!("{u}")
+        }
+    }
+}
+
 fn make<T>() -> T {
     unimplemented!()
 }