Skip to content

Fix accidental stabilization in feature-detection macros #64534

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/libstd/tests/run-time-detect.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
//! These tests just check that the macros are available in libstd.

#![cfg_attr(
any(
all(target_arch = "arm", any(target_os = "linux", target_os = "android")),
all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")),
all(target_arch = "powerpc", target_os = "linux"),
all(target_arch = "powerpc64", target_os = "linux"),
),
feature(stdsimd)
)]
#![feature(stdsimd)]

This comment was marked as resolved.

Copy link
Contributor Author

@gnzlbg gnzlbg Sep 18, 2019

Choose a reason for hiding this comment

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

No. But this file tests all features available in both nightly and stable, it makes little sense for it to have such a cfg hell since it requires nightly to run anyways. There is a ui test that checks that is_x86_feature_detected! works for the stable features on stable Rust here: https://github.com/rust-lang/rust/pull/64534/files#diff-e66d446bef72e3d1dcd7b18783509eeb So all of these continue to work.


#[test]
#[cfg(all(target_arch = "arm",
Expand Down
2 changes: 1 addition & 1 deletion src/stdarch
Submodule stdarch updated 50 files
+0 −30 .appveyor.yml
+13 −0 .cirrus.yml
+3 −5 README.md
+1 −1 ci/azure-install-rust.yml
+37 −37 ci/azure.yml
+1 −2 crates/core_arch/Cargo.toml
+3 −5 crates/core_arch/README.md
+0 −1 crates/core_arch/src/aarch64/crc.rs
+0 −1 crates/core_arch/src/aarch64/neon.rs
+0 −1 crates/core_arch/src/acle/dsp.rs
+1,320 −1,317 crates/core_arch/src/mips/msa.rs
+1 −5 crates/core_arch/src/mod.rs
+0 −1 crates/core_arch/src/powerpc/altivec.rs
+0 −1 crates/core_arch/src/simd_llvm.rs
+3 −3 crates/core_arch/src/x86/avx.rs
+4 −7 crates/core_arch/src/x86/avx2.rs
+8 −28 crates/core_arch/src/x86/sse.rs
+12 −10 crates/core_arch/src/x86/sse2.rs
+1 −1 crates/core_arch/src/x86_64/sse.rs
+1 −2 crates/std_detect/Cargo.toml
+3 −5 crates/std_detect/README.md
+22 −92 crates/std_detect/src/detect/arch/aarch64.rs
+12 −34 crates/std_detect/src/detect/arch/arm.rs
+7 −25 crates/std_detect/src/detect/arch/mips.rs
+7 −25 crates/std_detect/src/detect/arch/mips64.rs
+9 −36 crates/std_detect/src/detect/arch/powerpc.rs
+9 −36 crates/std_detect/src/detect/arch/powerpc64.rs
+113 −293 crates/std_detect/src/detect/arch/x86.rs
+95 −0 crates/std_detect/src/detect/macros.rs
+55 −3 crates/std_detect/src/detect/mod.rs
+14 −5 crates/std_detect/src/detect/os/aarch64.rs
+1 −8 crates/std_detect/src/detect/os/freebsd/aarch64.rs
+3 −9 crates/std_detect/src/detect/os/freebsd/arm.rs
+22 −14 crates/std_detect/src/detect/os/freebsd/auxvec.rs
+3 −9 crates/std_detect/src/detect/os/freebsd/powerpc.rs
+13 −16 crates/std_detect/src/detect/os/linux/aarch64.rs
+7 −10 crates/std_detect/src/detect/os/linux/arm.rs
+15 −18 crates/std_detect/src/detect/os/linux/auxvec.rs
+2 −3 crates/std_detect/src/detect/os/linux/cpuinfo.rs
+2 −8 crates/std_detect/src/detect/os/linux/mips.rs
+2 −8 crates/std_detect/src/detect/os/linux/powerpc.rs
+3 −5 crates/std_detect/src/detect/os/other.rs
+15 −28 crates/std_detect/src/detect/os/x86.rs
+19 −12 crates/std_detect/tests/cpu-detection.rs
+65 −74 crates/stdarch-test/src/disassembly.rs
+1 −2 crates/stdarch-test/src/wasm.rs
+33 −3 crates/stdarch-verify/src/lib.rs
+150 −0 crates/stdarch-verify/tests/arm.rs
+29 −0 crates/stdarch-verify/tests/mips.rs
+151 −0 crates/stdarch-verify/tests/x86-intel.rs
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-asimd.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("asimd");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-crc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("crc");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-crypto.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("crypto");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-dotprod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("dotprod");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
12 changes: 12 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
// test for unknown features
is_aarch64_feature_detected!("foobar");
//~^ ERROR use of unstable library feature
}


