Sign in
fuchsia
/
third_party
/
rust
/
9d09331e00b02f81c714b0c41ce3a38380dd36a2
/
.
/
src
/
test
/
ui
/
regions
/
regions-infer-call-2.rs
blob: a288d2e4d6e01ee735f20879c285dbdab96dd1fa [
file
] [
log
] [
blame
]
// run-pass
fn
takes_two
(
x
:
&
isize
,
y
:
&
isize
)
->
isize
{
*
x
+
*
y
}
fn
with
<
T
,
F
>(
f
:
F
)
->
T where F
:
FnOnce
(&
isize
)
->
T
{
f
(&
20
)
}
fn
has_one
<
'a>(x: &'
a isize
)
->
isize
{
with
(|
y
|
takes_two
(
x
,
y
))
}
pub
fn
main
()
{
assert_eq
!(
has_one
(&
2
),
22
);
}