summaryrefslogtreecommitdiffstats
path: root/tests/ui/deref-patterns/refs.rs
blob: 97e260d2752bb6eacd0b6506afba41a924c3d13f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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() {}