Skip to content

Commit a1b75b6

Browse files
committed
More edition 2024 preparation
1 parent f4b2326 commit a1b75b6

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed

src/abi.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,15 @@ pub type PersonalityRoutine = unsafe extern "C" fn(
9999
macro_rules! binding {
100100
() => {};
101101
(unsafe extern $abi: literal fn $name: ident ($($arg: ident : $arg_ty: ty),*$(,)?) $(-> $ret: ty)?; $($rest: tt)*) => {
102-
extern $abi {
103-
pub fn $name($($arg: $arg_ty),*) $(-> $ret)?;
102+
unsafe extern $abi {
103+
pub unsafe fn $name($($arg: $arg_ty),*) $(-> $ret)?;
104104
}
105105
binding!($($rest)*);
106106
};
107107

108108
(extern $abi: literal fn $name: ident ($($arg: ident : $arg_ty: ty),*$(,)?) $(-> $ret: ty)?; $($rest: tt)*) => {
109-
#[allow(non_snake_case)]
110-
#[inline]
111-
pub fn $name($($arg: $arg_ty),*) $(-> $ret)? {
112-
extern $abi {
113-
fn $name($($arg: $arg_ty),*) $(-> $ret)?;
114-
}
115-
unsafe { $name($($arg),*) }
109+
unsafe extern $abi {
110+
pub safe fn $name($($arg: $arg_ty),*) $(-> $ret)?;
116111
}
117112
binding!($($rest)*);
118113
};

src/panic_handler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use core::sync::atomic::{AtomicI32, Ordering};
1111
static PANIC_COUNT: Cell<usize> = Cell::new(0);
1212

1313
#[link(name = "c")]
14-
extern "C" {}
14+
unsafe extern "C" {}
1515

1616
pub(crate) fn drop_panic() {
1717
eprintln!("Rust panics must be rethrown");

src/unwinder/find_fde/fixed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub fn get_finder() -> &'static StaticFinder {
99
&StaticFinder(())
1010
}
1111

12-
extern "C" {
12+
unsafe extern "C" {
1313
static __executable_start: u8;
1414
static __etext: u8;
1515
static __eh_frame: u8;

src/unwinder/find_fde/gnu_eh_frame_hdr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub fn get_finder() -> &'static StaticFinder {
99
&StaticFinder(())
1010
}
1111

12-
extern "C" {
12+
unsafe extern "C" {
1313
static __executable_start: u8;
1414
static __etext: u8;
1515
static __GNU_EH_FRAME_HDR: u8;

test_crates/throw_and_catch/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use alloc::{borrow::ToOwned, string::String};
88
use unwinding::print::*;
99

1010
#[link(name = "c")]
11-
extern "C" {}
11+
unsafe extern "C" {}
1212

1313
struct PrintOnDrop(String);
1414

0 commit comments

Comments
 (0)