Skip to content

Commit 115adf5

Browse files
authored
Update to Rust nightly-2024-04-21. (#112)
1 parent 2c5bcef commit 115adf5

6 files changed

Lines changed: 11 additions & 15 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ rustix-futex-sync = { version = "0.2.1", optional = true }
2727
# before `origin_main` is called.
2828

2929
# Enable `env_logger`; eg. recognizing `RUST_LOG=trace`. This requires `std`.
30-
env_logger = { version = "0.10.0", optional = true, default-features = false }
30+
env_logger = { version = "0.11.0", optional = true, default-features = false }
3131

3232
# Enable `atomic-dbg`'s simple logger. This doesn't require `std`.
3333
atomic-dbg = { version = "0.1", default-features = false, optional = true }

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2024-02-26"
2+
channel = "nightly-2024-04-21"
33
components = ["rustc", "cargo", "rust-std", "rust-src", "rustfmt"]

src/relocate.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::arch::{
3030
dynamic_table_addr, relocation_load, relocation_mprotect_readonly, relocation_store,
3131
};
3232
use core::ffi::c_void;
33-
use core::ptr::{from_exposed_addr, null, null_mut};
33+
use core::ptr::{with_exposed_provenance, null, null_mut};
3434
use linux_raw_sys::elf::*;
3535
use linux_raw_sys::general::{AT_BASE, AT_ENTRY, AT_NULL, AT_PAGESZ};
3636

@@ -148,14 +148,14 @@ pub(super) unsafe fn relocate(envp: *mut *mut u8) {
148148

149149
match *d_tag {
150150
// We found a rela table. As above, model this as
151-
// `from_exposed_addr`.
152-
DT_RELA => rela_ptr = from_exposed_addr(d_un.d_ptr.wrapping_add(offset)),
151+
// `with_exposed_provenance`.
152+
DT_RELA => rela_ptr = with_exposed_provenance(d_un.d_ptr.wrapping_add(offset)),
153153
DT_RELASZ => rela_total_size = d_un.d_val as usize,
154154
DT_RELAENT => rela_entry_size = d_un.d_val as usize,
155155

156156
// We found a rel table. As above, model this as
157-
// `from_exposed_addr`.
158-
DT_REL => rel_ptr = from_exposed_addr(d_un.d_ptr.wrapping_add(offset)),
157+
// `with_exposed_provenance`.
158+
DT_REL => rel_ptr = with_exposed_provenance(d_un.d_ptr.wrapping_add(offset)),
159159
DT_RELSZ => rel_total_size = d_un.d_val as usize,
160160
DT_RELENT => rel_entry_size = d_un.d_val as usize,
161161

@@ -245,7 +245,7 @@ pub(super) unsafe fn relocate(envp: *mut *mut u8) {
245245
let mut relro_size = 0;
246246

247247
let phentsize = EHDR.e_phentsize as usize;
248-
let mut current_phdr = from_exposed_addr::<Elf_Phdr>(offset + EHDR.e_phoff);
248+
let mut current_phdr = with_exposed_provenance::<Elf_Phdr>(offset + EHDR.e_phoff);
249249
let phdrs_end = current_phdr
250250
.cast::<u8>()
251251
.add(EHDR.e_phnum as usize * phentsize)

src/thread/libc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use alloc::boxed::Box;
44
use core::ffi::{c_int, c_void};
55
use core::mem::{size_of, transmute, zeroed};
6-
use core::ptr::{from_exposed_addr_mut, null_mut, without_provenance_mut, NonNull};
6+
use core::ptr::{with_exposed_provenance_mut, null_mut, without_provenance_mut, NonNull};
77
use core::slice;
88
use rustix::io;
99

@@ -39,7 +39,7 @@ impl Thread {
3939
/// `Thread::to_raw`.
4040
#[inline]
4141
pub fn from_raw(raw: *mut c_void) -> Self {
42-
Self(raw.expose_addr() as libc::pthread_t)
42+
Self(raw.expose_provenance() as libc::pthread_t)
4343
}
4444

4545
/// Convert to `Self` from a raw non-null pointer that was returned from
@@ -56,7 +56,7 @@ impl Thread {
5656
/// threads.
5757
#[inline]
5858
pub fn to_raw(self) -> *mut c_void {
59-
from_exposed_addr_mut(self.0 as usize)
59+
with_exposed_provenance_mut(self.0 as usize)
6060
}
6161

6262
/// Convert to a raw non-null pointer from a `Self`.

tests/example_crates.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! Run the programs in the `example-crates` directory and compare their
22
//! outputs with expected outputs.
33
4-
#![feature(cfg_target_abi)]
5-
64
mod utils;
75

86
use utils::{COMMON_STDERR, NO_ALLOC_STDERR};

tests/test_crates.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! Run the programs in the `test-crates` directory and compare their
22
//! outputs with expected outputs.
33
4-
#![feature(cfg_target_abi)]
5-
64
mod utils;
75

86
fn test_crate(

0 commit comments

Comments
 (0)