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

std_detect is_x86_feature_detected macro should reject unstable features if they are not enabled #667

Closed
gnzlbg opened this issue Jan 31, 2019 · 1 comment · Fixed by #739
Labels

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Jan 31, 2019

E.g. "sse4a", we should check all others as well.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jan 31, 2019

So we can't easily fix this because is_x86_feature_detected has an #[allow_rustc_unstable] attribute to be able to use the stdsimd_internal Feature enum.

I was able to get some compile-fail tests to run by using rustdoc compile_fail feature, removing #[allow_rustc_unstable], and marking, e.g., the mmx enum variant of the Feature enum with the #[unstable(mmx_target_feature, ...)] attribute.

I talked with @oli-obk on Discord and the better solution here is to require #[allow_rustc_unstable] to specify which features it allows explicitly, e.g., #[allow_rustc_unstable(stdsimd_internal)]. That would allow that particular feature, but if the mmx variant of the enum is used without the feature(mmx_target_feature) compilation would fail.

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