summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-46036.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/nll/issue-46036.rs')
-rw-r--r--tests/ui/nll/issue-46036.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/nll/issue-46036.rs b/tests/ui/nll/issue-46036.rs
new file mode 100644
index 000000000..18af33c18
--- /dev/null
+++ b/tests/ui/nll/issue-46036.rs
@@ -0,0 +1,12 @@
+// Issue 46036: [NLL] false edges on infinite loops
+// Infinite loops should create false edges to the cleanup block.
+
+struct Foo { x: &'static u32 }
+
+fn foo() {
+ let a = 3;
+ let foo = Foo { x: &a }; //~ ERROR E0597
+ loop { }
+}
+
+fn main() { }