rust-lang / wg-cargo-std-aware

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

Allow scoping unstable features to specific targets #89

Open ketsuban opened 8 months ago

ketsuban commented 8 months ago

Currently if I want to use build-std in my .cargo/config.toml file I have to put it in an [unstable] section which applies it for every target when I only want to build the standard library for one. Would it be possible to do something like this, so that the unstable flags are only added when building for the appropriate target?

[target.thumbv4t-none-eabi]
runner = "mGBA"
rustflags = ["-Clink-arg=-Tlinker.ld"]

[target.thumbv4t-none-eabi.unstable]
build-std = ["core", "alloc"]
build-std-features = ["compiler-builtins-weak-intrinsics"]