Sign in
fuchsia
/
third_party
/
rust
/
f233a4c18bec906dab0b8531f326a15fadece547
/
.
/
src
/
test
/
ui
/
binding
/
borrowed-ptr-pattern.rs
blob: d5f94ab54e30f6ec2f78629f63c4893524dff797 [
file
] [
log
] [
blame
]
// run-pass
fn
foo
<
T
:
Clone
>(
x
:
&
T
)
->
T
{
match
x
{
&
ref
a
=>
(*
a
).
clone
()
}
}
pub
fn
main
()
{
assert_eq
!(
foo
(&
3
),
3
);
assert_eq
!(
foo
(&
'a'
),
'a'
);
}