I couldn't find this exact problem mentioned elsewhere.
Problem
Cargo rightly produces errors for uses of std within a crate but will not complain about dependencies that rely on std when building for platforms that support std. This means that an implicit std requirement can quietly sneak into a project. It seems rather bizarre that cargo does not catch this issue.
Possible Solution(s)
- Make cargo search for uses of
std when building dependencies and produce an error
- Do not permit
std as a dependency in the dependency graph for no_std crates
- Only permit dependencies that are explicitly tagged with
#![no_std] for no_std crates
I couldn't find this exact problem mentioned elsewhere.
Problem
Cargo rightly produces errors for uses of
stdwithin a crate but will not complain about dependencies that rely onstdwhen building for platforms that supportstd. This means that an implicitstdrequirement can quietly sneak into a project. It seems rather bizarre that cargo does not catch this issue.Possible Solution(s)
stdwhen building dependencies and produce an errorstdas a dependency in the dependency graph forno_stdcrates#![no_std]forno_stdcrates