Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
closures
/
old-closure-arg-call-as.rs
blob: 23def1c990e126cec69dd1960f9d56347197c7e2 [
file
] [
log
] [
blame
] [
edit
]
//@ run-pass
#![
allow
(
non_snake_case
)]
fn
asBlock
<
F
>(
f
:
F
)
->
usize where F
:
FnOnce
()
->
usize
{
return
f
();
}
pub
fn
main
()
{
let
x
=
asBlock
(||
22
);
assert_eq
!(
x
,
22
);
}