summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/issue-92015.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrowck/issue-92015.rs')
-rw-r--r--tests/ui/borrowck/issue-92015.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/borrowck/issue-92015.rs b/tests/ui/borrowck/issue-92015.rs
new file mode 100644
index 000000000..16d651717
--- /dev/null
+++ b/tests/ui/borrowck/issue-92015.rs
@@ -0,0 +1,7 @@
+// Regression test for #92105.
+// ICE when mutating immutable reference from last statement of a block.
+
+fn main() {
+ let foo = Some(&0).unwrap();
+ *foo = 1; //~ ERROR cannot assign
+}