]> git.lizzy.rs Git - rust.git/commitdiff
Add a bathroom stall to weird expressions test
authorThom Chiovoloni <chiovolonit@gmail.com>
Sat, 30 Apr 2022 03:25:02 +0000 (20:25 -0700)
committerThom Chiovoloni <chiovolonit@gmail.com>
Sat, 30 Apr 2022 03:26:21 +0000 (20:26 -0700)
src/test/ui/weird-exprs.rs

index a02b3230689e8d2f25460b932e941f4a258bed82..42acd30a0ff6a5caf5d784dd275c4e6c251809c0 100644 (file)
@@ -164,6 +164,12 @@ fn monkey_barrel() {
     assert_eq!(val, ());
 }
 
+fn bathroom_stall() {
+    let mut i = 1;
+    matches!(2, _|_|_|_|_|_ if (i+=1) != (i+=1));
+    assert_eq!(i, 13);
+}
+
 pub fn main() {
     strange();
     funny();
@@ -183,4 +189,5 @@ pub fn main() {
     i_yield();
     match_nested_if();
     monkey_barrel();
+    bathroom_stall();
 }