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

Use cfg!(target_feature) for static ARM/AARCH64 feature detection. #1540

Merged
merged 1 commit into from
Oct 1, 2023

Conversation

briansmith
Copy link
Owner

@briansmith briansmith commented Oct 29, 2022

Our MSRV supports if in const expressions. Implement a workaround for buggy detection on older versions of Rust.

@briansmith briansmith self-assigned this Oct 29, 2022
@briansmith briansmith changed the title Use cfg!(target_feature) for static AARCH64 feature detection. Use cfg!(target_feature) for static ARM/AARCH64 feature detection. Oct 29, 2022
@codecov
Copy link

codecov bot commented Oct 29, 2022

Codecov Report

Merging #1540 (df29dd3) into main (4b87b67) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1540      +/-   ##
==========================================
- Coverage   96.02%   96.01%   -0.01%     
==========================================
  Files         133      133              
  Lines       19913    19913              
  Branches      199      199              
==========================================
- Hits        19121    19120       -1     
  Misses        754      754              
- Partials       38       39       +1     
Files Coverage Δ
src/cpu/arm.rs 94.56% <ø> (+2.17%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@briansmith briansmith added this to the 0.17.0 milestone Oct 29, 2022
@briansmith briansmith force-pushed the b/aarch64-feature-2 branch 2 times, most recently from d1245ff to e7c214a Compare October 31, 2022 21:19
@briansmith briansmith force-pushed the b/aarch64-feature-2 branch 2 times, most recently from b2d2d58 to a74a1be Compare September 30, 2023 19:42
);
// MSRV: Enforce 1.61.0 on some aarch64-* targets (aarch64-apple-*, in particular) prior to. Earlier
// versions of Rust before did not report the AAarch64 CPU features correctly for these targets.
// Cargo.toml specifies `rust-version` but versions before Rust 1.56 don't know about it.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that cargo test +1.60.0 --target=aarch64-apple-darwin fails due to this, and cargo test +1.61.0 --target=aarch64-apple-darwin passes.

@briansmith briansmith merged commit 901441f into main Oct 1, 2023
143 of 144 checks passed
@briansmith briansmith deleted the b/aarch64-feature-2 branch October 1, 2023 00:41
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

Successfully merging this pull request may close these issues.

1 participant