]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/borrowed-ptr-pattern.rs
Auto merge of #104730 - petrochenkov:modchild5, r=cjgillot
[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 }