summaryrefslogtreecommitdiffstats
path: root/tests/ui/binding/borrowed-ptr-pattern-3.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/borrowed-ptr-pattern-3.rs')
-rw-r--r--tests/ui/binding/borrowed-ptr-pattern-3.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/binding/borrowed-ptr-pattern-3.rs b/tests/ui/binding/borrowed-ptr-pattern-3.rs
new file mode 100644
index 000000000..f2607eee8
--- /dev/null
+++ b/tests/ui/binding/borrowed-ptr-pattern-3.rs
@@ -0,0 +1,13 @@
+// run-pass
+
+fn foo<'r>(s: &'r usize) -> bool {
+ match s {
+ &3 => true,
+ _ => false
+ }
+}
+
+pub fn main() {
+ assert!(foo(&3));
+ assert!(!foo(&4));
+}