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