Sign in
fuchsia
/
third_party
/
rust
/
346aec9b02f3c74f3fce97fd6bda24709d220e49
/
.
/
src
/
test
/
ui
/
functions-closures
/
closure-expected-type
/
supply-nothing.rs
blob: 8665cfc21a765d1f64aaa3b02986bfdeb87326c8 [
file
] [
log
] [
blame
]
// run-pass
fn
with_closure
<
F
>(
f
:
F
)
->
u32
where F
:
FnOnce
(&
u32
,
&
u32
)
->
u32
{
f
(&
22
,
&
44
)
}
fn
main
()
{
let
z
=
with_closure
(|
x
,
y
|
x
+
y
).
wrapping_add
(
1
);
assert_eq
!(
z
,
22
+
44
+
1
);
}