rust-lang / wg-cargo-std-aware

Repo for working on "std aware cargo"
133 stars 8 forks source link

The restricted_std error message is confusing #87

Open ehuss opened 1 year ago

ehuss commented 1 year ago

If you attempt to build a no-std target, and you forget to include #![no_std] (or you forget to remove a std feature in a dependency, or use a std-needing dependency), then it results in a fairly confusing error:

error[E0658]: use of unstable library feature 'restricted_std'
  |
  = help: add `#![feature(restricted_std)]` to the crate attributes to enable

I think that will be a frequent error that will be challenging for users to understand.

I don't know how to address that. It might be nice if cargo could know whether or not a target is intended to support "std", but that sounds challenging.