summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-29071.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-29071.rs')
-rw-r--r--tests/ui/issues/issue-29071.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-29071.rs b/tests/ui/issues/issue-29071.rs
new file mode 100644
index 000000000..8bdacf2ce
--- /dev/null
+++ b/tests/ui/issues/issue-29071.rs
@@ -0,0 +1,16 @@
+// check-pass
+#![allow(dead_code)]
+#![allow(non_upper_case_globals)]
+
+fn ret() -> u32 {
+ static x: u32 = 10;
+ x & if true { 10u32 } else { 20u32 } & x
+}
+
+fn ret2() -> &'static u32 {
+ static x: u32 = 10;
+ if true { 10u32; } else { 20u32; }
+ &x
+}
+
+fn main() {}