]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/borrowed-ptr-pattern.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / binding / borrowed-ptr-pattern.rs
1 // run-pass
2
3 fn foo<T:Clone>(x: &T) -> T{
4     match x {
5         &ref a => (*a).clone()
6     }
7 }
8
9 pub fn main() {
10     assert_eq!(foo(&3), 3);
11     assert_eq!(foo(&'a'), 'a');
12 }