sunfishcode / c-ward

An implementation of libc written in Rust
Other
187 stars 11 forks source link

no `invalid_mut` in `ptr` #122

Closed rice7th closed 5 months ago

rice7th commented 6 months ago

Hello!

I've been trying to compile a toy miniquad project using both eyra and mustang, but unfortunately in both instances I got the same errors:

error[E0432]: unresolved import `core::ptr::invalid_mut`
 --> /home/rice7th/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c-scape-0.15.40/src/brk.rs:2:17
  |
2 | use core::ptr::{invalid_mut, null_mut};
  |                 ^^^^^^^^^^^ no `invalid_mut` in `ptr`

error[E0432]: unresolved import `core::ptr::invalid_mut`
 --> /home/rice7th/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c-scape-0.15.40/src/syscall.rs:5:5
  |
5 | use core::ptr::invalid_mut;
  |     ^^^^^^^^^^^^^^^^^^^^^^ no `invalid_mut` in `ptr`

error[E0425]: cannot find function `invalid_mut` in module `ptr`
   --> /home/rice7th/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c-scape-0.15.40/src/process_.rs:192:32
    |
192 |         libc::AT_HWCAP => ptr::invalid_mut(rustix::param::linux_hwcap().0),
    |                                ^^^^^^^^^^^ not found in `ptr`

error[E0425]: cannot find function `invalid_mut` in module `ptr`
   --> /home/rice7th/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c-scape-0.15.40/src/process_.rs:193:33
    |
193 |         libc::AT_HWCAP2 => ptr::invalid_mut(rustix::param::linux_hwcap().1),
    |                                 ^^^^^^^^^^^ not found in `ptr`

Some errors have detailed explanations: E0425, E0432.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `c-scape` (lib) due to 4 previous errors

Everything else compiles just fine.

Using the latest eyra/mustang and the latest nightly. Even adding the #![feature(strict_provenance)] feature gate does nothing.

sunfishcode commented 6 months ago

Looks like invalid_mut was recently renamed to without_provenance_mut. If you're able to submit a PR updating c-scape, I can probably merge it; otherwise I'll fix this when I'm back at a computer.

rice7th commented 6 months ago

@sunfishcode Sure! I am trying to look into renaming all the functions, going to keep you updated.

rice7th commented 6 months ago

Done =)

rice7th commented 5 months ago

@sunfishcode Please reopen the issue since I still need to fix the other PR.

(apparently I can't currently reopen the issue for some reason).

sunfishcode commented 5 months ago

Re-opening...