Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
binding
/
borrowed-ptr-pattern.rs
blob: 0cdd2754e130cb55839063d6598adbde17a2296c [
file
] [
log
] [
blame
] [
edit
]
//@ 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'
);
}