Debian Codegraph @

gcc/testsuite/rust/compile/v0-mangle2.rs

raw
1 // { dg-additional-options -frust-mangling=v0 }
2 #[lang = "sized"]
3 pub trait Sized {}
4
5 #[lang = "fn_once"]
6 pub trait FnOnce<Args> {
7 #[lang = "fn_once_output"]
8 type Output;
9
10 extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
11 }
12
13 fn main() {
14 // { dg-final { scan-assembler "_R.*NC.*NvC.*10v0_mangle24main.*0" } }
15 let closure_annotated = |i: i32| -> i32 { i + 1 };
16 let _ = closure_annotated(0) - 1;
17 }