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

#[target_feature(enable = "avx2")] can be applied to non-functions, but doesn't do anything #54584

Closed
nicokoch opened this issue Sep 26, 2018 · 2 comments · Fixed by #73461
Closed
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-diagnostics Area: Messages for errors, warnings, and lints A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nicokoch
Copy link
Contributor

nicokoch commented Sep 26, 2018

Playground link demonstrating the problem

Playground link when it works

The compiler should tell me that the annotation will not do anything (in the first case)

@Havvy Havvy added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-diagnostics Area: Messages for errors, warnings, and lints labels Sep 26, 2018
@thomwiggers
Copy link
Contributor

thomwiggers commented Dec 18, 2019

Your example doesn't work anymore, because the playground doesn't require target_feature(enable="avx2") to compile/run AVX2 code anymore. Similarly, avx512 intrinsics also just work...

thomwiggers added a commit to rustpq/pqcrypto that referenced this issue Dec 18, 2019
@jethrogb
Copy link
Contributor

Issue remains.

cc @gnzlbg

@crlf0710 crlf0710 added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 11, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Sep 7, 2020
…acement, r=matthewjasper

Validate built-in attribute placement

Closes rust-lang#54584, closes rust-lang#47725, closes rust-lang#54044.

I've changed silently ignoring some incorrectly placed attributes to errors.  I'm not sure what the policy is since this can theoretically break code (should they be warnings instead? does it warrant a crater run?).
@bors bors closed this as completed in dbb73f8 Sep 12, 2020
@workingjubilee workingjubilee added the A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-diagnostics Area: Messages for errors, warnings, and lints A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants