about summary refs log tree commit diff
path: root/tests/ui/binding/match-ref-binding-mut-option.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/match-ref-binding-mut-option.rs')
-rw-r--r--tests/ui/binding/match-ref-binding-mut-option.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/binding/match-ref-binding-mut-option.rs b/tests/ui/binding/match-ref-binding-mut-option.rs
new file mode 100644
index 00000000000..c25639b7213
--- /dev/null
+++ b/tests/ui/binding/match-ref-binding-mut-option.rs
@@ -0,0 +1,10 @@
+// run-pass
+
+pub fn main() {
+    let mut v = Some(22);
+    match v {
+      None => {}
+      Some(ref mut p) => { *p += 1; }
+    }
+    assert_eq!(v, Some(23));
+}