fix a couple rust 2024 lints introduced in rust 1.82.0

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-12-12 10:22:30 -05:00
parent e0446181c5
commit 76a5a67b6f
No known key found for this signature in database
5 changed files with 70 additions and 70 deletions

View file

@ -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() };

View file

@ -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
};
}

View file

@ -1,6 +1,6 @@
#![cfg(conduit_mods)]
#[no_link]
#[unsafe(no_link)]
extern crate conduit_service;
use std::{

View file

@ -16,7 +16,7 @@ conduit::mod_ctor! {}
conduit::mod_dtor! {}
conduit::rustc_flags_capture! {}
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "Rust" fn start(server: &Arc<Server>) -> Pin<Box<dyn Future<Output = Result<Arc<Services>>> + Send>> {
AssertUnwindSafe(run::start(server.clone()))
.catch_unwind()
@ -25,7 +25,7 @@ pub extern "Rust" fn start(server: &Arc<Server>) -> Pin<Box<dyn Future<Output =
.boxed()
}
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "Rust" fn stop(services: Arc<Services>) -> Pin<Box<dyn Future<Output = Result<()>> + Send>> {
AssertUnwindSafe(run::stop(services))
.catch_unwind()
@ -34,7 +34,7 @@ pub extern "Rust" fn stop(services: Arc<Services>) -> Pin<Box<dyn Future<Output
.boxed()
}
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "Rust" fn run(services: &Arc<Services>) -> Pin<Box<dyn Future<Output = Result<()>> + Send>> {
AssertUnwindSafe(run::run(services.clone()))
.catch_unwind()