]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/match_wild_err_arm.rs
New upstream version 1.74.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / match_wild_err_arm.rs
index 5a552e4ae51a5419904f9ee76fbd9621278bb548..7bdd75d7f46396480596c50283877c19653b1cd3 100644 (file)
@@ -22,18 +22,24 @@ fn match_wild_err_arm() {
         Ok(3) => println!("ok"),
         Ok(_) => println!("ok"),
         Err(_) => panic!("err"),
+        //~^ ERROR: `Err(_)` matches all errors
+        //~| NOTE: match each error separately or use the error output, or use `.expect(ms
     }
 
     match x {
         Ok(3) => println!("ok"),
         Ok(_) => println!("ok"),
         Err(_) => panic!(),
+        //~^ ERROR: `Err(_)` matches all errors
+        //~| NOTE: match each error separately or use the error output, or use `.expect(ms
     }
 
     match x {
         Ok(3) => println!("ok"),
         Ok(_) => println!("ok"),
         Err(_) => {
+            //~^ ERROR: `Err(_)` matches all errors
+            //~| NOTE: match each error separately or use the error output, or use `.expect(ms
             panic!();
         },
     }
@@ -42,6 +48,8 @@ fn match_wild_err_arm() {
         Ok(3) => println!("ok"),
         Ok(_) => println!("ok"),
         Err(_e) => panic!(),
+        //~^ ERROR: `Err(_e)` matches all errors
+        //~| NOTE: match each error separately or use the error output, or use `.expect(ms
     }
 
     // Allowed when used in `panic!`.