rust-lang / stdarch

Rust's standard library vendor-specific APIs and run-time feature detection
https://doc.rust-lang.org/stable/core/arch/
Apache License 2.0
601 stars 267 forks source link

Make std_detect::detect::check_for unstably public #1556

Closed GnomedDev closed 3 months ago

GnomedDev commented 6 months ago

This is a requirement for my idea of how to make feature detection usable in core when std is present. See more information at my Zulip post proposing the idea.

I do not see any downside from this being merged, as if the idea turns out to not be wanted it doesn't affect any public API outside of libstd's usage due to the unstable attribute.

rustbot commented 6 months ago

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) some time within the next two weeks.

Amanieu commented 3 months ago

I would prefer seeing this move in a different direction. Essentially all of the Feature enums should be moved to core, and the feature detection logic should be moved to std. Essentially I would like std_detect to be moved out of this repo into the main rust-lang/rust repo, leaving this repo only for the arch-specific intrinsics and related tests.

GnomedDev commented 3 months ago

Yeah, I was working on this for a bit and couldn't get the build system working but I was doing absolute hackiness (includeing std_detect into core with only the feature enum, then properly depending on std_detect trying to use the feature enum re-exported from core).