about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-06-10 21:12:27 +0200
committerGitHub <noreply@github.com>2024-06-10 21:12:27 +0200
commitb59507874e4b84512731db6106bce67609470e1a (patch)
tree805d01c3ed816362d0ca0577e950ebbae41fa69b
parent61eb29e958025eec8670e25cdfd4fa3f2df27512 (diff)
parent63ec8dd24ff4219960435c7dfd2c510c48dcda5c (diff)
Rollup merge of #126212 - SteveLauC:fix/haiku, r=joboet
fix: build on haiku

## What does this PR do

The std is broken on haiku, this PR fixes it.

## To reproduce the issue

```sh
$ cargo +nightly --version
cargo 1.81.0-nightly (b1feb75d0 2024-06-07)

$ cargo new hello
$ cd hello
$ cargo +nightly check -Zbuild-std --target x86_64-unknown-haiku -q
error[E0433]: failed to resolve: use of undeclared crate or module `std`
   --> ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/os.rs:468:13
    |
468 |             std::ptr::null_mut(),
    |             ^^^ use of undeclared crate or module `std`
    |
help: consider importing one of these items
    |
8   + use core::ptr;
    |
8   + use crate::ptr;
    |
help: if you import `ptr`, refer to it directly
    |
468 -             std::ptr::null_mut(),
468 +             ptr::null_mut(),
    |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
   --> ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/os.rs:470:13
    |
470 |             std::ptr::null_mut(),
    |             ^^^ use of undeclared crate or module `std`
    |
help: consider importing one of these items
    |
8   + use core::ptr;
```
-rw-r--r--library/std/src/sys/pal/unix/os.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/pal/unix/os.rs b/library/std/src/sys/pal/unix/os.rs
index ae1e42c419b..2e71ceceb58 100644
--- a/library/std/src/sys/pal/unix/os.rs
+++ b/library/std/src/sys/pal/unix/os.rs
@@ -465,9 +465,9 @@ pub fn current_exe() -> io::Result<PathBuf> {
     let mut name = vec![0; libc::PATH_MAX as usize];
     unsafe {
         let result = libc::find_path(
-            std::ptr::null_mut(),
+            crate::ptr::null_mut(),
             libc::path_base_directory::B_FIND_PATH_IMAGE_PATH,
-            std::ptr::null_mut(),
+            crate::ptr::null_mut(),
             name.as_mut_ptr(),
             name.len(),
         );