summaryrefslogtreecommitdiffstats
path: root/tests/ui/binding/match-ref-unsized.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/match-ref-unsized.rs')
-rw-r--r--tests/ui/binding/match-ref-unsized.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/binding/match-ref-unsized.rs b/tests/ui/binding/match-ref-unsized.rs
new file mode 100644
index 000000000..53784ebb9
--- /dev/null
+++ b/tests/ui/binding/match-ref-unsized.rs
@@ -0,0 +1,11 @@
+// run-pass
+// Binding unsized expressions to ref patterns
+
+pub fn main() {
+ let ref a = *"abcdef";
+ assert_eq!(a, "abcdef");
+
+ match *"12345" {
+ ref b => { assert_eq!(b, "12345") }
+ }
+}