Debian Codegraph @

third_party/rust/diplomat/src/snapshots/diplomat__tests__method_taking_mutable_str.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 {\n pub fn make_uppercase(s : & mut str) { unimplemented! () }\n }\n }\n }).to_token_stream().to_string())"
4 ---
5 mod ffi {
6 #[repr(C)]
7 struct Foo {}
8 impl Foo {
9 pub fn make_uppercase(s: &mut str) {
10 unimplemented!()
11 }
12 }
13 #[no_mangle]
14 extern "C" fn Foo_make_uppercase(s_diplomat_data: *mut u8, s_diplomat_len: usize) {
15 Foo::make_uppercase(unsafe {
16 core::str::from_utf8_mut(core::slice::from_raw_parts_mut(
17 s_diplomat_data,
18 s_diplomat_len,
19 ))
20 .unwrap()
21 })
22 }
23 #[no_mangle]
24 extern "C" fn Foo_destroy(this: Box<Foo>) {}
25 }
26