fix a couple rust 2024 lints introduced in rust 1.82.0
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
e0446181c5
commit
76a5a67b6f
5 changed files with 70 additions and 70 deletions
|
@ -59,7 +59,7 @@ pub fn memory_stats() -> Option<String> {
|
|||
Some(format!("<pre><code>{str}</code></pre>"))
|
||||
}
|
||||
|
||||
extern "C" fn malloc_stats_cb(opaque: *mut c_void, msg: *const c_char) {
|
||||
unsafe extern "C" fn malloc_stats_cb(opaque: *mut c_void, msg: *const c_char) {
|
||||
// SAFETY: we have to trust the opaque points to our String
|
||||
let res: &mut String = unsafe { opaque.cast::<String>().as_mut().unwrap() };
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@ macro_rules! mod_dtor {
|
|||
macro_rules! mod_init {
|
||||
($body:block) => {
|
||||
#[used]
|
||||
#[cfg_attr(target_family = "unix", link_section = ".init_array")]
|
||||
static MOD_INIT: extern "C" fn() = { _mod_init };
|
||||
#[cfg_attr(target_family = "unix", unsafe(link_section = ".init_array"))]
|
||||
static MOD_INIT: unsafe extern "C" fn() = { _mod_init };
|
||||
|
||||
#[cfg_attr(target_family = "unix", link_section = ".text.startup")]
|
||||
extern "C" fn _mod_init() -> () $body
|
||||
#[cfg_attr(target_family = "unix", unsafe(link_section = ".text.startup"))]
|
||||
unsafe extern "C" fn _mod_init() -> () $body
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -35,10 +35,10 @@ macro_rules! mod_init {
|
|||
macro_rules! mod_fini {
|
||||
($body:block) => {
|
||||
#[used]
|
||||
#[cfg_attr(target_family = "unix", link_section = ".fini_array")]
|
||||
static MOD_FINI: extern "C" fn() = { _mod_fini };
|
||||
#[cfg_attr(target_family = "unix", unsafe(link_section = ".fini_array"))]
|
||||
static MOD_FINI: unsafe extern "C" fn() = { _mod_fini };
|
||||
|
||||
#[cfg_attr(target_family = "unix", link_section = ".text.startup")]
|
||||
extern "C" fn _mod_fini() -> () $body
|
||||
#[cfg_attr(target_family = "unix", unsafe(link_section = ".text.startup"))]
|
||||
unsafe extern "C" fn _mod_fini() -> () $body
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue