]> git.lizzy.rs Git - rust.git/blob - tests/ui/binding/borrowed-ptr-pattern-2.rs
Rollup merge of #106805 - madsravn:master, r=compiler-errors
[rust.git] / tests / ui / binding / borrowed-ptr-pattern-2.rs
1 // run-pass
2
3 fn foo(s: &String) -> bool {
4     match &**s {
5         "kitty" => true,
6         _ => false
7     }
8 }
9
10 pub fn main() {
11     assert!(foo(&"kitty".to_string()));
12     assert!(!foo(&"gata".to_string()));
13 }