summaryrefslogtreecommitdiffstats
path: root/src/test/ui/binding/match-ref-binding.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/binding/match-ref-binding.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/binding/match-ref-binding.rs b/src/test/ui/binding/match-ref-binding.rs
new file mode 100644
index 000000000..ac6a07eab
--- /dev/null
+++ b/src/test/ui/binding/match-ref-binding.rs
@@ -0,0 +1,12 @@
+// run-pass
+
+fn destructure(x: Option<isize>) -> isize {
+ match x {
+ None => 0,
+ Some(ref v) => *v
+ }
+}
+
+pub fn main() {
+ assert_eq!(destructure(Some(22)), 22);
+}