From 97de41f39dca4daa0b9e0e10bffc4893d4ef29e9 Mon Sep 17 00:00:00 2001 From: Akira Moroo Date: Wed, 15 May 2024 12:01:15 +0000 Subject: [PATCH] build: Update toolchain to nightly-2024-05-13 With this update, some of the target json definitions need to be updated, and some experimental functions are updated. Signed-off-by: Akira Moroo --- riscv64gcv-unknown-none-elf.json | 2 +- rust-toolchain.toml | 2 +- src/fat.rs | 1 - src/main.rs | 2 +- src/mem.rs | 8 ++++---- x86_64-unknown-none.json | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/riscv64gcv-unknown-none-elf.json b/riscv64gcv-unknown-none-elf.json index 48ad80d8..e84d424b 100644 --- a/riscv64gcv-unknown-none-elf.json +++ b/riscv64gcv-unknown-none-elf.json @@ -2,7 +2,7 @@ "arch": "riscv64", "code-model": "medium", "cpu": "generic-rv64", - "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n64-S128", + "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", "eh-frame-header": false, "emit-debug-gdb-scripts": false, "features": "+m,+a,-f,+d,+c,-v", diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 29967462..c8a2d6a1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2023-11-11" +channel = "nightly-2024-05-13" components = ["rust-src", "clippy", "rustfmt"] targets = [ "aarch64-unknown-linux-gnu", diff --git a/src/fat.rs b/src/fat.rs index eedb4ca9..f4199697 100644 --- a/src/fat.rs +++ b/src/fat.rs @@ -5,7 +5,6 @@ use crate::{ block::{Error as BlockError, SectorBuf, SectorRead}, mem::MemoryRegion, }; -use core::convert::TryFrom; #[repr(packed)] struct Header { diff --git a/src/main.rs b/src/main.rs index e5d872e8..e97c68c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,8 +2,8 @@ // Copyright © 2019 Intel Corporation #![feature(asm_const)] +#![feature(exposed_provenance)] #![feature(slice_take)] -#![feature(stdsimd)] #![feature(stmt_expr_attributes)] #![feature(strict_provenance)] #![feature(sync_unsafe_cell)] diff --git a/src/mem.rs b/src/mem.rs index f2c07fa3..a76570d5 100644 --- a/src/mem.rs +++ b/src/mem.rs @@ -40,7 +40,7 @@ impl MemoryRegion { T: Copy + Sized, { assert!((offset + (core::mem::size_of::() - 1) as u64) < self.length); - let ptr: *const T = core::ptr::from_exposed_addr((self.base + offset) as usize); + let ptr: *const T = core::ptr::with_exposed_provenance((self.base + offset) as usize); unsafe { ptr.read_unaligned() } } @@ -70,7 +70,7 @@ impl MemoryRegion { T: Sized, { assert!((offset + (core::mem::size_of::() - 1) as u64) < self.length); - let ptr: *mut T = core::ptr::from_exposed_addr_mut((self.base + offset) as usize); + let ptr: *mut T = core::ptr::with_exposed_provenance_mut((self.base + offset) as usize); unsafe { core::ptr::write_unaligned(ptr, value) } } @@ -100,7 +100,7 @@ impl MemoryRegion { T: Copy + Sized, { assert!((offset + (core::mem::size_of::() - 1) as u64) < self.length); - let ptr: *const T = core::ptr::from_exposed_addr((self.base + offset) as usize); + let ptr: *const T = core::ptr::with_exposed_provenance((self.base + offset) as usize); unsafe { ptr.read_volatile() } } @@ -130,7 +130,7 @@ impl MemoryRegion { T: Sized, { assert!((offset + (core::mem::size_of::() - 1) as u64) < self.length); - let ptr: *mut T = core::ptr::from_exposed_addr_mut((self.base + offset) as usize); + let ptr: *mut T = core::ptr::with_exposed_provenance_mut((self.base + offset) as usize); unsafe { core::ptr::write_volatile(ptr, value) } } diff --git a/x86_64-unknown-none.json b/x86_64-unknown-none.json index f42155ae..dab5ec84 100644 --- a/x86_64-unknown-none.json +++ b/x86_64-unknown-none.json @@ -1,6 +1,6 @@ { "llvm-target": "x86_64-unknown-none", - "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", "arch": "x86_64", "target-endian": "little", "target-pointer-width": "64",