summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/borrowck-assign-to-constants.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/borrowck/borrowck-assign-to-constants.rs')
-rw-r--r--src/test/ui/borrowck/borrowck-assign-to-constants.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/ui/borrowck/borrowck-assign-to-constants.rs b/src/test/ui/borrowck/borrowck-assign-to-constants.rs
new file mode 100644
index 000000000..5881dccf6
--- /dev/null
+++ b/src/test/ui/borrowck/borrowck-assign-to-constants.rs
@@ -0,0 +1,6 @@
+static foo: isize = 5;
+
+fn main() {
+ // assigning to various global constants
+ foo = 6; //~ ERROR cannot assign to immutable static item `foo`
+}