Skip to content

Commit 0ec6443

Browse files
authored
fix: #[no_mangle] error in Rust 2024 Edition (#2447)
1 parent 94d5bbb commit 0ec6443

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

uniffi_bindgen/src/scaffolding/templates/Checksums.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{%- for (name, checksum) in ci.iter_checksums() %}
2-
#[no_mangle]
2+
#[unsafe(no_mangle)]
33
#[doc(hidden)]
44
pub extern "C" fn r#{{ name }}() -> u16 {
55
{{ checksum }}

uniffi_bindgen/src/scaffolding/templates/ReexportUniFFIScaffolding.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub const fn uniffi_reexport_hack() {}
2020
macro_rules! uniffi_reexport_scaffolding {
2121
() => {
2222
#[doc(hidden)]
23-
#[no_mangle]
23+
#[unsafe(no_mangle)]
2424
pub extern "C" fn {{ ci.namespace() }}_uniffi_reexport_hack() {
2525
$crate::uniffi_reexport_hack()
2626
}

uniffi_bindgen/src/scaffolding/templates/UdlMetadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ const {{ const_udl_var }}: ::uniffi::MetadataBuffer = ::uniffi::MetadataBuffer::
99
.concat_str("{{ udl_base_name }}");
1010

1111
#[doc(hidden)]
12-
#[no_mangle]
12+
#[unsafe(no_mangle)]
1313
pub static {{ static_udl_var }}: [u8; {{ const_udl_var }}.size] = {{ const_udl_var }}.into_array();

0 commit comments

Comments
 (0)