From b2375fb9e2616e5f600752672c9b34d4df703348 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 29 Jul 2023 14:32:19 -0700 Subject: [PATCH 1/3] Ignore an AVR-inapplicable test --- tests/codegen/abi-main-signature-32bit-c-int.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/codegen/abi-main-signature-32bit-c-int.rs b/tests/codegen/abi-main-signature-32bit-c-int.rs index 0258ad9534b1b..34571823f1360 100644 --- a/tests/codegen/abi-main-signature-32bit-c-int.rs +++ b/tests/codegen/abi-main-signature-32bit-c-int.rs @@ -3,6 +3,7 @@ // This test is for targets with 32bit c_int only. // ignore-msp430 +// ignore-avr fn main() { } From 040bc3447e3d43ce79dee8420f4ab05d6aa3a8c7 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 29 Jul 2023 15:15:23 -0700 Subject: [PATCH 2/3] mv tests/codegen/repr-* tests/codegen/repr Slightly more complicated: also give them appropriate names that somewhat describe the cases they are trying to cover, using information from PR chatter in rust-lang/rust#47158 --- .../transparent-imm-array.rs} | 0 .../transparent-mips64.rs} | 0 .../transparent-struct-ptr.rs} | 0 .../{repr-transparent-sysv64.rs => repr/transparent-sysv64.rs} | 0 tests/codegen/{repr-transparent.rs => repr/transparent.rs} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename tests/codegen/{repr-transparent-aggregates-2.rs => repr/transparent-imm-array.rs} (100%) rename tests/codegen/{repr-transparent-aggregates-3.rs => repr/transparent-mips64.rs} (100%) rename tests/codegen/{repr-transparent-aggregates-1.rs => repr/transparent-struct-ptr.rs} (100%) rename tests/codegen/{repr-transparent-sysv64.rs => repr/transparent-sysv64.rs} (100%) rename tests/codegen/{repr-transparent.rs => repr/transparent.rs} (100%) diff --git a/tests/codegen/repr-transparent-aggregates-2.rs b/tests/codegen/repr/transparent-imm-array.rs similarity index 100% rename from tests/codegen/repr-transparent-aggregates-2.rs rename to tests/codegen/repr/transparent-imm-array.rs diff --git a/tests/codegen/repr-transparent-aggregates-3.rs b/tests/codegen/repr/transparent-mips64.rs similarity index 100% rename from tests/codegen/repr-transparent-aggregates-3.rs rename to tests/codegen/repr/transparent-mips64.rs diff --git a/tests/codegen/repr-transparent-aggregates-1.rs b/tests/codegen/repr/transparent-struct-ptr.rs similarity index 100% rename from tests/codegen/repr-transparent-aggregates-1.rs rename to tests/codegen/repr/transparent-struct-ptr.rs diff --git a/tests/codegen/repr-transparent-sysv64.rs b/tests/codegen/repr/transparent-sysv64.rs similarity index 100% rename from tests/codegen/repr-transparent-sysv64.rs rename to tests/codegen/repr/transparent-sysv64.rs diff --git a/tests/codegen/repr-transparent.rs b/tests/codegen/repr/transparent.rs similarity index 100% rename from tests/codegen/repr-transparent.rs rename to tests/codegen/repr/transparent.rs From 20ebbf467d5bc6eca39ca014c4258aa6835b18db Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 29 Jul 2023 14:57:53 -0700 Subject: [PATCH 3/3] Replace ignore-everything with only-arch Combining revisions with only-arch allows specifying that a test only applies to a handful of targets. This allows removing a large amount of repetition in the test suite for tests that do not benefit. The revisions are suboptimal for this for some tests, so they aren't preferred in those cases. --- .../codegen/abi-main-signature-16bit-c-int.rs | 20 ++------- tests/codegen/global_asm.rs | 24 ++-------- tests/codegen/global_asm_include.rs | 24 ++-------- tests/codegen/global_asm_x2.rs | 24 ++-------- tests/codegen/repr/transparent-imm-array.rs | 22 ++++------ tests/codegen/repr/transparent-mips64.rs | 2 +- tests/codegen/repr/transparent-struct-ptr.rs | 22 +++++----- tests/codegen/repr/transparent.rs | 9 ++-- tests/debuginfo/thread-names.rs | 13 ++---- tests/ui/abi/stack-probes-lto.rs | 12 ++--- tests/ui/abi/stack-probes.rs | 11 ++--- tests/ui/target-feature/gate.rs | 15 +------ tests/ui/target-feature/gate.stderr | 2 +- tests/ui/target-feature/invalid-attribute.rs | 14 +----- .../target-feature/invalid-attribute.stderr | 44 +++++++++---------- 15 files changed, 74 insertions(+), 184 deletions(-) diff --git a/tests/codegen/abi-main-signature-16bit-c-int.rs b/tests/codegen/abi-main-signature-16bit-c-int.rs index 353e7489b5528..ce4d35dea0c83 100644 --- a/tests/codegen/abi-main-signature-16bit-c-int.rs +++ b/tests/codegen/abi-main-signature-16bit-c-int.rs @@ -2,22 +2,10 @@ // entry point. It must match C's `int main(int, char **)`. // This test is for targets with 16bit c_int only. -// ignore-aarch64 -// ignore-arm -// ignore-asmjs -// ignore-hexagon -// ignore-mips -// ignore-mips64 -// ignore-powerpc -// ignore-powerpc64 -// ignore-riscv64 -// ignore-s390x -// ignore-sparc -// ignore-sparc64 -// ignore-wasm32 -// ignore-x86 -// ignore-x86_64 -// ignore-loongarch64 +// revisions: avr msp +//[avr] only-avr +//[msp] only-msp430 + fn main() { } diff --git a/tests/codegen/global_asm.rs b/tests/codegen/global_asm.rs index 41a99530ad2a7..4c2ccf4e0e951 100644 --- a/tests/codegen/global_asm.rs +++ b/tests/codegen/global_asm.rs @@ -1,24 +1,6 @@ -// ignore-aarch64 -// ignore-arm -// ignore-avr -// ignore-bpf -// ignore-bpf -// ignore-hexagon -// ignore-mips -// ignore-mips64 -// ignore-msp430 -// ignore-powerpc64 -// ignore-powerpc -// ignore-sparc -// ignore-sparc64 -// ignore-s390x -// ignore-thumb -// ignore-nvptx64 -// ignore-spirv -// ignore-wasm32 -// ignore-wasm64 -// ignore-emscripten -// ignore-loongarch64 +// revisions: x32 x64 +//[x32] only-x86 +//[x64] only-x86_64 // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] diff --git a/tests/codegen/global_asm_include.rs b/tests/codegen/global_asm_include.rs index e25c164f4075c..0fede8c71e44c 100644 --- a/tests/codegen/global_asm_include.rs +++ b/tests/codegen/global_asm_include.rs @@ -1,24 +1,6 @@ -// ignore-aarch64 -// ignore-arm -// ignore-avr -// ignore-bpf -// ignore-bpf -// ignore-hexagon -// ignore-mips -// ignore-mips64 -// ignore-msp430 -// ignore-powerpc64 -// ignore-powerpc -// ignore-sparc -// ignore-sparc64 -// ignore-s390x -// ignore-thumb -// ignore-nvptx64 -// ignore-spirv -// ignore-wasm32 -// ignore-wasm64 -// ignore-emscripten -// ignore-loongarch64 +// revisions: x32 x64 +//[x32] only-x86 +//[x64] only-x86_64 // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] diff --git a/tests/codegen/global_asm_x2.rs b/tests/codegen/global_asm_x2.rs index 71ecef124f1f1..1fc2825b2bd40 100644 --- a/tests/codegen/global_asm_x2.rs +++ b/tests/codegen/global_asm_x2.rs @@ -1,24 +1,6 @@ -// ignore-aarch64 -// ignore-arm -// ignore-avr -// ignore-bpf -// ignore-bpf -// ignore-hexagon -// ignore-mips -// ignore-mips64 -// ignore-msp430 -// ignore-powerpc64 -// ignore-powerpc -// ignore-sparc -// ignore-sparc64 -// ignore-s390x -// ignore-thumb -// ignore-nvptx64 -// ignore-spirv -// ignore-wasm32 -// ignore-wasm64 -// ignore-emscripten -// ignore-loongarch64 +// revisions: x32 x64 +//[x32] only-x86 +//[x64] only-x86_64 // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] diff --git a/tests/codegen/repr/transparent-imm-array.rs b/tests/codegen/repr/transparent-imm-array.rs index 33f4f222b0af6..6d71277850957 100644 --- a/tests/codegen/repr/transparent-imm-array.rs +++ b/tests/codegen/repr/transparent-imm-array.rs @@ -1,19 +1,15 @@ +// revisions: arm mips thumb wasm32 // compile-flags: -C no-prepopulate-passes // - -// ignore-aarch64 +//[arm] only-arm +//[mips] only-mips +//[thumb] only-thumb +//[wasm32] only-wasm32 // ignore-emscripten -// ignore-mips64 -// ignore-powerpc -// ignore-powerpc64 -// ignore-riscv64 see codegen/riscv-abi -// ignore-s390x -// ignore-sparc -// ignore-sparc64 -// ignore-x86 -// ignore-x86_64 -// ignore-loongarch64 -// See repr-transparent.rs +// See ./transparent.rs +// Some platforms pass large aggregates using immediate arrays in LLVMIR +// Other platforms pass large aggregates using struct pointer in LLVMIR +// This covers the "immediate array" case. #![feature(transparent_unions)] diff --git a/tests/codegen/repr/transparent-mips64.rs b/tests/codegen/repr/transparent-mips64.rs index 0db17e6b13a80..245daf13e28fc 100644 --- a/tests/codegen/repr/transparent-mips64.rs +++ b/tests/codegen/repr/transparent-mips64.rs @@ -2,7 +2,7 @@ // // only-mips64 -// See repr-transparent.rs +// See ./transparent.rs #![feature(transparent_unions)] diff --git a/tests/codegen/repr/transparent-struct-ptr.rs b/tests/codegen/repr/transparent-struct-ptr.rs index c783a75a400ab..d2120f7ec1434 100644 --- a/tests/codegen/repr/transparent-struct-ptr.rs +++ b/tests/codegen/repr/transparent-struct-ptr.rs @@ -1,18 +1,16 @@ +// revisions: x32 x64 sparc sparc64 // compile-flags: -O -C no-prepopulate-passes // - -// ignore-arm -// ignore-aarch64 -// ignore-mips -// ignore-mips64 -// ignore-powerpc -// ignore-powerpc64 -// ignore-riscv64 see codegen/riscv-abi -// ignore-s390x +//[x32] only-x86 +//[x64] only-x86_64 +//[sparc] only-sparc +//[sparc64] only-sparc64 // ignore-windows -// ignore-loongarch64 -// ignore-wasm32-bare -// See repr-transparent.rs +// See ./transparent.rs +// Some platforms pass large aggregates using immediate arrays in LLVMIR +// Other platforms pass large aggregates using struct pointer in LLVMIR +// This covers the "struct pointer" case. + #![feature(transparent_unions)] diff --git a/tests/codegen/repr/transparent.rs b/tests/codegen/repr/transparent.rs index 64f3ce5a43ca2..b140fc719daf3 100644 --- a/tests/codegen/repr/transparent.rs +++ b/tests/codegen/repr/transparent.rs @@ -1,10 +1,13 @@ // compile-flags: -O -C no-prepopulate-passes - // ignore-riscv64 riscv64 has an i128 type used with test_Vector -// see codegen/riscv-abi for riscv functiona call tests // ignore-s390x s390x with default march passes vector types per reference // ignore-loongarch64 see codegen/loongarch-abi for loongarch function call tests +// This codegen test embeds assumptions about how certain "C" psABIs are handled +// so it doesn't apply to all architectures or even all OS +// For RISCV: see codegen/riscv-abi +// For LoongArch: see codegen/loongarch-abi + #![crate_type="lib"] #![feature(repr_simd, transparent_unions)] @@ -159,7 +162,7 @@ pub union UnionF32WithZsts { pub extern "C" fn test_UnionF32WithZsts(_: UnionF32WithZsts) -> UnionF32WithZsts { loop {} } -// All that remains to be tested are aggregates. They are tested in separate files called repr- +// All that remains to be tested are aggregates. They are tested in separate files called // transparent-*.rs with `only-*` or `ignore-*` directives, because the expected LLVM IR // function signatures vary so much that it's not reasonably possible to cover all of them with a // single CHECK line. diff --git a/tests/debuginfo/thread-names.rs b/tests/debuginfo/thread-names.rs index 7a35a5189463a..2c5b3f272e042 100644 --- a/tests/debuginfo/thread-names.rs +++ b/tests/debuginfo/thread-names.rs @@ -1,15 +1,8 @@ // compile-flags:-g +// revisions: macos windows // We can't set the main thread name on Linux because it renames the process (#97191) -// ignore-linux -// ignore-android -// ignore-dragonfly -// ignore-emscripten -// ignore-freebsd -// ignore-haiku -// ignore-ios -// ignore-netbsd -// ignore-openbsd -// ignore-solaris +//[macos] only-macos +//[windows] only-windows // ignore-sgx // ignore-windows-gnu diff --git a/tests/ui/abi/stack-probes-lto.rs b/tests/ui/abi/stack-probes-lto.rs index 0dccb633df983..7282d09706c1a 100644 --- a/tests/ui/abi/stack-probes-lto.rs +++ b/tests/ui/abi/stack-probes-lto.rs @@ -1,13 +1,7 @@ +// revisions: x32 x64 // run-pass -// ignore-arm -// ignore-aarch64 -// ignore-mips -// ignore-mips64 -// ignore-sparc -// ignore-sparc64 -// ignore-loongarch64 -// ignore-wasm -// ignore-emscripten no processes +//[x32] only-x86 +//[x64] only-x86_64 // ignore-sgx no processes // ignore-musl FIXME #31506 // ignore-fuchsia no exception handler registered for segfault diff --git a/tests/ui/abi/stack-probes.rs b/tests/ui/abi/stack-probes.rs index 8137c92304d83..4b8a79a4b685a 100644 --- a/tests/ui/abi/stack-probes.rs +++ b/tests/ui/abi/stack-probes.rs @@ -1,12 +1,7 @@ +// revisions: x32 x64 // run-pass -// ignore-arm -// ignore-aarch64 -// ignore-mips -// ignore-mips64 -// ignore-sparc -// ignore-sparc64 -// ignore-loongarch64 -// ignore-wasm +//[x32] only-x86 +//[x64] only-x86_64 // ignore-emscripten no processes // ignore-sgx no processes // ignore-fuchsia no exception handler registered for segfault diff --git a/tests/ui/target-feature/gate.rs b/tests/ui/target-feature/gate.rs index 8d1765eb8e9d9..3ebd2dbceaa3a 100644 --- a/tests/ui/target-feature/gate.rs +++ b/tests/ui/target-feature/gate.rs @@ -1,16 +1,5 @@ -// ignore-arm -// ignore-aarch64 -// ignore-wasm -// ignore-emscripten -// ignore-mips -// ignore-mips64 -// ignore-powerpc -// ignore-powerpc64 -// ignore-riscv64 -// ignore-sparc -// ignore-sparc64 -// ignore-s390x -// ignore-loongarch64 +// only-x86_64 +// // gate-test-sse4a_target_feature // gate-test-powerpc_target_feature // gate-test-avx512_target_feature diff --git a/tests/ui/target-feature/gate.stderr b/tests/ui/target-feature/gate.stderr index ee542b60a2634..896212e42fc7c 100644 --- a/tests/ui/target-feature/gate.stderr +++ b/tests/ui/target-feature/gate.stderr @@ -1,5 +1,5 @@ error[E0658]: the target feature `avx512bw` is currently unstable - --> $DIR/gate.rs:32:18 + --> $DIR/gate.rs:21:18 | LL | #[target_feature(enable = "avx512bw")] | ^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/target-feature/invalid-attribute.rs b/tests/ui/target-feature/invalid-attribute.rs index 77fd8b85f3f4d..d1b3cf71c15ef 100644 --- a/tests/ui/target-feature/invalid-attribute.rs +++ b/tests/ui/target-feature/invalid-attribute.rs @@ -1,16 +1,4 @@ -// ignore-arm -// ignore-aarch64 -// ignore-wasm -// ignore-emscripten -// ignore-mips -// ignore-mips64 -// ignore-powerpc -// ignore-powerpc64 -// ignore-riscv64 -// ignore-s390x -// ignore-sparc -// ignore-sparc64 -// ignore-loongarch64 +// only-x86_64 #![warn(unused_attributes)] diff --git a/tests/ui/target-feature/invalid-attribute.stderr b/tests/ui/target-feature/invalid-attribute.stderr index 6d37d0917bc61..29c73921c5388 100644 --- a/tests/ui/target-feature/invalid-attribute.stderr +++ b/tests/ui/target-feature/invalid-attribute.stderr @@ -1,11 +1,11 @@ error: malformed `target_feature` attribute input - --> $DIR/invalid-attribute.rs:32:1 + --> $DIR/invalid-attribute.rs:20:1 | LL | #[target_feature = "+sse2"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[target_feature(enable = "name")]` error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:17:1 + --> $DIR/invalid-attribute.rs:5:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | extern crate alloc; | ------------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:22:1 + --> $DIR/invalid-attribute.rs:10:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | use alloc::alloc::alloc; | ------------------------ not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:27:1 + --> $DIR/invalid-attribute.rs:15:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -32,7 +32,7 @@ LL | extern "Rust" {} | ---------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:49:1 + --> $DIR/invalid-attribute.rs:37:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -41,7 +41,7 @@ LL | mod another {} | -------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:54:1 + --> $DIR/invalid-attribute.rs:42:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -50,7 +50,7 @@ LL | const FOO: usize = 7; | --------------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:59:1 + --> $DIR/invalid-attribute.rs:47:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -59,7 +59,7 @@ LL | struct Foo; | ----------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:64:1 + --> $DIR/invalid-attribute.rs:52:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -68,7 +68,7 @@ LL | enum Bar {} | ----------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:69:1 + --> $DIR/invalid-attribute.rs:57:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -81,7 +81,7 @@ LL | | } | |_- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:77:1 + --> $DIR/invalid-attribute.rs:65:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -90,7 +90,7 @@ LL | type Uwu = (); | -------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:82:1 + --> $DIR/invalid-attribute.rs:70:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -99,7 +99,7 @@ LL | trait Baz {} | ------------ not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:92:1 + --> $DIR/invalid-attribute.rs:80:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -108,7 +108,7 @@ LL | static A: () = (); | ------------------ not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:97:1 + --> $DIR/invalid-attribute.rs:85:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -117,7 +117,7 @@ LL | impl Quux for u8 {} | ------------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:102:1 + --> $DIR/invalid-attribute.rs:90:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -126,7 +126,7 @@ LL | impl Foo {} | ----------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:120:5 + --> $DIR/invalid-attribute.rs:108:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -138,7 +138,7 @@ LL | | } | |_____- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:128:5 + --> $DIR/invalid-attribute.rs:116:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -147,25 +147,25 @@ LL | || {}; | ----- not a function definition error: the feature named `foo` is not valid for this target - --> $DIR/invalid-attribute.rs:34:18 + --> $DIR/invalid-attribute.rs:22:18 | LL | #[target_feature(enable = "foo")] | ^^^^^^^^^^^^^^ `foo` is not valid for this target error: malformed `target_feature` attribute input - --> $DIR/invalid-attribute.rs:37:18 + --> $DIR/invalid-attribute.rs:25:18 | LL | #[target_feature(bar)] | ^^^ help: must be of the form: `enable = ".."` error: malformed `target_feature` attribute input - --> $DIR/invalid-attribute.rs:39:18 + --> $DIR/invalid-attribute.rs:27:18 | LL | #[target_feature(disable = "baz")] | ^^^^^^^^^^^^^^^ help: must be of the form: `enable = ".."` error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions - --> $DIR/invalid-attribute.rs:43:1 + --> $DIR/invalid-attribute.rs:31:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -177,13 +177,13 @@ LL | fn bar() {} = help: add `#![feature(target_feature_11)]` to the crate attributes to enable error: cannot use `#[inline(always)]` with `#[target_feature]` - --> $DIR/invalid-attribute.rs:87:1 + --> $DIR/invalid-attribute.rs:75:1 | LL | #[inline(always)] | ^^^^^^^^^^^^^^^^^ error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions - --> $DIR/invalid-attribute.rs:112:5 + --> $DIR/invalid-attribute.rs:100:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^