Skip to content

Commit

Permalink
fix: Fix uneccessary_cast lint on arm64 (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibordp authored Nov 2, 2023
1 parent 70a695f commit 33b8ab5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions sysroot/std/ffi.alu
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ impl CString {
}

/// @ mem::AsSlice::as_slice
#[allow(unnecessary_cast)]
fn as_slice(self: &CString) -> &[u8] {
mem::slice::from_raw(self.ptr as &u8, self.len())
}
Expand Down
1 change: 1 addition & 0 deletions sysroot/std/fs/unix.alu
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ fn canonicalize(path: Path) -> Result<PathBuf> {
// We don't know the exact size of the allocated buffer, so we assume
// that it is at least as big as the length of the string plus the null
// terminator.
#[allow(unnecessary_cast)]
let slice = mem::slice::from_raw(ret as &mut u8, len + 1);

Result::ok(PathBuf { inner: StringBuf::from_raw(slice, len) })
Expand Down
1 change: 1 addition & 0 deletions sysroot/std/runtime/mod.alu
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ mod internal {
let ret = when typing::matches::<arguments_of<UserMain>, (&[&[u8]])>() {
let args = allocate_args!(argc);
for i in 0usize..(argc as usize) {
#[allow(unnecessary_cast)]
args[i] = slice::from_raw(*(argv + i) as &u8, util::cast(libc::strlen(*(argv + i))));
}

Expand Down

0 comments on commit 33b8ab5

Please sign in to comment.