about summary refs log tree commit diff
path: root/tests/ui/borrowck/borrowck-binding-mutbl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrowck/borrowck-binding-mutbl.rs')
-rw-r--r--tests/ui/borrowck/borrowck-binding-mutbl.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/borrowck/borrowck-binding-mutbl.rs b/tests/ui/borrowck/borrowck-binding-mutbl.rs
new file mode 100644
index 00000000000..c2d2e02ec15
--- /dev/null
+++ b/tests/ui/borrowck/borrowck-binding-mutbl.rs
@@ -0,0 +1,16 @@
+// run-pass
+
+struct F { f: Vec<isize> }
+
+fn impure(_v: &[isize]) {
+}
+
+pub fn main() {
+    let mut x = F {f: vec![3]};
+
+    match x {
+      F {f: ref mut v} => {
+        impure(v);
+      }
+    }
+}