diff options
Diffstat (limited to 'tests/ui/binding/match-ref-binding-mut-option.rs')
-rw-r--r-- | tests/ui/binding/match-ref-binding-mut-option.rs | 10 |
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 000000000..c25639b72 --- /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)); +} |