summaryrefslogtreecommitdiffstats
path: root/src/test/ui/binding/match-ref-binding-mut-option.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/binding/match-ref-binding-mut-option.rs')
-rw-r--r--src/test/ui/binding/match-ref-binding-mut-option.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/binding/match-ref-binding-mut-option.rs b/src/test/ui/binding/match-ref-binding-mut-option.rs
new file mode 100644
index 000000000..c25639b72
--- /dev/null
+++ b/src/test/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));
+}