Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow scoping unstable features to specific targets #89

Open
ketsuban opened this issue Oct 27, 2023 · 1 comment
Open

Allow scoping unstable features to specific targets #89

ketsuban opened this issue Oct 27, 2023 · 1 comment

Comments

@ketsuban
Copy link

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"]
@bravely-beep
Copy link

bravely-beep commented Sep 2, 2024

This would be extremely useful for my project! Would it be possible to implement a syntax similar to the one specified in the above post, even just as a stop-gap measure?

Specifically, this feature would allow rust-analyzer to analyze my code for multiple targets simultaneously, where one of them is a target that uses build-std. Currently this isn't possible, as rust-analyzer only runs a single cargo check command, and different unstable can't be configured on a per-target basis during a single check command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants