Skip to content

Commit

Permalink
Remove #![feature(stdsimd)] used for Miri/ThreadSanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Sep 23, 2023
1 parent 899352a commit 7a5fd09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bench/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![warn(rust_2018_idioms, single_use_lifetimes, unsafe_op_in_unsafe_fn)]
#![allow(dead_code, unused_extern_crates)]
#![allow(clippy::only_used_in_recursion)]
#![feature(asm_experimental_arch, core_intrinsics, stdsimd)]
#![feature(asm_experimental_arch, core_intrinsics)]

use std::{
hint::black_box,
Expand Down
4 changes: 4 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ fn main() {
if target_arch == "arm" && !version.probe(67, 2022, 11, 5) {
println!("cargo:rustc-cfg=portable_atomic_unstable_isa_attribute");
}
// https://github.com/rust-lang/rust/pull/109359 (includes https://github.com/rust-lang/stdarch/pull/1358) merged in Rust 1.70 (nightly-2023-03-24).
if target_arch == "x86_64" && !version.probe(70, 2023, 3, 23) {
println!("cargo:rustc-cfg=portable_atomic_unstable_cmpxchg16b_intrinsic");
}

// `cfg(sanitize = "..")` is not stabilized.
let sanitize = env::var("CARGO_CFG_SANITIZE").unwrap_or_default();
Expand Down
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,13 @@ RUSTFLAGS="--cfg portable_atomic_no_outline_atomics" cargo ...
),
feature(core_intrinsics)
)]
// This feature will be unnecessary once stdarch submodule in rust-lang/rust is
// updated to include https://github.com/rust-lang/stdarch/pull/1358.
// This feature is only enabled for old nightly.
#![cfg_attr(
all(target_arch = "x86_64", any(miri, portable_atomic_sanitize_thread)),
all(
target_arch = "x86_64",
portable_atomic_unstable_cmpxchg16b_intrinsic,
any(miri, portable_atomic_sanitize_thread),
),
feature(stdsimd)
)]
// docs.rs only
Expand Down

0 comments on commit 7a5fd09

Please sign in to comment.