Skip to content

Commit 09ea500

Browse files
committed
upgrade to rust 2024
1 parent 1d8d537 commit 09ea500

File tree

8 files changed

+65
-52
lines changed

8 files changed

+65
-52
lines changed
File renamed without changes.

Cargo.lock

Lines changed: 45 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "nix-ld"
33
version = "2.0.4"
4-
edition = "2021"
4+
edition = "2024"
55

66
[[bin]]
77
name = "nix-ld"
@@ -15,9 +15,16 @@ cfg-match = "0.2.1"
1515
constcat = "0.6.1"
1616
default-env = "0.1.1"
1717
embedded-io = "0.6.1"
18-
goblin = { version = "0.9.3", default-features = false, features = ["elf32", "elf64"] }
18+
goblin = { version = "0.9.3", default-features = false, features = [
19+
"elf32",
20+
"elf64",
21+
] }
1922
heapless = "0.8.0"
20-
linux-raw-sys = { version = "0.9.4", default-features = false, features = ["no_std", "general", "errno"] }
23+
linux-raw-sys = { version = "0.9.4", default-features = false, features = [
24+
"no_std",
25+
"general",
26+
"errno",
27+
] }
2128
log = "0.4.27"
2229

2330
[build-dependencies]

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Args wrangling.
22
3-
use core::ffi::{c_void, CStr};
3+
use core::ffi::{CStr, c_void};
44
use core::mem;
55
use core::slice;
66

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct Context {
4747
ld_library_path: Option<VarHandle>,
4848
}
4949

50-
#[no_mangle]
50+
#[unsafe(no_mangle)]
5151
unsafe extern "C" fn main(argc: usize, argv: *const *const u8, envp: *const *const u8) -> ! {
5252
fixup::fixup_relocs(envp);
5353

@@ -56,7 +56,7 @@ unsafe extern "C" fn main(argc: usize, argv: *const *const u8, envp: *const *con
5656
arch::main_relocate_stack!(stack, real_main);
5757
}
5858

59-
#[no_mangle]
59+
#[unsafe(no_mangle)]
6060
extern "C" fn real_main() -> ! {
6161
let args = unsafe { ARGS.assume_init_mut() };
6262
let mut ctx = Context::default();

src/support.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn panic_handler(info: &core::panic::PanicInfo) -> ! {
6262
}
6363
}
6464

65-
#[no_mangle]
65+
#[unsafe(no_mangle)]
6666
extern "C" fn __stack_chk_fail() -> ! {
6767
explode("stack smashing detected");
6868
}

src/sys.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use heapless::Vec as ArrayVec;
2626
pub use linux_raw_sys::errno;
2727

2828
#[link(name = "c_kinda", kind = "static")]
29-
extern "C" {
29+
unsafe extern "C" {
3030
pub fn write(fd: i32, buf: *const u8, count: usize) -> isize;
3131
#[must_use]
3232
pub fn mmap(
@@ -181,6 +181,6 @@ pub fn new_slice_leak(size: usize) -> Option<&'static mut [u8]> {
181181

182182
#[cfg(not(test))]
183183
#[lang = "eh_personality"]
184-
#[no_mangle]
185-
pub extern fn rust_eh_personality() {
184+
#[unsafe(no_mangle)]
185+
pub extern "C" fn rust_eh_personality() {
186186
}

0 commit comments

Comments
 (0)