Skip to content

Commit 6bb9d7d

Browse files
committed
Update toolchain to a working nightly
Now that rust-lang/rust#118609 is fixed. The previous nightly was broken and rolled-back in google#338.
1 parent 93872be commit 6bb9d7d

File tree

9 files changed

+16
-10
lines changed

9 files changed

+16
-10
lines changed

crates/prelude/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
### Patch
3030

31+
- Fix lints of nightly-2024-01-14
3132
- Use `ENUM::to_result()` to convert errors
3233
- Only depend on `portable-atomic` through `wasefire-sync`
3334
- Use `wasefire-sync::executed!()` to ensure the allocator is initialized at

crates/prelude/src/allocator/wasm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ extern "C" fn init() {
3030
struct Pool(MaybeUninit<[u8; SIZE]>);
3131
static mut POOL: Pool = Pool(MaybeUninit::uninit());
3232
// SAFETY: This function is called at most once and POOL is only accessed here.
33-
let pool = unsafe { &mut POOL };
34-
let pool_ptr = NonNull::new(pool.0.as_mut_ptr()).unwrap();
33+
let pool_ptr = NonNull::new(unsafe { POOL.0.as_mut_ptr() }).unwrap();
3534
let mut allocator = ALLOCATOR.0.lock();
3635
// SAFETY: POOL is static and won't be used again.
3736
let size = unsafe { allocator.insert_free_block_ptr(pool_ptr) };

crates/prelude/src/callback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ macro_rules! define {
2020
(#[$m:meta] $n:ident $(, $x:ident)*) => {
2121
#[$m] #[no_mangle]
2222
extern "C" fn $n (
23-
ptr: extern "C" fn(*const u8 $(, usize ${ignore(x)})*),
23+
ptr: extern "C" fn(*const u8 $(, usize ${ignore($x)})*),
2424
this: *const u8 $(, $x: usize)*
2525
) {
2626
ptr(this $(, $x)*);

crates/runner-nordic/crates/header/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#![no_std]
1616

17+
use core::ptr::addr_of;
18+
1719
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
1820
pub struct Header(u32);
1921

@@ -63,7 +65,7 @@ impl Side {
6365
extern "C" {
6466
static mut __header_origin: u32;
6567
}
66-
Self::new(unsafe { &__header_origin as *const u32 } as u32)
68+
Self::new(unsafe { addr_of!(__header_origin) } as u32)
6769
}
6870

6971
fn new(addr: u32) -> Option<Self> {

crates/runner-nordic/src/allocator.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
use core::ptr::addr_of_mut;
16+
1517
use embedded_alloc::Heap;
1618

1719
#[global_allocator]
@@ -22,8 +24,8 @@ pub fn init() {
2224
static mut __sheap: u32;
2325
static mut __eheap: u32;
2426
}
25-
let sheap = unsafe { &mut __sheap } as *mut u32 as usize;
26-
let eheap = unsafe { &mut __eheap } as *mut u32 as usize;
27+
let sheap = unsafe { addr_of_mut!(__sheap) as usize };
28+
let eheap = unsafe { addr_of_mut!(__eheap) as usize };
2729
assert!(sheap < eheap);
2830
// Unsafe: Called only once before any allocation.
2931
unsafe { ALLOCATOR.init(sheap, eheap - sheap) }

crates/runner-nordic/src/storage.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
use alloc::borrow::Cow;
1616
use alloc::vec;
17+
use core::ptr::addr_of_mut;
1718
use core::slice;
1819

1920
use embedded_storage::nor_flash::{
@@ -41,8 +42,8 @@ macro_rules! take_storage {
4142
static mut $start: u32;
4243
static mut $end: u32;
4344
}
44-
let start = unsafe { &mut $start as *mut u32 as *mut u8 };
45-
let end = unsafe { &mut $end as *mut u32 as usize };
45+
let start = unsafe { addr_of_mut!($start) as *mut u8 };
46+
let end = unsafe { addr_of_mut!($end) as usize };
4647
let length = end.checked_sub(start as usize).unwrap();
4748
assert_eq!(length % PAGE_SIZE, 0);
4849
unsafe { slice::from_raw_parts_mut(start, length) }

crates/scheduler/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
### Patch
3333

34+
- Fix lints of nightly-2024-01-24
3435
- Support zero-length slices in native
3536
- Fix board API feature gates for AES-128-CCM and AES-256-GCM
3637
- Remove unreachable `multivalue` feature gates

crates/scheduler/src/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ pub fn process<B: Board>(scheduler: &mut Scheduler<B>, event: Event<B>) {
181181

182182
#[derive(Copy, Clone)]
183183
#[repr(transparent)]
184-
struct U8(*const u8);
184+
struct U8(#[allow(dead_code)] *const u8);
185185
unsafe impl Send for U8 {}
186186

187187
let InstId = inst;

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
channel = "nightly-2023-11-14"
2+
channel = "nightly-2024-01-14"
33
components = ["clippy", "llvm-tools", "rust-src", "rustfmt"]
44
targets = [
55
"i686-unknown-linux-gnu",

0 commit comments

Comments
 (0)