]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/borrowed-ptr-pattern.rs
Merge commit 'b20d4c155d2fe3a8391f86dcf9a8c49e17188703' into clippyup
[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 }