Skip to content

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

Closed
@asomers

Description

@asomers

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions