Debian Codegraph @

third_party/rust/diplomat/src/snapshots/diplomat__tests__cfgd_struct.snap

raw
1 ---
2 source: macro/src/lib.rs
3 expression: "rustfmt_code(&gen_bridge(parse_quote! {\n mod ffi\n {\n #[diplomat :: opaque] #[cfg(feature = \"foo\")] struct Foo {}\n #[cfg(feature = \"foo\")] impl Foo\n { pub fn bar(s : u8) { unimplemented! () } }\n }\n }).to_token_stream().to_string())"
4 ---
5 mod ffi {
6 #[cfg(feature = "foo")]
7 struct Foo {}
8 #[cfg(feature = "foo")]
9 impl Foo {
10 pub fn bar(s: u8) {
11 unimplemented!()
12 }
13 }
14 use diplomat_runtime::*;
15 #[no_mangle]
16 #[cfg(feature = "foo")]
17 extern "C" fn Foo_bar(s: u8) {
18 Foo::bar(s)
19 }
20 #[no_mangle]
21 #[cfg(feature = "foo")]
22 extern "C" fn Foo_destroy(this: Box<Foo>) {}
23 }
24