Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"use of undeclared crate or module slice" on x86_64-unknown-haiku #123343

Closed
asomers opened this issue Apr 1, 2024 · 3 comments · Fixed by #123354
Closed

"use of undeclared crate or module slice" on x86_64-unknown-haiku #123343

asomers opened this issue Apr 1, 2024 · 3 comments · Fixed by #123354
Labels
C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@asomers
Copy link
Contributor

asomers commented Apr 1, 2024

I tried this code:

cargo check -Zbuild-std --target x86_64-unknown-haiku

I expected to see this happen: The standard library should be able to build, and so should my crate

Instead, this happened: building the standard library failed with this error:

error[E0433]: failed to resolve: use of undeclared crate or module `slice`
   --> /localhome/somers/.rustup/toolchains/nightly-x86_64-unknown-freebsd/lib/rustlib/src/rust/library/std/src/sys/pal/unix/thread.rs:272:24
    |
272 |             let name = slice::from_raw_parts(info.name.as_ptr() as *const u8, info.name.len());
    |                        ^^^^^ use of undeclared crate or module `slice`
    |
help: consider importing one of these items
    |
1   + use alloc::slice;
    |
1   + use core::slice;
    |
1   + use crate::slice;

Meta

rustc --version --verbose:

rustc 1.79.0-nightly (805813650 2024-03-31)
binary: rustc
commit-hash: 805813650248c1a2f6f271460d728d1bb852d2a7
commit-date: 2024-03-31
host: x86_64-unknown-freebsd
release: 1.79.0-nightly
LLVM version: 18.1.2

The most recent working compiler version that I know of is this:

rustc 1.79.0-nightly (47ecded35 2024-03-26)

@asomers asomers added the C-bug Category: This is a bug. label Apr 1, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 1, 2024
@saethlin saethlin added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 1, 2024
@workingjubilee
Copy link
Contributor

We do not have any target maintainers for Haiku, it seems.

@Nilstrieb
Copy link
Member

Nilstrieb commented Apr 2, 2024

patches welcome, should be a trivial fix as the compiler helpfully points out

@Nilstrieb
Copy link
Member

And target maintainers even more welcome 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants