hobofan / cargo-nono

Check your crate for (possible) no_std compatibility
Apache License 2.0
209 stars 12 forks source link

Special-case rustc-std-workspace-core #65

Open sunfishcode opened 2 years ago

sunfishcode commented 2 years ago

rustc-std-workspace-core is an explicitly empty crate used by some low-level no_std crates in the Rust ecosystem, such as libc, when the rustc-dep-of-std feature is enabled. It's completely empty, so it doesn't declare #[no_std], so cargo nono flags it as not supporting no_std. For example, within the libc crate:

$ cargo nono check --features rustc-dep-of-std
libc: SUCCESS
rustc-std-workspace-core: FAILURE
  - Did not find a #![no_std] attribute or a simple conditional attribute like #[cfg_attr(not(feature = "std"), no_std)] in the crate source. Crate most likely doesn't support no_std without changes.

It'd be convenient if cargo-nono would special-case rustc-std-workspace-core and suppress this error.