summaryrefslogtreecommitdiffstats
path: root/src/test/ui/binding/borrowed-ptr-pattern-2.rs
blob: 40df85b1479b4dfa40313c6c0940494354d55ddc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// run-pass

fn foo(s: &String) -> bool {
    match &**s {
        "kitty" => true,
        _ => false
    }
}

pub fn main() {
    assert!(foo(&"kitty".to_string()));
    assert!(!foo(&"gata".to_string()));
}