From 4a589d7a305813d4a3e321c5f80364f7a4fc468e Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Tue, 28 May 2024 10:11:38 -0400 Subject: [PATCH] lint --- runtime/src/parallel.rs | 2 +- util/src/new_uninit_slice.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/src/parallel.rs b/runtime/src/parallel.rs index 5517b489..b272f6dc 100644 --- a/runtime/src/parallel.rs +++ b/runtime/src/parallel.rs @@ -18,7 +18,7 @@ impl<'h> Net<'h> { (0 .. tids).map(move |tid| { let heap_size = (heap.0.len() / tids) & !63; // round down to needed alignment let heap_start = heap_size * tid; - let area = unsafe { mem::transmute(&heap.0[heap_start .. heap_start + heap_size]) }; + let area = unsafe { mem::transmute::<&[Node], &Heap>(&heap.0[heap_start .. heap_start + heap_size]) }; let mut net = Net::new_with_root(area, root.clone()); net.next = next.saturating_sub(heap_start); net.head = if tid == 0 { net.head } else { Addr::NULL }; diff --git a/util/src/new_uninit_slice.rs b/util/src/new_uninit_slice.rs index 60962b40..e032724b 100644 --- a/util/src/new_uninit_slice.rs +++ b/util/src/new_uninit_slice.rs @@ -1,10 +1,10 @@ use alloc::alloc::alloc; -use core::{alloc::Layout, mem::MaybeUninit}; +use core::{alloc::Layout, mem::MaybeUninit, slice}; use crate::prelude::*; // TODO: use `Box::new_uninit_slice` once stabilized // https://github.com/rust-lang/rust/issues/63291 pub fn new_uninit_slice(len: usize) -> Box<[MaybeUninit]> { - unsafe { Box::from_raw(core::slice::from_raw_parts_mut(alloc(Layout::array::(len).unwrap()).cast(), len)) } + unsafe { Box::from_raw(slice::from_raw_parts_mut(alloc(Layout::array::(len).unwrap()).cast(), len)) } }