about summary refs log tree commit diff
path: root/tests/ui/branches_sharing_code/shared_at_bottom.rs
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2025-06-13 10:17:14 +0200
committerPhilipp Krones <hello@philkrones.com>2025-06-13 10:17:14 +0200
commit85655d4a098be06080e4ec20360a5eb7feab3e3f (patch)
treeac84391c2d14214eff463de30e5eaf55656b9fc7 /tests/ui/branches_sharing_code/shared_at_bottom.rs
parent507183d438e615dcc24eb488a6622b5591801058 (diff)
parent6d7c16a3d6301c6a07b2aad768e2e4113b9d5f8f (diff)
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'tests/ui/branches_sharing_code/shared_at_bottom.rs')
-rw-r--r--tests/ui/branches_sharing_code/shared_at_bottom.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/ui/branches_sharing_code/shared_at_bottom.rs b/tests/ui/branches_sharing_code/shared_at_bottom.rs
index 06472a4f5d5..922d30443fc 100644
--- a/tests/ui/branches_sharing_code/shared_at_bottom.rs
+++ b/tests/ui/branches_sharing_code/shared_at_bottom.rs
@@ -239,3 +239,40 @@ fn fp_if_let_issue7054() {
 }
 
 fn main() {}
+
+mod issue14873 {
+    fn foo() -> i32 {
+        todo!()
+    }
+
+    macro_rules! qux {
+        ($a:ident, $b:ident, $condition:expr) => {
+            if $condition {
+                "."
+            } else {
+                ""
+            };
+            $a = foo();
+            $b = foo();
+        };
+    }
+
+    fn share_on_bottom() {
+        let mut a = 0;
+        let mut b = 0;
+        if false {
+            qux!(a, b, a == b);
+        } else {
+            qux!(a, b, a != b);
+        };
+
+        if false {
+            qux!(a, b, a == b);
+            let y = 1;
+        } else {
+            qux!(a, b, a != b);
+            let y = 1;
+            //~^ branches_sharing_code
+        }
+    }
+}