summaryrefslogtreecommitdiffstats
path: root/src/test/ui/closures/issue-80313-mutation-in-closure.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/closures/issue-80313-mutation-in-closure.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/ui/closures/issue-80313-mutation-in-closure.rs b/src/test/ui/closures/issue-80313-mutation-in-closure.rs
new file mode 100644
index 000000000..e082ea562
--- /dev/null
+++ b/src/test/ui/closures/issue-80313-mutation-in-closure.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let mut my_var = false;
+ let callback = || {
+ my_var = true;
+ };
+ callback(); //~ ERROR E0596
+}