Debian Codegraph @

gcc/testsuite/rust/execute/torture/closure1.rs

raw
1 #[lang = "sized"]
2 pub trait Sized {}
3
4 extern "C" {
5 fn printf(s: *const i8, ...);
6 }
7
8 #[lang = "fn_once"]
9 pub trait FnOnce<Args> {
10 #[lang = "fn_once_output"]
11 type Output;
12
13 extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
14 }
15
16 fn main() -> i32 {
17 let closure_annotated = |i: i32| -> i32 { i + 1 };
18
19 let i = 1;
20 closure_annotated(i) - 2
21 }