Debian Codegraph @

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

raw
1 ---
2 source: macro/src/lib.rs
3 expression: "rustfmt_code(&gen_bridge(parse_quote! {\n mod ffi\n {\n struct Foo {} impl Foo\n { pub fn fill_slice(s : & mut [f64]) { unimplemented! () } }\n }\n }).to_token_stream().to_string())"
4 ---
5 mod ffi {
6 #[repr(C)]
7 #[derive(Clone, Copy)]
8 struct Foo {}
9 impl Foo {
10 pub fn fill_slice(s: &mut [f64]) {
11 unimplemented!()
12 }
13 }
14 use diplomat_runtime::*;
15 #[no_mangle]
16 extern "C" fn Foo_fill_slice(s_diplomat_data: *mut f64, s_diplomat_len: usize) {
17 Foo::fill_slice(if s_diplomat_len == 0 {
18 &mut []
19 } else {
20 unsafe { core::slice::from_raw_parts_mut(s_diplomat_data, s_diplomat_len) }
21 })
22 }
23 #[no_mangle]
24 extern "C" fn Foo_destroy(this: Box<Foo>) {}
25 }
26