Skip to content

Figure out how to deal with cargo test with a no_std target #72

@phip1611

Description

@phip1611

@ehuss: This is just a general issue on figuring out what cargo test should do with a no_std target.


This bug originates from a stack overflow thread in that my minimal project, that is building an application for the x86_64-unknown-uefi target, cannot execute cargo test. The crate itself uses the build-std feature in .config/cargo.toml. When tests are executed, the compiler complains about can't find crate for 'test'. If I add test to the build-std-array, therefore,

[unstable]
build-std = [
    "alloc",
    "compiler_builtins",
    "core",
    + "test",
]

the compiler tells I should add #![feature(restricted_std)] . If I do so, nothing changes. I found the bug with Rust/Cargo 1.55-nightly

Expected Behaviour
One should be able to execute tests when build-std is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions