]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/unnested_or_patterns.fixed
New upstream version 1.62.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / unnested_or_patterns.fixed
index 46463a29e9b20deec853a9a7fab3293cad5017d5..c223b5bc711b2a83956542e652457132f8136fd6 100644 (file)
@@ -6,10 +6,13 @@
 #![allow(unreachable_patterns, irrefutable_let_patterns, unused_variables)]
 
 fn main() {
+    // Should be ignored by this lint, as nesting requires more characters.
+    if let &0 | &2 = &0 {}
+
     if let box (0 | 2) = Box::new(0) {}
     if let box (0 | 1 | 2 | 3 | 4) = Box::new(0) {}
-    const C0: &u8 = &1;
-    if let &(0 | 2) | C0 = &0 {}
+    const C0: Option<u8> = Some(1);
+    if let Some(1 | 2) | C0 = None {}
     if let &mut (0 | 2) = &mut 0 {}
     if let x @ (0 | 2) = 0 {}
     if let (0, 1 | 2 | 3) = (0, 0) {}