#cli #std #no-std

no-std app cargo-no-std-check

Check that a crate builds without std

3 releases

0.1.3 Jan 31, 2021
0.1.2 Jan 31, 2021
0.1.1 Feb 17, 2020
0.1.0 Feb 17, 2020

#38 in #std

Download history 9/week @ 2022-11-25 11/week @ 2022-12-02 30/week @ 2022-12-09 18/week @ 2022-12-16 1/week @ 2022-12-23 6/week @ 2022-12-30 11/week @ 2023-01-06 18/week @ 2023-01-13 12/week @ 2023-01-20 17/week @ 2023-01-27 18/week @ 2023-02-03 19/week @ 2023-02-10 18/week @ 2023-02-17 9/week @ 2023-02-24 5/week @ 2023-03-03 18/week @ 2023-03-10

53 downloads per month

MIT/Apache

13KB
159 lines

cargo no-std-check

CI Latest Version

cargo no-std-check is a wrapper for cargo check, which ensures that your library does not link against libstd.

Installation

cargo no-std-check can be built with any stable version of rust, but its operation requires a nightly compiler.

$ cargo install cargo-no-std-check

Usage

Run this command on a crate to build it's lib target without access to std. Attempts to use std in the final library's dependency hierarchy will produce a build error.

Passing Example

$ cargo no-std-check --manifest-path nostd/Cargo.toml
    Creating #![no_std] sysroot
     Copying [============================================================] 154/154: done
     Sysroot x86_64-unknown-linux-gnu (/tmp/nostd_sysroot.YhFkabJ2tXeK)
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s

Failing Example

$ cargo no-std-check --manifest-path withstd/Cargo.toml
    Creating #![no_std] sysroot
     Copying [============================================================] 154/154: done
     Sysroot x86_64-unknown-linux-gnu (/tmp/nostd_sysroot.uYDnxo4ZNOLs)
    Checking withstd v0.1.0 (/crates/withstd)
error[E0463]: can't find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `withstd`.

To learn more, run the command again with --verbose.

Dependencies

~3.5–8.5MB
~153K SLoC