diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/deref-patterns/refs.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/deref-patterns/refs.rs b/src/test/ui/deref-patterns/refs.rs new file mode 100644 index 000000000..97e260d27 --- /dev/null +++ b/src/test/ui/deref-patterns/refs.rs @@ -0,0 +1,18 @@ +// check-pass +#![feature(string_deref_patterns)] + +fn foo(s: &String) -> i32 { + match *s { + "a" => 42, + _ => -1, + } +} + +fn bar(s: Option<&&&&String>) -> i32 { + match s { + Some(&&&&"&&&&") => 1, + _ => -1, + } +} + +fn main() {} |