diff --git a/ci/dox.sh b/ci/dox.sh index 9803f7e371..d65192688f 100755 --- a/ci/dox.sh +++ b/ci/dox.sh @@ -22,6 +22,7 @@ dox() { export CARGO_UNSTABLE_BUILD_STD=core # amdgpu needs a target-cpu, any is fine export RUSTFLAGS="${RUSTFLAGS} -Ctarget-cpu=gfx900" + export RUSTDOCFLAGS="${RUSTDOCFLAGS} -Ctarget-cpu=gfx900" fi cargo build --verbose --target "${1}" --manifest-path crates/core_arch/Cargo.toml diff --git a/ci/run.sh b/ci/run.sh index ea012b42f9..8c75df6afb 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -82,7 +82,7 @@ cargo_test() { else dir="debug" fi - export CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/$dir/deps::." + export CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/$dir/build::." cmd="$cmd --nocapture" ;; esac diff --git a/crates/core_arch/src/aarch64/sve/mod.rs b/crates/core_arch/src/aarch64/sve/mod.rs index f11ca660b1..41fd12d351 100644 --- a/crates/core_arch/src/aarch64/sve/mod.rs +++ b/crates/core_arch/src/aarch64/sve/mod.rs @@ -39,7 +39,7 @@ impl SveInto for T { macro_rules! impl_sve_type { ($(($v:vis, $elem_type:ty, $name:ident, $elt:literal))*) => ($( #[doc = concat!("Scalable vector of type ", stringify!($elem_type))] - #[derive(Clone, Copy, Debug)] + #[derive(Clone, Copy)] #[rustc_scalable_vector($elt)] #[unstable(feature = "stdarch_aarch64_sve", issue = "145052")] $v struct $name($elem_type); @@ -52,21 +52,21 @@ macro_rules! impl_sve_tuple_type { )*); (@ ($v:vis, $vec_type:ty, 2, $name:ident)) => ( #[doc = concat!("Two-element tuple of scalable vectors of type ", stringify!($vec_type))] - #[derive(Clone, Copy, Debug)] + #[derive(Clone, Copy)] #[rustc_scalable_vector] #[unstable(feature = "stdarch_aarch64_sve", issue = "145052")] $v struct $name($vec_type, $vec_type); ); (@ ($v:vis, $vec_type:ty, 3, $name:ident)) => ( #[doc = concat!("Three-element tuple of scalable vectors of type ", stringify!($vec_type))] - #[derive(Clone, Copy, Debug)] + #[derive(Clone, Copy)] #[rustc_scalable_vector] #[unstable(feature = "stdarch_aarch64_sve", issue = "145052")] $v struct $name($vec_type, $vec_type, $vec_type); ); (@ ($v:vis, $vec_type:ty, 4, $name:ident)) => ( #[doc = concat!("Four-element tuple of scalable vectors of type ", stringify!($vec_type))] - #[derive(Clone, Copy, Debug)] + #[derive(Clone, Copy)] #[rustc_scalable_vector] #[unstable(feature = "stdarch_aarch64_sve", issue = "145052")] $v struct $name($vec_type, $vec_type, $vec_type, $vec_type); diff --git a/crates/core_arch/src/amdgpu/mod.rs b/crates/core_arch/src/amdgpu/mod.rs index 374f582696..264240c505 100644 --- a/crates/core_arch/src/amdgpu/mod.rs +++ b/crates/core_arch/src/amdgpu/mod.rs @@ -360,6 +360,7 @@ pub unsafe fn sched_barrier() { /// sched_group_barrier::<8, 5, 0>() /// ``` /// +#[doc(cfg(target_arch = "amdgpu"))] #[doc = include_str!("intrinsic_is_convergent.md")] #[inline] #[unstable(feature = "stdarch_amdgpu", issue = "149988")] diff --git a/crates/core_arch/src/wasm32/simd128.rs b/crates/core_arch/src/wasm32/simd128.rs index e1a3754965..b52702f44e 100644 --- a/crates/core_arch/src/wasm32/simd128.rs +++ b/crates/core_arch/src/wasm32/simd128.rs @@ -4323,7 +4323,7 @@ mod tests { let vec = i64x2_load_extend_i32x2(arr.as_ptr()); compare_bytes(vec, i64x2(-1, 1)); let vec = i64x2_load_extend_u32x2(arr.as_ptr() as *const u32); - compare_bytes(vec, i64x2(u32::max_value().into(), 1)); + compare_bytes(vec, i64x2(u32::MAX.into(), 1)); } } diff --git a/crates/core_arch/src/x86/mod.rs b/crates/core_arch/src/x86/mod.rs index fbf1002eab..fb6ecd3616 100644 --- a/crates/core_arch/src/x86/mod.rs +++ b/crates/core_arch/src/x86/mod.rs @@ -40,6 +40,7 @@ types! { /// # Examples /// /// ``` + /// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))] /// #[cfg(target_arch = "x86")] /// use std::arch::x86::*; /// #[cfg(target_arch = "x86_64")] @@ -56,6 +57,7 @@ types! { /// # if is_x86_feature_detected!("sse2") { unsafe { foo() } } /// # } /// ``` + #[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))] pub struct __m128i(2 x i64); /// 128-bit wide set of four `f32` types, x86-specific @@ -83,6 +85,7 @@ types! { /// # Examples /// /// ``` + /// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))] /// #[cfg(target_arch = "x86")] /// use std::arch::x86::*; /// #[cfg(target_arch = "x86_64")] @@ -99,6 +102,7 @@ types! { /// # if is_x86_feature_detected!("sse") { unsafe { foo() } } /// # } /// ``` + #[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))] pub struct __m128(4 x f32); /// 128-bit wide set of two `f64` types, x86-specific @@ -126,6 +130,7 @@ types! { /// # Examples /// /// ``` + /// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))] /// #[cfg(target_arch = "x86")] /// use std::arch::x86::*; /// #[cfg(target_arch = "x86_64")] @@ -142,6 +147,7 @@ types! { /// # if is_x86_feature_detected!("sse2") { unsafe { foo() } } /// # } /// ``` + #[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))] pub struct __m128d(2 x f64); /// 256-bit wide integer vector type, x86-specific @@ -173,6 +179,7 @@ types! { /// # Examples /// /// ``` + /// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))] /// #[cfg(target_arch = "x86")] /// use std::arch::x86::*; /// #[cfg(target_arch = "x86_64")] @@ -189,6 +196,7 @@ types! { /// # if is_x86_feature_detected!("avx") { unsafe { foo() } } /// # } /// ``` + #[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))] pub struct __m256i(4 x i64); /// 256-bit wide set of eight `f32` types, x86-specific @@ -216,6 +224,7 @@ types! { /// # Examples /// /// ``` + /// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))] /// #[cfg(target_arch = "x86")] /// use std::arch::x86::*; /// #[cfg(target_arch = "x86_64")] @@ -232,6 +241,7 @@ types! { /// # if is_x86_feature_detected!("avx") { unsafe { foo() } } /// # } /// ``` + #[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))] pub struct __m256(8 x f32); /// 256-bit wide set of four `f64` types, x86-specific @@ -259,6 +269,7 @@ types! { /// # Examples /// /// ``` + /// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))] /// #[cfg(target_arch = "x86")] /// use std::arch::x86::*; /// #[cfg(target_arch = "x86_64")] @@ -275,6 +286,7 @@ types! { /// # if is_x86_feature_detected!("avx") { unsafe { foo() } } /// # } /// ``` + #[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))] pub struct __m256d(4 x f64); } diff --git a/crates/core_arch/src/x86/sse2.rs b/crates/core_arch/src/x86/sse2.rs index 5e8fe959c3..66ebec22e1 100644 --- a/crates/core_arch/src/x86/sse2.rs +++ b/crates/core_arch/src/x86/sse2.rs @@ -3332,7 +3332,7 @@ mod tests { core_arch::{simd::*, x86::*}, hint::black_box, }; - use std::{boxed, f32, f64, mem, ptr}; + use std::{boxed, mem, ptr}; use stdarch_test::simd_test; const NAN: f64 = f64::NAN; diff --git a/crates/stdarch-test/src/wasm.rs b/crates/stdarch-test/src/wasm.rs index bf411c1214..feadaa1215 100644 --- a/crates/stdarch-test/src/wasm.rs +++ b/crates/stdarch-test/src/wasm.rs @@ -2,6 +2,7 @@ use crate::Function; use std::collections::HashSet; +use std::path::Path; pub(crate) fn disassemble_myself() -> HashSet { // Use `std::env::args` to find the path to our executable. Assume the @@ -11,6 +12,27 @@ pub(crate) fn disassemble_myself() -> HashSet { let me = std::env::args() .next() .expect("failed to find current wasm file"); + let me = Path::new(&me); + let me = if me.exists() { + // Old build-dir layout + me.to_path_buf() + } else { + // Cargo's build-dir layout stores an artifact named + // `-.wasm` at `//out/-.wasm`. + // The build directory is mounted as the WASI working directory, so + // reconstruct that guest-visible path from the executable name. + let file_name = me + .file_name() + .and_then(|name| name.to_str()) + .expect("current wasm file has a file name"); + let stem = file_name + .strip_suffix(".wasm") + .expect("current wasm file does not have a .wasm extension"); + let (crate_name, hash) = stem + .rsplit_once('-') + .expect("current wasm file name does not contain an artifact hash"); + Path::new(crate_name).join(hash).join("out").join(file_name) + }; let output = wasmprinter::print_file(&me).unwrap(); let mut ret: HashSet = HashSet::new();