#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-fp.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("fp");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-fp16.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("fp16");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-lse.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("lse");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-ras.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("ras");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-rcpc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("rcpc");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-rdm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("rdm");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-sve.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("sve");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-v81a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("v8.1a");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-v82a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("v8.2a");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detected-v83a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("v8.3a");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detection-neon.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("neon");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_aarch64_feature_detection-pmull.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-aarch64

#[cfg(target_arch = "aarch64")]
fn main() {
is_aarch64_feature_detected!("pmull");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "aarch64"))]
fn main() {}
12 changes: 12 additions & 0 deletions src/test/ui/stdarch/is_arm_feature_detected-error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// only-arm

#[cfg(target_arch = "arm")]
fn main() {
// test for unknown features
is_arm_feature_detected!("foobar");
//~^ ERROR use of unstable library feature
}


#[cfg(not(target_arch = "arm"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_arm_feature_detected-neon.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-arm

#[cfg(target_arch = "arm")]
fn main() {
is_arm_feature_detected!("neon");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "arm"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_arm_feature_detected-pmull.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-arm

#[cfg(target_arch = "arm")]
fn main() {
is_arm_feature_detected!("pmull");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "arm"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_arm_feature_detected-v7.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-arm

#[cfg(target_arch = "arm")]
fn main() {
is_arm_feature_detected!("v7");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "arm"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_arm_feature_detected-vfp2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-arm

#[cfg(target_arch = "arm")]
fn main() {
is_arm_feature_detected!("vfp2");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "arm"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_arm_feature_detected-vfp3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-arm

#[cfg(target_arch = "arm")]
fn main() {
is_arm_feature_detected!("vfp3");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "arm"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_arm_feature_detected-vfp4.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-arm

#[cfg(target_arch = "arm")]
fn main() {
is_arm_feature_detected!("vfp4");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "arm"))]
fn main() {}
12 changes: 12 additions & 0 deletions src/test/ui/stdarch/is_mips64_feature_detected-error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// only-mips64

#[cfg(target_arch = "mips64")]
fn main() {
// test for unknown features
is_mips64_feature_detected!("foobar");
//~^ ERROR use of unstable library feature
}


#[cfg(not(target_arch = "mips64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_mips64_feature_detected-msa.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-mips64

#[cfg(target_arch = "mips64")]
fn main() {
is_mips_feature_detected!("msa");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "mips64"))]
fn main() {}
12 changes: 12 additions & 0 deletions src/test/ui/stdarch/is_mips_feature_detected-error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// only-mips

#[cfg(target_arch = "mips")]
fn main() {
// test for unknown features
is_mips_feature_detected!("foobar");
//~^ ERROR use of unstable library feature
}


#[cfg(not(target_arch = "mips"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_mips_feature_detected-msa.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-mips

#[cfg(target_arch = "mips")]
fn main() {
is_mips_feature_detected!("msa");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "mips"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_powerpc64_feature_detected-altivec.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-powerpc64|powerpc64le

#[cfg(target_arch = "powerpc64")]
fn main() {
is_powerpc64_feature_detected!("altivec");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "powerpc64"))]
fn main() {}
11 changes: 11 additions & 0 deletions src/test/ui/stdarch/is_powerpc64_feature_detected-error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// only-powerpc64|powerpc64le

#[cfg(any(target_arch = "powerpc64", target_arch = "powerpc64le"))]
fn main() {
// test for unknown features
is_powerpc64_feature_detected!("foobar");
//~^ ERROR use of unstable library feature
}

#[cfg(any(target_arch = "powerpc64", target_arch = "powerpc64le"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_powerpc64_feature_detected-power8.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-powerpc64|powerpc64le

#[cfg(target_arch = "powerpc64")]
fn main() {
is_powerpc64_feature_detected!("power8");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "powerpc64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_powerpc64_feature_detected-vsx.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-powerpc64|powerpc64le

#[cfg(target_arch = "powerpc64")]
fn main() {
is_powerpc64_feature_detected!("vsx");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "powerpc64"))]
fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/stdarch/is_powerpc_feature_detected-altivec.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// only-powerpc

#[cfg(target_arch = "powerpc")]
fn main() {
is_powerpc_feature_detected!("altivec");
//~^ ERROR use of unstable library feature
}

#[cfg(not(target_arch = "powerpc"))]
fn main() {}
Loading