summaryrefslogtreecommitdiffstats
path: root/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.rs')
-rw-r--r--src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.rs b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.rs
new file mode 100644
index 000000000..08911c5bd
--- /dev/null
+++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.rs
@@ -0,0 +1,12 @@
+fn test() {
+ let v: isize;
+ //~^ HELP consider making this binding mutable
+ //~| SUGGESTION mut v
+ loop {
+ v = 1; //~ ERROR cannot assign twice to immutable variable `v`
+ //~| NOTE cannot assign twice to immutable variable
+ }
+}
+
+fn main() {
+}