From 00feedcb312228532460cd8f197b518ec74a8911 Mon Sep 17 00:00:00 2001 From: Tom Vijlbrief Date: Fri, 13 Jun 2025 10:49:00 +0200 Subject: [PATCH 001/183] Add modern AVR mcus like avr128db28 and attiny3224 --- compiler/rustc_target/src/spec/base/avr.rs | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/compiler/rustc_target/src/spec/base/avr.rs b/compiler/rustc_target/src/spec/base/avr.rs index 85b73e61e52c..d2e4453d9570 100644 --- a/compiler/rustc_target/src/spec/base/avr.rs +++ b/compiler/rustc_target/src/spec/base/avr.rs @@ -322,6 +322,9 @@ pub fn ef_avr_arch(target_cpu: &str) -> u32 { "attiny1624" => elf::EF_AVR_ARCH_XMEGA3, "attiny1626" => elf::EF_AVR_ARCH_XMEGA3, "attiny1627" => elf::EF_AVR_ARCH_XMEGA3, + "attiny3224" => elf::EF_AVR_ARCH_XMEGA3, + "attiny3226" => elf::EF_AVR_ARCH_XMEGA3, + "attiny3227" => elf::EF_AVR_ARCH_XMEGA3, "atmega808" => elf::EF_AVR_ARCH_XMEGA3, "atmega809" => elf::EF_AVR_ARCH_XMEGA3, "atmega1608" => elf::EF_AVR_ARCH_XMEGA3, @@ -331,6 +334,49 @@ pub fn ef_avr_arch(target_cpu: &str) -> u32 { "atmega4808" => elf::EF_AVR_ARCH_XMEGA3, "atmega4809" => elf::EF_AVR_ARCH_XMEGA3, + "avr16dd20" => elf::EF_AVR_ARCH_XMEGA3, + "avr16dd28" => elf::EF_AVR_ARCH_XMEGA3, + "avr16dd32" => elf::EF_AVR_ARCH_XMEGA3, + "avr16du14" => elf::EF_AVR_ARCH_XMEGA3, + "avr16du20" => elf::EF_AVR_ARCH_XMEGA3, + "avr16du28" => elf::EF_AVR_ARCH_XMEGA3, + "avr16du32" => elf::EF_AVR_ARCH_XMEGA3, + "avr32da28" => elf::EF_AVR_ARCH_XMEGA3, + "avr32da32" => elf::EF_AVR_ARCH_XMEGA3, + "avr32da48" => elf::EF_AVR_ARCH_XMEGA3, + "avr32db28" => elf::EF_AVR_ARCH_XMEGA3, + "avr32db32" => elf::EF_AVR_ARCH_XMEGA3, + "avr32db48" => elf::EF_AVR_ARCH_XMEGA3, + "avr32dd14" => elf::EF_AVR_ARCH_XMEGA3, + "avr32dd20" => elf::EF_AVR_ARCH_XMEGA3, + "avr32dd28" => elf::EF_AVR_ARCH_XMEGA3, + "avr32dd32" => elf::EF_AVR_ARCH_XMEGA3, + "avr32du14" => elf::EF_AVR_ARCH_XMEGA3, + "avr32du20" => elf::EF_AVR_ARCH_XMEGA3, + "avr32du28" => elf::EF_AVR_ARCH_XMEGA3, + "avr32du32" => elf::EF_AVR_ARCH_XMEGA3, + "avr16eb14" => elf::EF_AVR_ARCH_XMEGA3, + "avr16eb20" => elf::EF_AVR_ARCH_XMEGA3, + "avr16eb28" => elf::EF_AVR_ARCH_XMEGA3, + "avr16eb32" => elf::EF_AVR_ARCH_XMEGA3, + "avr16ea28" => elf::EF_AVR_ARCH_XMEGA3, + "avr16ea32" => elf::EF_AVR_ARCH_XMEGA3, + "avr16ea48" => elf::EF_AVR_ARCH_XMEGA3, + "avr32ea28" => elf::EF_AVR_ARCH_XMEGA3, + "avr32ea32" => elf::EF_AVR_ARCH_XMEGA3, + "avr32ea48" => elf::EF_AVR_ARCH_XMEGA3, + "avr32sd20" => elf::EF_AVR_ARCH_XMEGA3, + "avr32sd28" => elf::EF_AVR_ARCH_XMEGA3, + "avr32sd32" => elf::EF_AVR_ARCH_XMEGA3, + "avr128da28" => elf::EF_AVR_ARCH_XMEGA4, + "avr128da32" => elf::EF_AVR_ARCH_XMEGA4, + "avr128da48" => elf::EF_AVR_ARCH_XMEGA4, + "avr128da64" => elf::EF_AVR_ARCH_XMEGA4, + "avr128db28" => elf::EF_AVR_ARCH_XMEGA4, + "avr128db32" => elf::EF_AVR_ARCH_XMEGA4, + "avr128db48" => elf::EF_AVR_ARCH_XMEGA4, + "avr128db64" => elf::EF_AVR_ARCH_XMEGA4, + // Unknown target CPU => Unspecified/generic code _ => 0, } From 1323fd6f73ffbd427bcb81e9766f68eccf1f531e Mon Sep 17 00:00:00 2001 From: Tom Vijlbrief Date: Fri, 13 Jun 2025 16:03:57 +0200 Subject: [PATCH 002/183] Add missing avr64* series --- compiler/rustc_target/src/spec/base/avr.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/compiler/rustc_target/src/spec/base/avr.rs b/compiler/rustc_target/src/spec/base/avr.rs index d2e4453d9570..fb3ebb509ad7 100644 --- a/compiler/rustc_target/src/spec/base/avr.rs +++ b/compiler/rustc_target/src/spec/base/avr.rs @@ -334,6 +334,27 @@ pub fn ef_avr_arch(target_cpu: &str) -> u32 { "atmega4808" => elf::EF_AVR_ARCH_XMEGA3, "atmega4809" => elf::EF_AVR_ARCH_XMEGA3, + "avr64da28" => elf::EF_AVR_ARCH_XMEGA2, + "avr64da32" => elf::EF_AVR_ARCH_XMEGA2, + "avr64da48" => elf::EF_AVR_ARCH_XMEGA2, + "avr64da64" => elf::EF_AVR_ARCH_XMEGA2, + "avr64db28" => elf::EF_AVR_ARCH_XMEGA2, + "avr64db32" => elf::EF_AVR_ARCH_XMEGA2, + "avr64db48" => elf::EF_AVR_ARCH_XMEGA2, + "avr64db64" => elf::EF_AVR_ARCH_XMEGA2, + "avr64dd14" => elf::EF_AVR_ARCH_XMEGA2, + "avr64dd20" => elf::EF_AVR_ARCH_XMEGA2, + "avr64dd28" => elf::EF_AVR_ARCH_XMEGA2, + "avr64dd32" => elf::EF_AVR_ARCH_XMEGA2, + "avr64du28" => elf::EF_AVR_ARCH_XMEGA2, + "avr64du32" => elf::EF_AVR_ARCH_XMEGA2, + "avr64ea28" => elf::EF_AVR_ARCH_XMEGA2, + "avr64ea32" => elf::EF_AVR_ARCH_XMEGA2, + "avr64ea48" => elf::EF_AVR_ARCH_XMEGA2, + "avr64sd28" => elf::EF_AVR_ARCH_XMEGA2, + "avr64sd32" => elf::EF_AVR_ARCH_XMEGA2, + "avr64sd48" => elf::EF_AVR_ARCH_XMEGA2, + "avr16dd20" => elf::EF_AVR_ARCH_XMEGA3, "avr16dd28" => elf::EF_AVR_ARCH_XMEGA3, "avr16dd32" => elf::EF_AVR_ARCH_XMEGA3, From d63e865a958a4e75e20b9b043c22b70094b9f0e1 Mon Sep 17 00:00:00 2001 From: WANG Rui Date: Sat, 28 Jun 2025 11:16:39 +0800 Subject: [PATCH 003/183] loongarch: Add basic support for LoongArch32 --- .../crates/core_arch/src/core_arch_docs.md | 2 + .../crates/core_arch/src/loongarch32/mod.rs | 47 ++++ .../crates/core_arch/src/loongarch64/mod.rs | 239 +---------------- .../core_arch/src/loongarch_shared/mod.rs | 244 ++++++++++++++++++ library/stdarch/crates/core_arch/src/mod.rs | 21 +- .../stdarch/crates/simd-test-macro/src/lib.rs | 2 +- library/stdarch/crates/std_detect/README.md | 2 +- .../std_detect/src/detect/arch/loongarch.rs | 2 +- .../crates/std_detect/src/detect/arch/mod.rs | 2 +- .../crates/std_detect/src/detect/mod.rs | 1 + .../std_detect/src/detect/os/linux/auxvec.rs | 2 + .../std_detect/src/detect/os/linux/mod.rs | 2 +- .../std_detect/tests/macro_trailing_commas.rs | 8 +- 13 files changed, 327 insertions(+), 247 deletions(-) create mode 100644 library/stdarch/crates/core_arch/src/loongarch32/mod.rs create mode 100644 library/stdarch/crates/core_arch/src/loongarch_shared/mod.rs diff --git a/library/stdarch/crates/core_arch/src/core_arch_docs.md b/library/stdarch/crates/core_arch/src/core_arch_docs.md index bfa1b7228860..6aea2b461846 100644 --- a/library/stdarch/crates/core_arch/src/core_arch_docs.md +++ b/library/stdarch/crates/core_arch/src/core_arch_docs.md @@ -193,6 +193,7 @@ others at: * [`powerpc64`] * [`nvptx`] * [`wasm32`] +* [`loongarch32`] * [`loongarch64`] * [`s390x`] @@ -208,6 +209,7 @@ others at: [`powerpc64`]: ../../core/arch/powerpc64/index.html [`nvptx`]: ../../core/arch/nvptx/index.html [`wasm32`]: ../../core/arch/wasm32/index.html +[`loongarch32`]: ../../core/arch/loongarch32/index.html [`loongarch64`]: ../../core/arch/loongarch64/index.html [`s390x`]: ../../core/arch/s390x/index.html diff --git a/library/stdarch/crates/core_arch/src/loongarch32/mod.rs b/library/stdarch/crates/core_arch/src/loongarch32/mod.rs new file mode 100644 index 000000000000..fb05450373c2 --- /dev/null +++ b/library/stdarch/crates/core_arch/src/loongarch32/mod.rs @@ -0,0 +1,47 @@ +//! `LoongArch32` intrinsics + +use crate::arch::asm; + +#[allow(improper_ctypes)] +unsafe extern "unadjusted" { + #[link_name = "llvm.loongarch.cacop.w"] + fn __cacop(a: i32, b: i32, c: i32); + #[link_name = "llvm.loongarch.csrrd.w"] + fn __csrrd(a: i32) -> i32; + #[link_name = "llvm.loongarch.csrwr.w"] + fn __csrwr(a: i32, b: i32) -> i32; + #[link_name = "llvm.loongarch.csrxchg.w"] + fn __csrxchg(a: i32, b: i32, c: i32) -> i32; +} + +/// Generates the cache operation instruction +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn cacop(a: i32, b: i32) { + static_assert_simm_bits!(IMM12, 12); + __cacop(a, b, IMM12); +} + +/// Reads the CSR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn csrrd() -> i32 { + static_assert_uimm_bits!(IMM14, 14); + __csrrd(IMM14) +} + +/// Writes the CSR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn csrwr(a: i32) -> i32 { + static_assert_uimm_bits!(IMM14, 14); + __csrwr(a, IMM14) +} + +/// Exchanges the CSR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn csrxchg(a: i32, b: i32) -> i32 { + static_assert_uimm_bits!(IMM14, 14); + __csrxchg(a, b, IMM14) +} diff --git a/library/stdarch/crates/core_arch/src/loongarch64/mod.rs b/library/stdarch/crates/core_arch/src/loongarch64/mod.rs index b1704bbb48d4..3f1bfbcd0e1e 100644 --- a/library/stdarch/crates/core_arch/src/loongarch64/mod.rs +++ b/library/stdarch/crates/core_arch/src/loongarch64/mod.rs @@ -1,4 +1,4 @@ -//! `LoongArch` intrinsics +//! `LoongArch64` intrinsics mod lasx; mod lsx; @@ -20,82 +20,24 @@ pub unsafe fn rdtime_d() -> (i64, isize) { (val, tid) } -/// Reads the lower 32-bit stable counter value and the counter ID -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn rdtimel_w() -> (i32, isize) { - let val: i32; - let tid: isize; - asm!("rdtimel.w {}, {}", out(reg) val, out(reg) tid, options(readonly, nostack)); - (val, tid) -} - -/// Reads the upper 32-bit stable counter value and the counter ID -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn rdtimeh_w() -> (i32, isize) { - let val: i32; - let tid: isize; - asm!("rdtimeh.w {}, {}", out(reg) val, out(reg) tid, options(readonly, nostack)); - (val, tid) -} - #[allow(improper_ctypes)] unsafe extern "unadjusted" { - #[link_name = "llvm.loongarch.crc.w.b.w"] - fn __crc_w_b_w(a: i32, b: i32) -> i32; - #[link_name = "llvm.loongarch.crc.w.h.w"] - fn __crc_w_h_w(a: i32, b: i32) -> i32; - #[link_name = "llvm.loongarch.crc.w.w.w"] - fn __crc_w_w_w(a: i32, b: i32) -> i32; #[link_name = "llvm.loongarch.crc.w.d.w"] fn __crc_w_d_w(a: i64, b: i32) -> i32; - #[link_name = "llvm.loongarch.crcc.w.b.w"] - fn __crcc_w_b_w(a: i32, b: i32) -> i32; - #[link_name = "llvm.loongarch.crcc.w.h.w"] - fn __crcc_w_h_w(a: i32, b: i32) -> i32; - #[link_name = "llvm.loongarch.crcc.w.w.w"] - fn __crcc_w_w_w(a: i32, b: i32) -> i32; #[link_name = "llvm.loongarch.crcc.w.d.w"] fn __crcc_w_d_w(a: i64, b: i32) -> i32; #[link_name = "llvm.loongarch.cacop.d"] fn __cacop(a: i64, b: i64, c: i64); - #[link_name = "llvm.loongarch.dbar"] - fn __dbar(a: i32); - #[link_name = "llvm.loongarch.ibar"] - fn __ibar(a: i32); - #[link_name = "llvm.loongarch.movgr2fcsr"] - fn __movgr2fcsr(a: i32, b: i32); - #[link_name = "llvm.loongarch.movfcsr2gr"] - fn __movfcsr2gr(a: i32) -> i32; #[link_name = "llvm.loongarch.csrrd.d"] fn __csrrd(a: i32) -> i64; #[link_name = "llvm.loongarch.csrwr.d"] fn __csrwr(a: i64, b: i32) -> i64; #[link_name = "llvm.loongarch.csrxchg.d"] fn __csrxchg(a: i64, b: i64, c: i32) -> i64; - #[link_name = "llvm.loongarch.iocsrrd.b"] - fn __iocsrrd_b(a: i32) -> i32; - #[link_name = "llvm.loongarch.iocsrrd.h"] - fn __iocsrrd_h(a: i32) -> i32; - #[link_name = "llvm.loongarch.iocsrrd.w"] - fn __iocsrrd_w(a: i32) -> i32; #[link_name = "llvm.loongarch.iocsrrd.d"] fn __iocsrrd_d(a: i32) -> i64; - #[link_name = "llvm.loongarch.iocsrwr.b"] - fn __iocsrwr_b(a: i32, b: i32); - #[link_name = "llvm.loongarch.iocsrwr.h"] - fn __iocsrwr_h(a: i32, b: i32); - #[link_name = "llvm.loongarch.iocsrwr.w"] - fn __iocsrwr_w(a: i32, b: i32); #[link_name = "llvm.loongarch.iocsrwr.d"] fn __iocsrwr_d(a: i64, b: i32); - #[link_name = "llvm.loongarch.break"] - fn __break(a: i32); - #[link_name = "llvm.loongarch.cpucfg"] - fn __cpucfg(a: i32) -> i32; - #[link_name = "llvm.loongarch.syscall"] - fn __syscall(a: i32); #[link_name = "llvm.loongarch.asrtle.d"] fn __asrtle(a: i64, b: i64); #[link_name = "llvm.loongarch.asrtgt.d"] @@ -104,35 +46,6 @@ unsafe extern "unadjusted" { fn __lddir(a: i64, b: i64) -> i64; #[link_name = "llvm.loongarch.ldpte.d"] fn __ldpte(a: i64, b: i64); - #[link_name = "llvm.loongarch.frecipe.s"] - fn __frecipe_s(a: f32) -> f32; - #[link_name = "llvm.loongarch.frecipe.d"] - fn __frecipe_d(a: f64) -> f64; - #[link_name = "llvm.loongarch.frsqrte.s"] - fn __frsqrte_s(a: f32) -> f32; - #[link_name = "llvm.loongarch.frsqrte.d"] - fn __frsqrte_d(a: f64) -> f64; -} - -/// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crc_w_b_w(a: i32, b: i32) -> i32 { - __crc_w_b_w(a, b) -} - -/// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crc_w_h_w(a: i32, b: i32) -> i32 { - __crc_w_h_w(a, b) -} - -/// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crc_w_w_w(a: i32, b: i32) -> i32 { - __crc_w_w_w(a, b) } /// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) @@ -142,27 +55,6 @@ pub unsafe fn crc_w_d_w(a: i64, b: i32) -> i32 { __crc_w_d_w(a, b) } -/// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crcc_w_b_w(a: i32, b: i32) -> i32 { - __crcc_w_b_w(a, b) -} - -/// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crcc_w_h_w(a: i32, b: i32) -> i32 { - __crcc_w_h_w(a, b) -} - -/// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crcc_w_w_w(a: i32, b: i32) -> i32 { - __crcc_w_w_w(a, b) -} - /// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] @@ -178,38 +70,6 @@ pub unsafe fn cacop(a: i64, b: i64) { __cacop(a, b, IMM12); } -/// Generates the memory barrier instruction -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn dbar() { - static_assert_uimm_bits!(IMM15, 15); - __dbar(IMM15); -} - -/// Generates the instruction-fetch barrier instruction -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn ibar() { - static_assert_uimm_bits!(IMM15, 15); - __ibar(IMM15); -} - -/// Moves data from a GPR to the FCSR -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn movgr2fcsr(a: i32) { - static_assert_uimm_bits!(IMM5, 5); - __movgr2fcsr(IMM5, a); -} - -/// Moves data from a FCSR to the GPR -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn movfcsr2gr() -> i32 { - static_assert_uimm_bits!(IMM5, 5); - __movfcsr2gr(IMM5) -} - /// Reads the CSR #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] @@ -234,27 +94,6 @@ pub unsafe fn csrxchg(a: i64, b: i64) -> i64 { __csrxchg(a, b, IMM14) } -/// Reads the 8-bit IO-CSR -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn iocsrrd_b(a: i32) -> i32 { - __iocsrrd_b(a) -} - -/// Reads the 16-bit IO-CSR -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn iocsrrd_h(a: i32) -> i32 { - __iocsrrd_h(a) -} - -/// Reads the 32-bit IO-CSR -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn iocsrrd_w(a: i32) -> i32 { - __iocsrrd_w(a) -} - /// Reads the 64-bit IO-CSR #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] @@ -262,27 +101,6 @@ pub unsafe fn iocsrrd_d(a: i32) -> i64 { __iocsrrd_d(a) } -/// Writes the 8-bit IO-CSR -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn iocsrwr_b(a: i32, b: i32) { - __iocsrwr_b(a, b) -} - -/// Writes the 16-bit IO-CSR -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn iocsrwr_h(a: i32, b: i32) { - __iocsrwr_h(a, b) -} - -/// Writes the 32-bit IO-CSR -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn iocsrwr_w(a: i32, b: i32) { - __iocsrwr_w(a, b) -} - /// Writes the 64-bit IO-CSR #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] @@ -290,29 +108,6 @@ pub unsafe fn iocsrwr_d(a: i64, b: i32) { __iocsrwr_d(a, b) } -/// Generates the breakpoint instruction -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn brk() { - static_assert_uimm_bits!(IMM15, 15); - __break(IMM15); -} - -/// Reads the CPU configuration register -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn cpucfg(a: i32) -> i32 { - __cpucfg(a) -} - -/// Generates the syscall instruction -#[inline] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn syscall() { - static_assert_uimm_bits!(IMM15, 15); - __syscall(IMM15); -} - /// Generates the less-than-or-equal asseration instruction #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] @@ -342,35 +137,3 @@ pub unsafe fn lddir(a: i64) -> i64 { pub unsafe fn ldpte(a: i64) { __ldpte(a, B) } - -/// Calculate the approximate single-precision result of 1.0 divided -#[inline] -#[target_feature(enable = "frecipe")] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn frecipe_s(a: f32) -> f32 { - __frecipe_s(a) -} - -/// Calculate the approximate double-precision result of 1.0 divided -#[inline] -#[target_feature(enable = "frecipe")] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn frecipe_d(a: f64) -> f64 { - __frecipe_d(a) -} - -/// Calculate the approximate single-precision result of dividing 1.0 by the square root -#[inline] -#[target_feature(enable = "frecipe")] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn frsqrte_s(a: f32) -> f32 { - __frsqrte_s(a) -} - -/// Calculate the approximate double-precision result of dividing 1.0 by the square root -#[inline] -#[target_feature(enable = "frecipe")] -#[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn frsqrte_d(a: f64) -> f64 { - __frsqrte_d(a) -} diff --git a/library/stdarch/crates/core_arch/src/loongarch_shared/mod.rs b/library/stdarch/crates/core_arch/src/loongarch_shared/mod.rs new file mode 100644 index 000000000000..da716ffd279e --- /dev/null +++ b/library/stdarch/crates/core_arch/src/loongarch_shared/mod.rs @@ -0,0 +1,244 @@ +//! `Shared LoongArch` intrinsics + +use crate::arch::asm; + +/// Reads the lower 32-bit stable counter value and the counter ID +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn rdtimel_w() -> (i32, isize) { + let val: i32; + let tid: isize; + asm!("rdtimel.w {}, {}", out(reg) val, out(reg) tid, options(readonly, nostack)); + (val, tid) +} + +/// Reads the upper 32-bit stable counter value and the counter ID +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn rdtimeh_w() -> (i32, isize) { + let val: i32; + let tid: isize; + asm!("rdtimeh.w {}, {}", out(reg) val, out(reg) tid, options(readonly, nostack)); + (val, tid) +} + +#[allow(improper_ctypes)] +unsafe extern "unadjusted" { + #[link_name = "llvm.loongarch.crc.w.b.w"] + fn __crc_w_b_w(a: i32, b: i32) -> i32; + #[link_name = "llvm.loongarch.crc.w.h.w"] + fn __crc_w_h_w(a: i32, b: i32) -> i32; + #[link_name = "llvm.loongarch.crc.w.w.w"] + fn __crc_w_w_w(a: i32, b: i32) -> i32; + #[link_name = "llvm.loongarch.crcc.w.b.w"] + fn __crcc_w_b_w(a: i32, b: i32) -> i32; + #[link_name = "llvm.loongarch.crcc.w.h.w"] + fn __crcc_w_h_w(a: i32, b: i32) -> i32; + #[link_name = "llvm.loongarch.crcc.w.w.w"] + fn __crcc_w_w_w(a: i32, b: i32) -> i32; + #[link_name = "llvm.loongarch.dbar"] + fn __dbar(a: i32); + #[link_name = "llvm.loongarch.ibar"] + fn __ibar(a: i32); + #[link_name = "llvm.loongarch.movgr2fcsr"] + fn __movgr2fcsr(a: i32, b: i32); + #[link_name = "llvm.loongarch.movfcsr2gr"] + fn __movfcsr2gr(a: i32) -> i32; + #[link_name = "llvm.loongarch.iocsrrd.b"] + fn __iocsrrd_b(a: i32) -> i32; + #[link_name = "llvm.loongarch.iocsrrd.h"] + fn __iocsrrd_h(a: i32) -> i32; + #[link_name = "llvm.loongarch.iocsrrd.w"] + fn __iocsrrd_w(a: i32) -> i32; + #[link_name = "llvm.loongarch.iocsrwr.b"] + fn __iocsrwr_b(a: i32, b: i32); + #[link_name = "llvm.loongarch.iocsrwr.h"] + fn __iocsrwr_h(a: i32, b: i32); + #[link_name = "llvm.loongarch.iocsrwr.w"] + fn __iocsrwr_w(a: i32, b: i32); + #[link_name = "llvm.loongarch.break"] + fn __break(a: i32); + #[link_name = "llvm.loongarch.cpucfg"] + fn __cpucfg(a: i32) -> i32; + #[link_name = "llvm.loongarch.syscall"] + fn __syscall(a: i32); + #[link_name = "llvm.loongarch.frecipe.s"] + fn __frecipe_s(a: f32) -> f32; + #[link_name = "llvm.loongarch.frecipe.d"] + fn __frecipe_d(a: f64) -> f64; + #[link_name = "llvm.loongarch.frsqrte.s"] + fn __frsqrte_s(a: f32) -> f32; + #[link_name = "llvm.loongarch.frsqrte.d"] + fn __frsqrte_d(a: f64) -> f64; +} + +/// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn crc_w_b_w(a: i32, b: i32) -> i32 { + __crc_w_b_w(a, b) +} + +/// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn crc_w_h_w(a: i32, b: i32) -> i32 { + __crc_w_h_w(a, b) +} + +/// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn crc_w_w_w(a: i32, b: i32) -> i32 { + __crc_w_w_w(a, b) +} + +/// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn crcc_w_b_w(a: i32, b: i32) -> i32 { + __crcc_w_b_w(a, b) +} + +/// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn crcc_w_h_w(a: i32, b: i32) -> i32 { + __crcc_w_h_w(a, b) +} + +/// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn crcc_w_w_w(a: i32, b: i32) -> i32 { + __crcc_w_w_w(a, b) +} + +/// Generates the memory barrier instruction +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn dbar() { + static_assert_uimm_bits!(IMM15, 15); + __dbar(IMM15); +} + +/// Generates the instruction-fetch barrier instruction +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn ibar() { + static_assert_uimm_bits!(IMM15, 15); + __ibar(IMM15); +} + +/// Moves data from a GPR to the FCSR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn movgr2fcsr(a: i32) { + static_assert_uimm_bits!(IMM5, 5); + __movgr2fcsr(IMM5, a); +} + +/// Moves data from a FCSR to the GPR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn movfcsr2gr() -> i32 { + static_assert_uimm_bits!(IMM5, 5); + __movfcsr2gr(IMM5) +} + +/// Reads the 8-bit IO-CSR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn iocsrrd_b(a: i32) -> i32 { + __iocsrrd_b(a) +} + +/// Reads the 16-bit IO-CSR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn iocsrrd_h(a: i32) -> i32 { + __iocsrrd_h(a) +} + +/// Reads the 32-bit IO-CSR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn iocsrrd_w(a: i32) -> i32 { + __iocsrrd_w(a) +} + +/// Writes the 8-bit IO-CSR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn iocsrwr_b(a: i32, b: i32) { + __iocsrwr_b(a, b) +} + +/// Writes the 16-bit IO-CSR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn iocsrwr_h(a: i32, b: i32) { + __iocsrwr_h(a, b) +} + +/// Writes the 32-bit IO-CSR +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn iocsrwr_w(a: i32, b: i32) { + __iocsrwr_w(a, b) +} + +/// Generates the breakpoint instruction +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn brk() { + static_assert_uimm_bits!(IMM15, 15); + __break(IMM15); +} + +/// Reads the CPU configuration register +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn cpucfg(a: i32) -> i32 { + __cpucfg(a) +} + +/// Generates the syscall instruction +#[inline] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn syscall() { + static_assert_uimm_bits!(IMM15, 15); + __syscall(IMM15); +} + +/// Calculate the approximate single-precision result of 1.0 divided +#[inline] +#[target_feature(enable = "frecipe")] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn frecipe_s(a: f32) -> f32 { + __frecipe_s(a) +} + +/// Calculate the approximate double-precision result of 1.0 divided +#[inline] +#[target_feature(enable = "frecipe")] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn frecipe_d(a: f64) -> f64 { + __frecipe_d(a) +} + +/// Calculate the approximate single-precision result of dividing 1.0 by the square root +#[inline] +#[target_feature(enable = "frecipe")] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn frsqrte_s(a: f32) -> f32 { + __frsqrte_s(a) +} + +/// Calculate the approximate double-precision result of dividing 1.0 by the square root +#[inline] +#[target_feature(enable = "frecipe")] +#[unstable(feature = "stdarch_loongarch", issue = "117427")] +pub unsafe fn frsqrte_d(a: f64) -> f64 { + __frsqrte_d(a) +} diff --git a/library/stdarch/crates/core_arch/src/mod.rs b/library/stdarch/crates/core_arch/src/mod.rs index f6e959efd47c..2105cca1b438 100644 --- a/library/stdarch/crates/core_arch/src/mod.rs +++ b/library/stdarch/crates/core_arch/src/mod.rs @@ -16,6 +16,9 @@ mod riscv_shared; ))] mod arm_shared; +#[cfg(any(target_arch = "loongarch32", target_arch = "loongarch64", doc))] +mod loongarch_shared; + mod simd; #[doc = include_str!("core_arch_docs.md")] @@ -271,13 +274,25 @@ pub mod arch { pub use crate::core_arch::nvptx::*; } - /// Platform-specific intrinsics for the `loongarch` platform. + /// Platform-specific intrinsics for the `loongarch32` platform. + /// + /// See the [module documentation](../index.html) for more details. + #[cfg(any(target_arch = "loongarch32", doc))] + #[doc(cfg(target_arch = "loongarch32"))] + #[unstable(feature = "stdarch_loongarch", issue = "117427")] + pub mod loongarch32 { + pub use crate::core_arch::loongarch_shared::*; + pub use crate::core_arch::loongarch32::*; + } + + /// Platform-specific intrinsics for the `loongarch64` platform. /// /// See the [module documentation](../index.html) for more details. #[cfg(any(target_arch = "loongarch64", doc))] #[doc(cfg(target_arch = "loongarch64"))] #[unstable(feature = "stdarch_loongarch", issue = "117427")] pub mod loongarch64 { + pub use crate::core_arch::loongarch_shared::*; pub use crate::core_arch::loongarch64::*; } @@ -334,6 +349,10 @@ mod powerpc64; #[doc(cfg(target_arch = "nvptx64"))] mod nvptx; +#[cfg(any(target_arch = "loongarch32", doc))] +#[doc(cfg(target_arch = "loongarch32"))] +mod loongarch32; + #[cfg(any(target_arch = "loongarch64", doc))] #[doc(cfg(target_arch = "loongarch64"))] mod loongarch64; diff --git a/library/stdarch/crates/simd-test-macro/src/lib.rs b/library/stdarch/crates/simd-test-macro/src/lib.rs index 18e4747d94d9..ae7849f298a9 100644 --- a/library/stdarch/crates/simd-test-macro/src/lib.rs +++ b/library/stdarch/crates/simd-test-macro/src/lib.rs @@ -62,7 +62,7 @@ pub fn simd_test( maybe_riscv if maybe_riscv.starts_with("riscv") => "is_riscv_feature_detected", "powerpc" | "powerpcle" => "is_powerpc_feature_detected", "powerpc64" | "powerpc64le" => "is_powerpc64_feature_detected", - "loongarch64" => "is_loongarch_feature_detected", + "loongarch32" | "loongarch64" => "is_loongarch_feature_detected", "s390x" => "is_s390x_feature_detected", t => panic!("unknown target: {t}"), }; diff --git a/library/stdarch/crates/std_detect/README.md b/library/stdarch/crates/std_detect/README.md index 091f5542e0e8..edc90d319a1d 100644 --- a/library/stdarch/crates/std_detect/README.md +++ b/library/stdarch/crates/std_detect/README.md @@ -55,7 +55,7 @@ crate from working on applications in which `std` is not available. application. * Linux/Android: - * `arm{32, 64}`, `mips{32,64}{,el}`, `powerpc{32,64}{,le}`, `loongarch64`, `s390x`: + * `arm{32, 64}`, `mips{32,64}{,el}`, `powerpc{32,64}{,le}`, `loongarch{32,64}`, `s390x`: `std_detect` supports these on Linux by querying ELF auxiliary vectors (using `getauxval` when available), and if that fails, by querying `/proc/self/auxv`. * `arm64`: partial support for doing run-time feature detection by directly diff --git a/library/stdarch/crates/std_detect/src/detect/arch/loongarch.rs b/library/stdarch/crates/std_detect/src/detect/arch/loongarch.rs index e9d68f6a9bf7..68fc600fa8e7 100644 --- a/library/stdarch/crates/std_detect/src/detect/arch/loongarch.rs +++ b/library/stdarch/crates/std_detect/src/detect/arch/loongarch.rs @@ -2,7 +2,7 @@ features! { @TARGET: loongarch; - @CFG: target_arch = "loongarch64"; + @CFG: any(target_arch = "loongarch32", target_arch = "loongarch64"); @MACRO_NAME: is_loongarch_feature_detected; @MACRO_ATTRS: /// Checks if `loongarch` feature is enabled. diff --git a/library/stdarch/crates/std_detect/src/detect/arch/mod.rs b/library/stdarch/crates/std_detect/src/detect/arch/mod.rs index d5a13acc0282..b0be554ed898 100644 --- a/library/stdarch/crates/std_detect/src/detect/arch/mod.rs +++ b/library/stdarch/crates/std_detect/src/detect/arch/mod.rs @@ -49,7 +49,7 @@ cfg_if! { } else if #[cfg(target_arch = "mips64")] { #[unstable(feature = "stdarch_mips_feature_detection", issue = "111188")] pub use mips64::*; - } else if #[cfg(target_arch = "loongarch64")] { + } else if #[cfg(any(target_arch = "loongarch32", target_arch = "loongarch64"))] { #[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")] pub use loongarch::*; } else if #[cfg(target_arch = "s390x")] { diff --git a/library/stdarch/crates/std_detect/src/detect/mod.rs b/library/stdarch/crates/std_detect/src/detect/mod.rs index 8fd3d9579328..a9e9709c1f67 100644 --- a/library/stdarch/crates/std_detect/src/detect/mod.rs +++ b/library/stdarch/crates/std_detect/src/detect/mod.rs @@ -103,6 +103,7 @@ pub fn features() -> impl Iterator { target_arch = "powerpc64", target_arch = "mips", target_arch = "mips64", + target_arch = "loongarch32", target_arch = "loongarch64", target_arch = "s390x", ))] { diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs b/library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs index c30379ff0655..54f52aa75330 100644 --- a/library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs +++ b/library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs @@ -80,6 +80,7 @@ pub(crate) fn auxv() -> Result { target_arch = "riscv64", target_arch = "mips", target_arch = "mips64", + target_arch = "loongarch32", target_arch = "loongarch64", ))] { @@ -182,6 +183,7 @@ fn auxv_from_buf(buf: &[usize]) -> Result { target_arch = "riscv64", target_arch = "mips", target_arch = "mips64", + target_arch = "loongarch32", target_arch = "loongarch64", ))] { diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/mod.rs b/library/stdarch/crates/std_detect/src/detect/os/linux/mod.rs index 8c689d0b1f0e..9accd41717b9 100644 --- a/library/stdarch/crates/std_detect/src/detect/os/linux/mod.rs +++ b/library/stdarch/crates/std_detect/src/detect/os/linux/mod.rs @@ -51,7 +51,7 @@ cfg_if::cfg_if! { } else if #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] { mod powerpc; pub(crate) use self::powerpc::detect_features; - } else if #[cfg(target_arch = "loongarch64")] { + } else if #[cfg(any(target_arch = "loongarch32", target_arch = "loongarch64"))] { mod loongarch; pub(crate) use self::loongarch::detect_features; } else if #[cfg(target_arch = "s390x")] { diff --git a/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs b/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs index fa3a23c79681..2fee0abdd575 100644 --- a/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs +++ b/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs @@ -11,6 +11,7 @@ target_arch = "s390x", target_arch = "riscv32", target_arch = "riscv64", + target_arch = "loongarch32", target_arch = "loongarch64" ), feature(stdarch_internal) @@ -30,7 +31,7 @@ feature(stdarch_riscv_feature_detection) )] #![cfg_attr( - target_arch = "loongarch64", + any(target_arch = "loongarch32", target_arch = "loongarch64"), feature(stdarch_loongarch_feature_detection) )] @@ -45,6 +46,7 @@ target_arch = "s390x", target_arch = "riscv32", target_arch = "riscv64", + target_arch = "loongarch32", target_arch = "loongarch64" ))] #[macro_use] @@ -65,8 +67,8 @@ fn aarch64() { } #[test] -#[cfg(target_arch = "loongarch64")] -fn loongarch64() { +#[cfg(any(target_arch = "loongarch32", target_arch = "loongarch64"))] +fn loongarch() { let _ = is_loongarch_feature_detected!("lsx"); let _ = is_loongarch_feature_detected!("lsx",); } From 2f20628da281cf08436659f578d1498d85aee9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 4 Jul 2025 22:15:27 +0200 Subject: [PATCH 004/183] Remove josh-sync crate --- library/compiler-builtins/Cargo.toml | 1 - .../crates/josh-sync/Cargo.toml | 8 - .../crates/josh-sync/src/main.rs | 45 -- .../crates/josh-sync/src/sync.rs | 401 ------------------ 4 files changed, 455 deletions(-) delete mode 100644 library/compiler-builtins/crates/josh-sync/Cargo.toml delete mode 100644 library/compiler-builtins/crates/josh-sync/src/main.rs delete mode 100644 library/compiler-builtins/crates/josh-sync/src/sync.rs diff --git a/library/compiler-builtins/Cargo.toml b/library/compiler-builtins/Cargo.toml index 41350c6cb990..956d738f3b1f 100644 --- a/library/compiler-builtins/Cargo.toml +++ b/library/compiler-builtins/Cargo.toml @@ -3,7 +3,6 @@ resolver = "2" members = [ "builtins-shim", "builtins-test", - "crates/josh-sync", "crates/libm-macros", "crates/musl-math-sys", "crates/panic-handler", diff --git a/library/compiler-builtins/crates/josh-sync/Cargo.toml b/library/compiler-builtins/crates/josh-sync/Cargo.toml deleted file mode 100644 index 8e2e891db542..000000000000 --- a/library/compiler-builtins/crates/josh-sync/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "josh-sync" -edition = "2024" -publish = false - -[dependencies] -directories = "6.0.0" -regex-lite = "0.1.6" diff --git a/library/compiler-builtins/crates/josh-sync/src/main.rs b/library/compiler-builtins/crates/josh-sync/src/main.rs deleted file mode 100644 index 7f0b11900337..000000000000 --- a/library/compiler-builtins/crates/josh-sync/src/main.rs +++ /dev/null @@ -1,45 +0,0 @@ -use std::io::{Read, Write}; -use std::process::exit; -use std::{env, io}; - -use crate::sync::{GitSync, Josh}; - -mod sync; - -const USAGE: &str = r#"Utility for synchroniing compiler-builtins with rust-lang/rust - -Usage: - - josh-sync rustc-pull - - Pull from rust-lang/rust to compiler-builtins. Creates a commit - updating the version file, followed by a merge commit. - - josh-sync rustc-push GITHUB_USERNAME [BRANCH] - - Create a branch off of rust-lang/rust updating compiler-builtins. -"#; - -fn main() { - let sync = GitSync::from_current_dir(); - - // Collect args, then recollect as str refs so we can match on them - let args: Vec<_> = env::args().collect(); - let args: Vec<&str> = args.iter().map(String::as_str).collect(); - - match args.as_slice()[1..] { - ["rustc-pull"] => sync.rustc_pull(None), - ["rustc-push", github_user, branch] => sync.rustc_push(github_user, Some(branch)), - ["rustc-push", github_user] => sync.rustc_push(github_user, None), - ["start-josh"] => { - let _josh = Josh::start(); - println!("press enter to stop"); - io::stdout().flush().unwrap(); - let _ = io::stdin().read(&mut [0u8]).unwrap(); - } - _ => { - println!("{USAGE}"); - exit(1); - } - } -} diff --git a/library/compiler-builtins/crates/josh-sync/src/sync.rs b/library/compiler-builtins/crates/josh-sync/src/sync.rs deleted file mode 100644 index 2d89d2d1cea2..000000000000 --- a/library/compiler-builtins/crates/josh-sync/src/sync.rs +++ /dev/null @@ -1,401 +0,0 @@ -use std::borrow::Cow; -use std::net::{SocketAddr, TcpStream}; -use std::process::{Command, Stdio, exit}; -use std::time::Duration; -use std::{env, fs, process, thread}; - -use regex_lite::Regex; - -const JOSH_PORT: u16 = 42042; -const DEFAULT_PR_BRANCH: &str = "update-builtins"; - -pub struct GitSync { - upstream_repo: String, - upstream_ref: String, - upstream_url: String, - josh_filter: String, - josh_url_base: String, -} - -/// This code was adapted from the miri repository, via the rustc-dev-guide -/// () -impl GitSync { - pub fn from_current_dir() -> Self { - let upstream_repo = - env::var("UPSTREAM_ORG").unwrap_or_else(|_| "rust-lang".to_owned()) + "/rust"; - - Self { - upstream_url: format!("https://github.com/{upstream_repo}"), - upstream_repo, - upstream_ref: env::var("UPSTREAM_REF").unwrap_or_else(|_| "HEAD".to_owned()), - josh_filter: ":/library/compiler-builtins".to_owned(), - josh_url_base: format!("http://localhost:{JOSH_PORT}"), - } - } - - /// Pull from rust-lang/rust to compiler-builtins. - pub fn rustc_pull(&self, commit: Option) { - let Self { - upstream_ref, - upstream_url, - upstream_repo, - .. - } = self; - - let new_upstream_base = commit.unwrap_or_else(|| { - let out = check_output(["git", "ls-remote", upstream_url, upstream_ref]); - out.split_whitespace() - .next() - .unwrap_or_else(|| panic!("could not split output: '{out}'")) - .to_owned() - }); - - ensure_clean(); - - // Make sure josh is running. - let _josh = Josh::start(); - let josh_url_filtered = self.josh_url( - &self.upstream_repo, - Some(&new_upstream_base), - Some(&self.josh_filter), - ); - - let previous_upstream_base = fs::read_to_string("rust-version") - .expect("failed to read `rust-version`") - .trim() - .to_string(); - assert_ne!(previous_upstream_base, new_upstream_base, "nothing to pull"); - - let orig_head = check_output(["git", "rev-parse", "HEAD"]); - println!("original upstream base: {previous_upstream_base}"); - println!("new upstream base: {new_upstream_base}"); - println!("original HEAD: {orig_head}"); - - // Fetch the latest upstream HEAD so we can get a summary. Use the Josh URL for caching. - run([ - "git", - "fetch", - &self.josh_url(&self.upstream_repo, Some(&new_upstream_base), Some(":/")), - &new_upstream_base, - "--depth=1", - ]); - let new_summary = check_output(["git", "log", "-1", "--format=%h %s", &new_upstream_base]); - let new_summary = replace_references(&new_summary, &self.upstream_repo); - - // Update rust-version file. As a separate commit, since making it part of - // the merge has confused the heck out of josh in the past. - // We pass `--no-verify` to avoid running git hooks. - // We do this before the merge so that if there are merge conflicts, we have - // the right rust-version file while resolving them. - fs::write("rust-version", format!("{new_upstream_base}\n")) - .expect("failed to write rust-version"); - - let prep_message = format!( - "Update the upstream Rust version\n\n\ - To prepare for merging from {upstream_repo}, set the version file to:\n\n \ - {new_summary}\n\ - ", - ); - run([ - "git", - "commit", - "rust-version", - "--no-verify", - "-m", - &prep_message, - ]); - - // Fetch given rustc commit. - run(["git", "fetch", &josh_url_filtered]); - let incoming_ref = check_output(["git", "rev-parse", "FETCH_HEAD"]); - println!("incoming ref: {incoming_ref}"); - - let merge_message = format!( - "Merge ref '{upstream_head_short}{filter}' from {upstream_url}\n\n\ - Pull recent changes from {upstream_repo} via Josh.\n\n\ - Upstream ref: {new_upstream_base}\n\ - Filtered ref: {incoming_ref}\n\ - ", - upstream_head_short = &new_upstream_base[..12], - filter = self.josh_filter - ); - - // This should not add any new root commits. So count those before and after merging. - let num_roots = || -> u32 { - let out = check_output(["git", "rev-list", "HEAD", "--max-parents=0", "--count"]); - out.trim() - .parse::() - .unwrap_or_else(|e| panic!("failed to parse `{out}`: {e}")) - }; - let num_roots_before = num_roots(); - - let pre_merge_sha = check_output(["git", "rev-parse", "HEAD"]); - println!("pre-merge HEAD: {pre_merge_sha}"); - - // Merge the fetched commit. - run([ - "git", - "merge", - "FETCH_HEAD", - "--no-verify", - "--no-ff", - "-m", - &merge_message, - ]); - - let current_sha = check_output(["git", "rev-parse", "HEAD"]); - if current_sha == pre_merge_sha { - run(["git", "reset", "--hard", &orig_head]); - eprintln!( - "No merge was performed, no changes to pull were found. \ - Rolled back the preparation commit." - ); - exit(1); - } - - // Check that the number of roots did not increase. - assert_eq!( - num_roots(), - num_roots_before, - "Josh created a new root commit. This is probably not the history you want." - ); - } - - /// Construct an update to rust-lang/rust from compiler-builtins. - pub fn rustc_push(&self, github_user: &str, branch: Option<&str>) { - let Self { - josh_filter, - upstream_url, - .. - } = self; - - let branch = branch.unwrap_or(DEFAULT_PR_BRANCH); - let josh_url = self.josh_url(&format!("{github_user}/rust"), None, Some(josh_filter)); - let user_upstream_url = format!("git@github.com:{github_user}/rust.git"); - - let Ok(rustc_git) = env::var("RUSTC_GIT") else { - panic!("the RUSTC_GIT environment variable must be set to a rust-lang/rust checkout") - }; - - ensure_clean(); - let base = fs::read_to_string("rust-version") - .expect("failed to read `rust-version`") - .trim() - .to_string(); - - // Make sure josh is running. - let _josh = Josh::start(); - - // Prepare the branch. Pushing works much better if we use as base exactly - // the commit that we pulled from last time, so we use the `rust-version` - // file to find out which commit that would be. - println!("Preparing {github_user}/rust (base: {base})..."); - - if Command::new("git") - .args(["-C", &rustc_git, "fetch", &user_upstream_url, branch]) - .output() // capture output - .expect("could not run fetch") - .status - .success() - { - panic!( - "The branch '{branch}' seems to already exist in '{user_upstream_url}'. \ - Please delete it and try again." - ); - } - - run(["git", "-C", &rustc_git, "fetch", upstream_url, &base]); - - run_cfg("git", |c| { - c.args([ - "-C", - &rustc_git, - "push", - &user_upstream_url, - &format!("{base}:refs/heads/{branch}"), - ]) - .stdout(Stdio::null()) - .stderr(Stdio::null()) // silence the "create GitHub PR" message - }); - println!("pushed PR branch"); - - // Do the actual push. - println!("Pushing changes..."); - run(["git", "push", &josh_url, &format!("HEAD:{branch}")]); - println!(); - - // Do a round-trip check to make sure the push worked as expected. - run(["git", "fetch", &josh_url, branch]); - - let head = check_output(["git", "rev-parse", "HEAD"]); - let fetch_head = check_output(["git", "rev-parse", "FETCH_HEAD"]); - assert_eq!( - head, fetch_head, - "Josh created a non-roundtrip push! Do NOT merge this into rustc!\n\ - Expected {head}, got {fetch_head}." - ); - println!( - "Confirmed that the push round-trips back to compiler-builtins properly. Please \ - create a rustc PR:" - ); - // Open PR with `subtree update` title to silence the `no-merges` triagebot check - println!( - " {upstream_url}/compare/{github_user}:{branch}?quick_pull=1\ - &title=Update%20the%20%60compiler-builtins%60%20subtree\ - &body=Update%20the%20Josh%20subtree%20to%20https%3A%2F%2Fgithub.com%2Frust-lang%2F\ - compiler-builtins%2Fcommit%2F{head_short}.%0A%0Ar%3F%20%40ghost", - head_short = &head[..12], - ); - } - - /// Construct a url to the local Josh server with (optionally) - fn josh_url(&self, repo: &str, rev: Option<&str>, filter: Option<&str>) -> String { - format!( - "{base}/{repo}.git{at}{rev}{filter}{filt_git}", - base = self.josh_url_base, - at = if rev.is_some() { "@" } else { "" }, - rev = rev.unwrap_or_default(), - filter = filter.unwrap_or_default(), - filt_git = if filter.is_some() { ".git" } else { "" } - ) - } -} - -/// Fail if there are files that need to be checked in. -fn ensure_clean() { - let read = check_output(["git", "status", "--untracked-files=no", "--porcelain"]); - assert!( - read.is_empty(), - "working directory must be clean before performing rustc pull" - ); -} - -/* Helpers for running commands with logged invocations */ - -/// Run a command from an array, passing its output through. -fn run<'a, Args: AsRef<[&'a str]>>(l: Args) { - let l = l.as_ref(); - run_cfg(l[0], |c| c.args(&l[1..])); -} - -/// Run a command from an array, collecting its output. -fn check_output<'a, Args: AsRef<[&'a str]>>(l: Args) -> String { - let l = l.as_ref(); - check_output_cfg(l[0], |c| c.args(&l[1..])) -} - -/// [`run`] with configuration. -fn run_cfg(prog: &str, f: impl FnOnce(&mut Command) -> &mut Command) { - // self.read(l.as_ref()); - check_output_cfg(prog, |c| f(c.stdout(Stdio::inherit()))); -} - -/// [`read`] with configuration. All shell helpers print the command and pass stderr. -fn check_output_cfg(prog: &str, f: impl FnOnce(&mut Command) -> &mut Command) -> String { - let mut cmd = Command::new(prog); - cmd.stderr(Stdio::inherit()); - f(&mut cmd); - eprintln!("+ {cmd:?}"); - let out = cmd.output().expect("command failed"); - assert!(out.status.success()); - String::from_utf8(out.stdout.trim_ascii().to_vec()).expect("non-UTF8 output") -} - -/// Replace `#1234`-style issue/PR references with `repo#1234` to ensure links work across -/// repositories. -fn replace_references<'a>(s: &'a str, repo: &str) -> Cow<'a, str> { - let re = Regex::new(r"\B(?P#\d+)\b").unwrap(); - re.replace(s, &format!("{repo}$id")) -} - -/// Create a wrapper that stops Josh on drop. -pub struct Josh(process::Child); - -impl Josh { - pub fn start() -> Self { - // Determine cache directory. - let user_dirs = - directories::ProjectDirs::from("org", "rust-lang", "rustc-compiler-builtins-josh") - .unwrap(); - let local_dir = user_dirs.cache_dir().to_owned(); - - // Start josh, silencing its output. - #[expect(clippy::zombie_processes, reason = "clippy can't handle the loop")] - let josh = process::Command::new("josh-proxy") - .arg("--local") - .arg(local_dir) - .args([ - "--remote=https://github.com", - &format!("--port={JOSH_PORT}"), - "--no-background", - ]) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .spawn() - .expect("failed to start josh-proxy, make sure it is installed"); - - // Wait until the port is open. We try every 10ms until 1s passed. - for _ in 0..100 { - // This will generally fail immediately when the port is still closed. - let addr = SocketAddr::from(([127, 0, 0, 1], JOSH_PORT)); - let josh_ready = TcpStream::connect_timeout(&addr, Duration::from_millis(1)); - - if josh_ready.is_ok() { - println!("josh up and running"); - return Josh(josh); - } - - // Not ready yet. - thread::sleep(Duration::from_millis(10)); - } - panic!("Even after waiting for 1s, josh-proxy is still not available.") - } -} - -impl Drop for Josh { - fn drop(&mut self) { - if cfg!(unix) { - // Try to gracefully shut it down. - Command::new("kill") - .args(["-s", "INT", &self.0.id().to_string()]) - .output() - .expect("failed to SIGINT josh-proxy"); - // Sadly there is no "wait with timeout"... so we just give it some time to finish. - thread::sleep(Duration::from_millis(100)); - // Now hopefully it is gone. - if self - .0 - .try_wait() - .expect("failed to wait for josh-proxy") - .is_some() - { - return; - } - } - // If that didn't work (or we're not on Unix), kill it hard. - eprintln!( - "I have to kill josh-proxy the hard way, let's hope this does not \ - break anything." - ); - self.0.kill().expect("failed to SIGKILL josh-proxy"); - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_replace() { - assert_eq!(replace_references("#1234", "r-l/rust"), "r-l/rust#1234"); - assert_eq!(replace_references("#1234x", "r-l/rust"), "#1234x"); - assert_eq!( - replace_references("merge #1234", "r-l/rust"), - "merge r-l/rust#1234" - ); - assert_eq!( - replace_references("foo/bar#1234", "r-l/rust"), - "foo/bar#1234" - ); - } -} From f2b5199f4f3c8abd8bc0fd660717f3d6ec049a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 4 Jul 2025 22:15:56 +0200 Subject: [PATCH 005/183] Add josh-sync config file --- library/compiler-builtins/josh-sync.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 library/compiler-builtins/josh-sync.toml diff --git a/library/compiler-builtins/josh-sync.toml b/library/compiler-builtins/josh-sync.toml new file mode 100644 index 000000000000..599a12af8e5d --- /dev/null +++ b/library/compiler-builtins/josh-sync.toml @@ -0,0 +1,3 @@ +org = "rust-lang" +repo = "compiler-builtins" +path = "library/compiler-builtins" From 7fa999f9d2acb9cfb7dc10810817fe6746eb6835 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Tue, 8 Jul 2025 10:20:54 +0200 Subject: [PATCH 006/183] add extra log messages to track setup --- library/stdarch/crates/intrinsic-test/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/stdarch/crates/intrinsic-test/src/main.rs b/library/stdarch/crates/intrinsic-test/src/main.rs index 054138a0dba1..538f317a2978 100644 --- a/library/stdarch/crates/intrinsic-test/src/main.rs +++ b/library/stdarch/crates/intrinsic-test/src/main.rs @@ -30,12 +30,15 @@ fn main() { let test_environment = test_environment_result.unwrap(); + info!("building C binaries"); if !test_environment.build_c_file() { std::process::exit(2); } + info!("building Rust binaries"); if !test_environment.build_rust_file() { std::process::exit(3); } + info!("comaparing outputs"); if !test_environment.compare_outputs() { std::process::exit(1); } From 689cb5a4675a76c2ec19f4247d4f569550bec5a3 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Wed, 9 Jul 2025 11:27:59 +0100 Subject: [PATCH 007/183] Add sayantn and folkertdev as reviewers --- library/stdarch/triagebot.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/stdarch/triagebot.toml b/library/stdarch/triagebot.toml index 75eb642e9963..2c281c8f7d42 100644 --- a/library/stdarch/triagebot.toml +++ b/library/stdarch/triagebot.toml @@ -1,7 +1,7 @@ [assign] [assign.owners] -"*" = ["@Amanieu"] +"*" = ["@Amanieu", "@folkertdev", "@sayantn"] [ping.windows] message = """\ From a90e00172b652366a269d3f2261d9d9340f612d0 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Tue, 8 Jul 2025 09:59:03 +0200 Subject: [PATCH 008/183] run rust programs with the runner --- library/stdarch/Cargo.lock | 42 ++++---- .../crates/intrinsic-test/src/arm/config.rs | 1 - .../crates/intrinsic-test/src/arm/mod.rs | 5 +- .../crates/intrinsic-test/src/common/cli.rs | 6 +- .../intrinsic-test/src/common/compare.rs | 32 +++--- .../intrinsic-test/src/common/gen_rust.rs | 99 +++++++++---------- 6 files changed, 90 insertions(+), 95 deletions(-) diff --git a/library/stdarch/Cargo.lock b/library/stdarch/Cargo.lock index 80f424dfdd8d..7d9cd1bf8f13 100644 --- a/library/stdarch/Cargo.lock +++ b/library/stdarch/Cargo.lock @@ -73,20 +73,20 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.102", + "syn 2.0.104", ] [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "cc" -version = "1.2.26" +version = "1.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" +checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" dependencies = [ "shlex", ] @@ -128,7 +128,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.102", + "syn 2.0.104", ] [[package]] @@ -338,9 +338,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown 0.15.4", @@ -403,9 +403,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.172" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "linked-hash-map" @@ -624,7 +624,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.102", + "syn 2.0.104", ] [[package]] @@ -685,7 +685,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.102", + "syn 2.0.104", ] [[package]] @@ -742,7 +742,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.102", + "syn 2.0.104", ] [[package]] @@ -780,9 +780,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.102" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6397daf94fa90f058bd0fd88429dd9e5738999cca8d701813c80723add80462" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -838,7 +838,7 @@ version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.10.0", "semver", ] @@ -945,20 +945,20 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", - "syn 2.0.102", + "syn 2.0.104", ] diff --git a/library/stdarch/crates/intrinsic-test/src/arm/config.rs b/library/stdarch/crates/intrinsic-test/src/arm/config.rs index cee80374ae9d..9a7b37253d1c 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/config.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/config.rs @@ -114,7 +114,6 @@ pub const AARCH_CONFIGURATIONS: &str = r#" #![cfg_attr(any(target_arch = "aarch64", target_arch = "arm64ec"), feature(stdarch_neon_fcma))] #![cfg_attr(any(target_arch = "aarch64", target_arch = "arm64ec"), feature(stdarch_neon_dotprod))] #![cfg_attr(any(target_arch = "aarch64", target_arch = "arm64ec"), feature(stdarch_neon_i8mm))] -#![cfg_attr(any(target_arch = "aarch64", target_arch = "arm64ec"), feature(stdarch_neon_sha3))] #![cfg_attr(any(target_arch = "aarch64", target_arch = "arm64ec"), feature(stdarch_neon_sm4))] #![cfg_attr(any(target_arch = "aarch64", target_arch = "arm64ec"), feature(stdarch_neon_ftts))] #![feature(fmt_helpers_for_derive)] diff --git a/library/stdarch/crates/intrinsic-test/src/arm/mod.rs b/library/stdarch/crates/intrinsic-test/src/arm/mod.rs index 6aaa49ff97f9..1a66ed4268da 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/mod.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/mod.rs @@ -104,7 +104,7 @@ impl SupportedArchitectureTest for ArmArchitectureTest { } fn compare_outputs(&self) -> bool { - if let Some(ref toolchain) = self.cli_options.toolchain { + if self.cli_options.toolchain.is_some() { let intrinsics_name_list = self .intrinsics .iter() @@ -113,8 +113,7 @@ impl SupportedArchitectureTest for ArmArchitectureTest { compare_outputs( &intrinsics_name_list, - toolchain, - &self.cli_options.c_runner, + &self.cli_options.runner, &self.cli_options.target, ) } else { diff --git a/library/stdarch/crates/intrinsic-test/src/common/cli.rs b/library/stdarch/crates/intrinsic-test/src/common/cli.rs index 1d572723008d..beae6a4b044d 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/cli.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/cli.rs @@ -60,7 +60,7 @@ pub struct ProcessedCli { pub filename: PathBuf, pub toolchain: Option, pub cpp_compiler: Option, - pub c_runner: String, + pub runner: String, pub target: String, pub linker: Option, pub cxx_toolchain_dir: Option, @@ -70,7 +70,7 @@ pub struct ProcessedCli { impl ProcessedCli { pub fn new(cli_options: Cli) -> Self { let filename = cli_options.input; - let c_runner = cli_options.runner.unwrap_or_default(); + let runner = cli_options.runner.unwrap_or_default(); let target = cli_options.target; let linker = cli_options.linker; let cxx_toolchain_dir = cli_options.cxx_toolchain_dir; @@ -102,7 +102,7 @@ impl ProcessedCli { Self { toolchain, cpp_compiler, - c_runner, + runner, target, linker, cxx_toolchain_dir, diff --git a/library/stdarch/crates/intrinsic-test/src/common/compare.rs b/library/stdarch/crates/intrinsic-test/src/common/compare.rs index 9e0cbe8cd6ab..f16d83b0264b 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/compare.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/compare.rs @@ -2,26 +2,24 @@ use super::cli::FailureReason; use rayon::prelude::*; use std::process::Command; -pub fn compare_outputs( - intrinsic_name_list: &Vec, - toolchain: &str, - runner: &str, - target: &str, -) -> bool { +pub fn compare_outputs(intrinsic_name_list: &Vec, runner: &str, target: &str) -> bool { + fn runner_command(runner: &str) -> Command { + let mut it = runner.split_whitespace(); + let mut cmd = Command::new(it.next().unwrap()); + cmd.args(it); + + cmd + } + let intrinsics = intrinsic_name_list .par_iter() .filter_map(|intrinsic_name| { - let c = Command::new("sh") - .arg("-c") - .arg(format!("{runner} ./c_programs/{intrinsic_name}")) + let c = runner_command(runner) + .arg(format!("./c_programs/{intrinsic_name}")) .output(); - let rust = Command::new("sh") - .current_dir("rust_programs") - .arg("-c") - .arg(format!( - "cargo {toolchain} run --target {target} --bin {intrinsic_name} --release", - )) + let rust = runner_command(runner) + .arg(format!("target/{target}/release/{intrinsic_name}")) .env("RUSTFLAGS", "-Cdebuginfo=0") .output(); @@ -42,8 +40,8 @@ pub fn compare_outputs( if !rust.status.success() { error!( "Failed to run Rust program for intrinsic {intrinsic_name}\nstdout: {stdout}\nstderr: {stderr}", - stdout = std::str::from_utf8(&rust.stdout).unwrap_or(""), - stderr = std::str::from_utf8(&rust.stderr).unwrap_or(""), + stdout = String::from_utf8_lossy(&rust.stdout), + stderr = String::from_utf8_lossy(&rust.stderr), ); return Some(FailureReason::RunRust(intrinsic_name.clone())); } diff --git a/library/stdarch/crates/intrinsic-test/src/common/gen_rust.rs b/library/stdarch/crates/intrinsic-test/src/common/gen_rust.rs index 52bccaf905c5..0e4a95ab528a 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/gen_rust.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/gen_rust.rs @@ -2,7 +2,6 @@ use itertools::Itertools; use rayon::prelude::*; use std::collections::BTreeMap; use std::fs::File; -use std::io::Write; use std::process::Command; use super::argument::Argument; @@ -23,8 +22,8 @@ pub fn format_rust_main_template( ) -> String { format!( r#"{notices}#![feature(simd_ffi)] -#![feature(link_llvm_intrinsics)] #![feature(f16)] +#![allow(unused)] {configurations} {definitions} @@ -38,6 +37,42 @@ fn main() {{ ) } +fn write_cargo_toml(w: &mut impl std::io::Write, binaries: &[String]) -> std::io::Result<()> { + writeln!( + w, + concat!( + "[package]\n", + "name = \"intrinsic-test-programs\"\n", + "version = \"{version}\"\n", + "authors = [{authors}]\n", + "license = \"{license}\"\n", + "edition = \"2018\"\n", + "[workspace]\n", + "[dependencies]\n", + "core_arch = {{ path = \"../crates/core_arch\" }}", + ), + version = env!("CARGO_PKG_VERSION"), + authors = env!("CARGO_PKG_AUTHORS") + .split(":") + .format_with(", ", |author, fmt| fmt(&format_args!("\"{author}\""))), + license = env!("CARGO_PKG_LICENSE"), + )?; + + for binary in binaries { + writeln!( + w, + concat!( + "[[bin]]\n", + "name = \"{binary}\"\n", + "path = \"{binary}/main.rs\"\n", + ), + binary = binary, + )?; + } + + Ok(()) +} + pub fn compile_rust_programs( binaries: Vec, toolchain: Option<&str>, @@ -45,56 +80,20 @@ pub fn compile_rust_programs( linker: Option<&str>, ) -> bool { let mut cargo = File::create("rust_programs/Cargo.toml").unwrap(); - cargo - .write_all( - format!( - r#"[package] -name = "intrinsic-test-programs" -version = "{version}" -authors = [{authors}] -license = "{license}" -edition = "2018" -[workspace] -[dependencies] -core_arch = {{ path = "../crates/core_arch" }} -{binaries}"#, - version = env!("CARGO_PKG_VERSION"), - authors = env!("CARGO_PKG_AUTHORS") - .split(":") - .format_with(", ", |author, fmt| fmt(&format_args!("\"{author}\""))), - license = env!("CARGO_PKG_LICENSE"), - binaries = binaries - .iter() - .map(|binary| { - format!( - r#"[[bin]] -name = "{binary}" -path = "{binary}/main.rs""#, - ) - }) - .collect::>() - .join("\n") - ) - .into_bytes() - .as_slice(), - ) - .unwrap(); - - let toolchain = match toolchain { - None => return true, - Some(t) => t, - }; + write_cargo_toml(&mut cargo, &binaries).unwrap(); /* If there has been a linker explicitly set from the command line then * we want to set it via setting it in the RUSTFLAGS*/ - let cargo_command = format!("cargo {toolchain} build --target {target} --release"); + let mut cargo_command = Command::new("cargo"); + cargo_command.current_dir("rust_programs"); - let mut command = Command::new("sh"); - command - .current_dir("rust_programs") - .arg("-c") - .arg(cargo_command); + if let Some(toolchain) = toolchain { + if !toolchain.is_empty() { + cargo_command.arg(toolchain); + } + } + cargo_command.args(["build", "--target", target, "--release"]); let mut rust_flags = "-Cdebuginfo=0".to_string(); if let Some(linker) = linker { @@ -102,11 +101,11 @@ path = "{binary}/main.rs""#, rust_flags.push_str(linker); rust_flags.push_str(" -C link-args=-static"); - command.env("CPPFLAGS", "-fuse-ld=lld"); + cargo_command.env("CPPFLAGS", "-fuse-ld=lld"); } - command.env("RUSTFLAGS", rust_flags); - let output = command.output(); + cargo_command.env("RUSTFLAGS", rust_flags); + let output = cargo_command.output(); if let Ok(output) = output { if output.status.success() { From f6d38909b4984a172023a555b7faf3d11b87c9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 4 Jul 2025 22:17:22 +0200 Subject: [PATCH 009/183] Add documentation about subtree sync --- library/compiler-builtins/CONTRIBUTING.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/library/compiler-builtins/CONTRIBUTING.md b/library/compiler-builtins/CONTRIBUTING.md index 9f67cfc31571..9ae4f893c60d 100644 --- a/library/compiler-builtins/CONTRIBUTING.md +++ b/library/compiler-builtins/CONTRIBUTING.md @@ -165,3 +165,12 @@ cargo bench --no-default-features \ [`iai-callgrind-runner`]: https://crates.io/crates/iai-callgrind-runner [Valgrind]: https://valgrind.org/ + +## Subtree synchronization + +`compiler-builtins` is included as a [Josh subtree] in the main compiler +repository (`rust-lang/rust`). You can find a guide on how to create synchronization +(pull and push) PRs at the [`rustc-dev-guide` page]. + +[Josh subtree]: https://rustc-dev-guide.rust-lang.org/external-repos.html#josh-subtrees +[`rustc-dev-guide` page]: https://rustc-dev-guide.rust-lang.org/external-repos.html#synchronizing-a-josh-subtree From ef048d98ce4b66aec25b1cc1dd12c0b5b288f589 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 12:07:53 +0200 Subject: [PATCH 010/183] use `splat` for the aarch64/arm dup intrinsics --- .../src/arm_shared/neon/generated.rs | 60 +++++++------------ .../spec/neon/arm_shared.spec.yml | 51 ++++++++-------- 2 files changed, 44 insertions(+), 67 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs index 286f1868852a..81e659ef7278 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs @@ -14322,8 +14322,7 @@ pub unsafe fn vld1q_dup_f16(ptr: *const f16) -> float16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1_dup_f32(ptr: *const f32) -> float32x2_t { - let x = vld1_lane_f32::<0>(ptr, transmute(f32x2::splat(0.0))); - simd_shuffle!(x, x, [0, 0]) + transmute(f32x2::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_dup_p16)"] @@ -14346,8 +14345,7 @@ pub unsafe fn vld1_dup_f32(ptr: *const f32) -> float32x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1_dup_p16(ptr: *const p16) -> poly16x4_t { - let x = vld1_lane_p16::<0>(ptr, transmute(u16x4::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0]) + transmute(u16x4::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_dup_p8)"] @@ -14370,8 +14368,7 @@ pub unsafe fn vld1_dup_p16(ptr: *const p16) -> poly16x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1_dup_p8(ptr: *const p8) -> poly8x8_t { - let x = vld1_lane_p8::<0>(ptr, transmute(u8x8::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0, 0, 0, 0, 0]) + transmute(u8x8::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_dup_s16)"] @@ -14394,8 +14391,7 @@ pub unsafe fn vld1_dup_p8(ptr: *const p8) -> poly8x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1_dup_s16(ptr: *const i16) -> int16x4_t { - let x = vld1_lane_s16::<0>(ptr, transmute(i16x4::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0]) + transmute(i16x4::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_dup_s32)"] @@ -14418,8 +14414,7 @@ pub unsafe fn vld1_dup_s16(ptr: *const i16) -> int16x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1_dup_s32(ptr: *const i32) -> int32x2_t { - let x = vld1_lane_s32::<0>(ptr, transmute(i32x2::splat(0))); - simd_shuffle!(x, x, [0, 0]) + transmute(i32x2::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_dup_s8)"] @@ -14442,8 +14437,7 @@ pub unsafe fn vld1_dup_s32(ptr: *const i32) -> int32x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1_dup_s8(ptr: *const i8) -> int8x8_t { - let x = vld1_lane_s8::<0>(ptr, transmute(i8x8::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0, 0, 0, 0, 0]) + transmute(i8x8::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_dup_u16)"] @@ -14466,8 +14460,7 @@ pub unsafe fn vld1_dup_s8(ptr: *const i8) -> int8x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1_dup_u16(ptr: *const u16) -> uint16x4_t { - let x = vld1_lane_u16::<0>(ptr, transmute(u16x4::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0]) + transmute(u16x4::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_dup_u32)"] @@ -14490,8 +14483,7 @@ pub unsafe fn vld1_dup_u16(ptr: *const u16) -> uint16x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1_dup_u32(ptr: *const u32) -> uint32x2_t { - let x = vld1_lane_u32::<0>(ptr, transmute(u32x2::splat(0))); - simd_shuffle!(x, x, [0, 0]) + transmute(u32x2::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_dup_u8)"] @@ -14514,8 +14506,7 @@ pub unsafe fn vld1_dup_u32(ptr: *const u32) -> uint32x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1_dup_u8(ptr: *const u8) -> uint8x8_t { - let x = vld1_lane_u8::<0>(ptr, transmute(u8x8::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0, 0, 0, 0, 0]) + transmute(u8x8::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_f32)"] @@ -14538,8 +14529,7 @@ pub unsafe fn vld1_dup_u8(ptr: *const u8) -> uint8x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_f32(ptr: *const f32) -> float32x4_t { - let x = vld1q_lane_f32::<0>(ptr, transmute(f32x4::splat(0.0))); - simd_shuffle!(x, x, [0, 0, 0, 0]) + transmute(f32x4::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_p16)"] @@ -14562,8 +14552,7 @@ pub unsafe fn vld1q_dup_f32(ptr: *const f32) -> float32x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_p16(ptr: *const p16) -> poly16x8_t { - let x = vld1q_lane_p16::<0>(ptr, transmute(u16x8::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0, 0, 0, 0, 0]) + transmute(u16x8::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_p8)"] @@ -14586,8 +14575,7 @@ pub unsafe fn vld1q_dup_p16(ptr: *const p16) -> poly16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_p8(ptr: *const p8) -> poly8x16_t { - let x = vld1q_lane_p8::<0>(ptr, transmute(u8x16::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) + transmute(u8x16::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_s16)"] @@ -14610,8 +14598,7 @@ pub unsafe fn vld1q_dup_p8(ptr: *const p8) -> poly8x16_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_s16(ptr: *const i16) -> int16x8_t { - let x = vld1q_lane_s16::<0>(ptr, transmute(i16x8::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0, 0, 0, 0, 0]) + transmute(i16x8::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_s32)"] @@ -14634,8 +14621,7 @@ pub unsafe fn vld1q_dup_s16(ptr: *const i16) -> int16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_s32(ptr: *const i32) -> int32x4_t { - let x = vld1q_lane_s32::<0>(ptr, transmute(i32x4::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0]) + transmute(i32x4::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_s64)"] @@ -14658,8 +14644,7 @@ pub unsafe fn vld1q_dup_s32(ptr: *const i32) -> int32x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_s64(ptr: *const i64) -> int64x2_t { - let x = vld1q_lane_s64::<0>(ptr, transmute(i64x2::splat(0))); - simd_shuffle!(x, x, [0, 0]) + transmute(i64x2::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_s8)"] @@ -14682,8 +14667,7 @@ pub unsafe fn vld1q_dup_s64(ptr: *const i64) -> int64x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_s8(ptr: *const i8) -> int8x16_t { - let x = vld1q_lane_s8::<0>(ptr, transmute(i8x16::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) + transmute(i8x16::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_u16)"] @@ -14706,8 +14690,7 @@ pub unsafe fn vld1q_dup_s8(ptr: *const i8) -> int8x16_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_u16(ptr: *const u16) -> uint16x8_t { - let x = vld1q_lane_u16::<0>(ptr, transmute(u16x8::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0, 0, 0, 0, 0]) + transmute(u16x8::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_u32)"] @@ -14730,8 +14713,7 @@ pub unsafe fn vld1q_dup_u16(ptr: *const u16) -> uint16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_u32(ptr: *const u32) -> uint32x4_t { - let x = vld1q_lane_u32::<0>(ptr, transmute(u32x4::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0]) + transmute(u32x4::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_u64)"] @@ -14754,8 +14736,7 @@ pub unsafe fn vld1q_dup_u32(ptr: *const u32) -> uint32x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_u64(ptr: *const u64) -> uint64x2_t { - let x = vld1q_lane_u64::<0>(ptr, transmute(u64x2::splat(0))); - simd_shuffle!(x, x, [0, 0]) + transmute(u64x2::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_u8)"] @@ -14778,8 +14759,7 @@ pub unsafe fn vld1q_dup_u64(ptr: *const u64) -> uint64x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub unsafe fn vld1q_dup_u8(ptr: *const u8) -> uint8x16_t { - let x = vld1q_lane_u8::<0>(ptr, transmute(u8x16::splat(0))); - simd_shuffle!(x, x, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) + transmute(u8x16::splat(*ptr)) } #[doc = "Load one single-element structure and Replicate to all lanes (of one register)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_dup_p64)"] diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml index 118f5808f758..1daa76531117 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml @@ -14138,6 +14138,7 @@ intrinsics: doc: "Load one single-element structure and Replicate to all lanes (of one register)." arguments: ["ptr: {type[1]}"] return_type: "{neon_type[2]}" + big_endian_inverse: false attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, { FnCall: [assert_instr, ['"{type[3]}"']] } ]] @@ -14147,40 +14148,36 @@ intrinsics: safety: unsafe: [neon] types: - - ['vld1_dup_s8', '*const i8', 'int8x8_t', 'vld1.8', 'ld1r', 'vld1_lane_s8::<0>', 'i8x8::splat(0)', '[0, 0, 0, 0, 0, 0, 0, 0]'] - - ['vld1_dup_u8', '*const u8', 'uint8x8_t', 'vld1.8', 'ld1r', 'vld1_lane_u8::<0>', 'u8x8::splat(0)', '[0, 0, 0, 0, 0, 0, 0, 0]'] - - ['vld1_dup_p8', '*const p8', 'poly8x8_t', 'vld1.8', 'ld1r', 'vld1_lane_p8::<0>', 'u8x8::splat(0)', '[0, 0, 0, 0, 0, 0, 0, 0]'] + - ['vld1_dup_s8', '*const i8', 'int8x8_t', 'vld1.8', 'ld1r', 'i8x8::splat'] + - ['vld1_dup_u8', '*const u8', 'uint8x8_t', 'vld1.8', 'ld1r', 'u8x8::splat'] + - ['vld1_dup_p8', '*const p8', 'poly8x8_t', 'vld1.8', 'ld1r', 'u8x8::splat'] - - ['vld1q_dup_s8', '*const i8', 'int8x16_t', 'vld1.8', 'ld1r', 'vld1q_lane_s8::<0>', 'i8x16::splat(0)', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]'] - - ['vld1q_dup_u8', '*const u8', 'uint8x16_t', 'vld1.8', 'ld1r', 'vld1q_lane_u8::<0>', 'u8x16::splat(0)', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]'] - - ['vld1q_dup_p8', '*const p8', 'poly8x16_t', 'vld1.8', 'ld1r', 'vld1q_lane_p8::<0>', 'u8x16::splat(0)', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]'] + - ['vld1q_dup_s8', '*const i8', 'int8x16_t', 'vld1.8', 'ld1r', 'i8x16::splat'] + - ['vld1q_dup_u8', '*const u8', 'uint8x16_t', 'vld1.8', 'ld1r', 'u8x16::splat'] + - ['vld1q_dup_p8', '*const p8', 'poly8x16_t', 'vld1.8', 'ld1r', 'u8x16::splat'] - - ['vld1_dup_s16', '*const i16', 'int16x4_t', 'vld1.16', 'ld1r', 'vld1_lane_s16::<0>', 'i16x4::splat(0)', '[0, 0, 0, 0]'] - - ['vld1_dup_u16', '*const u16', 'uint16x4_t', 'vld1.16', 'ld1r', 'vld1_lane_u16::<0>', 'u16x4::splat(0)', '[0, 0, 0, 0]'] - - ['vld1_dup_p16', '*const p16', 'poly16x4_t', 'vld1.16', 'ld1r', 'vld1_lane_p16::<0>', 'u16x4::splat(0)', '[0, 0, 0, 0]'] + - ['vld1_dup_s16', '*const i16', 'int16x4_t', 'vld1.16', 'ld1r', 'i16x4::splat'] + - ['vld1_dup_u16', '*const u16', 'uint16x4_t', 'vld1.16', 'ld1r', 'u16x4::splat'] + - ['vld1_dup_p16', '*const p16', 'poly16x4_t', 'vld1.16', 'ld1r', 'u16x4::splat'] - - ['vld1q_dup_s16', '*const i16', 'int16x8_t', 'vld1.16', 'ld1r', 'vld1q_lane_s16::<0>', 'i16x8::splat(0)', '[0, 0, 0, 0, 0, 0, 0, 0]'] - - ['vld1q_dup_u16', '*const u16', 'uint16x8_t', 'vld1.16', 'ld1r', 'vld1q_lane_u16::<0>', 'u16x8::splat(0)', '[0, 0, 0, 0, 0, 0, 0, 0]'] - - ['vld1q_dup_p16', '*const p16', 'poly16x8_t', 'vld1.16', 'ld1r', 'vld1q_lane_p16::<0>', 'u16x8::splat(0)', '[0, 0, 0, 0, 0, 0, 0, 0]'] + - ['vld1q_dup_s16', '*const i16', 'int16x8_t', 'vld1.16', 'ld1r', 'i16x8::splat'] + - ['vld1q_dup_u16', '*const u16', 'uint16x8_t', 'vld1.16', 'ld1r', 'u16x8::splat'] + - ['vld1q_dup_p16', '*const p16', 'poly16x8_t', 'vld1.16', 'ld1r', 'u16x8::splat'] - - ['vld1_dup_s32', '*const i32', 'int32x2_t', 'vld1.32', 'ld1r', 'vld1_lane_s32::<0>', 'i32x2::splat(0)', '[0, 0]'] - - ['vld1_dup_u32', '*const u32', 'uint32x2_t', 'vld1.32', 'ld1r', 'vld1_lane_u32::<0>', 'u32x2::splat(0)', '[0, 0]'] - - ['vld1_dup_f32', '*const f32', 'float32x2_t', 'vld1.32', 'ld1r', 'vld1_lane_f32::<0>', 'f32x2::splat(0.0)', '[0, 0]'] + - ['vld1_dup_s32', '*const i32', 'int32x2_t', 'vld1.32', 'ld1r', 'i32x2::splat'] + - ['vld1_dup_u32', '*const u32', 'uint32x2_t', 'vld1.32', 'ld1r', 'u32x2::splat'] + - ['vld1_dup_f32', '*const f32', 'float32x2_t', 'vld1.32', 'ld1r', 'f32x2::splat'] - - ['vld1q_dup_s32', '*const i32', 'int32x4_t', 'vld1.32', 'ld1r', 'vld1q_lane_s32::<0>', 'i32x4::splat(0)', '[0, 0, 0, 0]'] - - ['vld1q_dup_u32', '*const u32', 'uint32x4_t', 'vld1.32', 'ld1r', 'vld1q_lane_u32::<0>', 'u32x4::splat(0)', '[0, 0, 0, 0]'] - - ['vld1q_dup_f32', '*const f32', 'float32x4_t', 'vld1.32', 'ld1r', 'vld1q_lane_f32::<0>', 'f32x4::splat(0.0)', '[0, 0, 0, 0]'] + - ['vld1q_dup_s32', '*const i32', 'int32x4_t', 'vld1.32', 'ld1r', 'i32x4::splat'] + - ['vld1q_dup_u32', '*const u32', 'uint32x4_t', 'vld1.32', 'ld1r', 'u32x4::splat'] + - ['vld1q_dup_f32', '*const f32', 'float32x4_t', 'vld1.32', 'ld1r', 'f32x4::splat'] - - ['vld1q_dup_s64', '*const i64', 'int64x2_t', 'vldr', 'ld1', 'vld1q_lane_s64::<0>', 'i64x2::splat(0)', '[0, 0]'] - - ['vld1q_dup_u64', '*const u64', 'uint64x2_t', 'vldr', 'ld1', 'vld1q_lane_u64::<0>', 'u64x2::splat(0)', '[0, 0]'] + - ['vld1q_dup_s64', '*const i64', 'int64x2_t', 'vldr', 'ld1', 'i64x2::splat'] + - ['vld1q_dup_u64', '*const u64', 'uint64x2_t', 'vldr', 'ld1', 'u64x2::splat'] compose: - - Let: - - x - - FnCall: - - '{type[5]}' - - - ptr - - FnCall: [transmute, ['{type[6]}']] - - FnCall: ['simd_shuffle!', [x, x, '{type[7]}']] + - FnCall: + - transmute + - - FnCall: ['{type[5]}', ["*ptr"]] - name: "{type[0]}" doc: "Absolute difference and accumulate (64-bit)" From 6d1f9552bd4c750b99cb7db7848762017c48465d Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 15:04:13 +0200 Subject: [PATCH 011/183] use `intrinsics::simd` for integer max/min --- .../src/arm_shared/neon/generated.rs | 264 +++++------------- .../spec/neon/arm_shared.spec.yml | 36 +-- 2 files changed, 80 insertions(+), 220 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs index 286f1868852a..16366d5e2bd5 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs @@ -27681,15 +27681,10 @@ pub fn vmaxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmax_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v8i8")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smax.v8i8" - )] - fn _vmax_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t; + unsafe { + let mask: int8x8_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmax_s8(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxq_s8)"] @@ -27710,15 +27705,10 @@ pub fn vmax_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmaxq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v16i8")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smax.v16i8" - )] - fn _vmaxq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t; + unsafe { + let mask: int8x16_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmaxq_s8(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmax_s16)"] @@ -27739,15 +27729,10 @@ pub fn vmaxq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmax_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v4i16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smax.v4i16" - )] - fn _vmax_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t; + unsafe { + let mask: int16x4_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmax_s16(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxq_s16)"] @@ -27768,15 +27753,10 @@ pub fn vmax_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmaxq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v8i16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smax.v8i16" - )] - fn _vmaxq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t; + unsafe { + let mask: int16x8_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmaxq_s16(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmax_s32)"] @@ -27797,15 +27777,10 @@ pub fn vmaxq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmax_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v2i32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smax.v2i32" - )] - fn _vmax_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t; + unsafe { + let mask: int32x2_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmax_s32(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxq_s32)"] @@ -27826,15 +27801,10 @@ pub fn vmax_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmaxq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v4i32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smax.v4i32" - )] - fn _vmaxq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t; + unsafe { + let mask: int32x4_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmaxq_s32(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmax_u8)"] @@ -27855,15 +27825,10 @@ pub fn vmaxq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmax_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v8i8")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umax.v8i8" - )] - fn _vmax_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t; + unsafe { + let mask: uint8x8_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmax_u8(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxq_u8)"] @@ -27884,15 +27849,10 @@ pub fn vmax_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmaxq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v16i8")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umax.v16i8" - )] - fn _vmaxq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t; + unsafe { + let mask: uint8x16_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmaxq_u8(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmax_u16)"] @@ -27913,15 +27873,10 @@ pub fn vmaxq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmax_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v4i16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umax.v4i16" - )] - fn _vmax_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t; + unsafe { + let mask: uint16x4_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmax_u16(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxq_u16)"] @@ -27942,15 +27897,10 @@ pub fn vmax_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmaxq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v8i16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umax.v8i16" - )] - fn _vmaxq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t; + unsafe { + let mask: uint16x8_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmaxq_u16(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmax_u32)"] @@ -27971,15 +27921,10 @@ pub fn vmaxq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmax_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v2i32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umax.v2i32" - )] - fn _vmax_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t; + unsafe { + let mask: uint32x2_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmax_u32(a, b) } } #[doc = "Maximum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxq_u32)"] @@ -28000,15 +27945,10 @@ pub fn vmax_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmaxq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v4i32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umax.v4i32" - )] - fn _vmaxq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t; + unsafe { + let mask: uint32x4_t = simd_ge(a, b); + simd_select(mask, a, b) } - unsafe { _vmaxq_u32(a, b) } } #[doc = "Floating-point Maximum Number (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnm_f16)"] @@ -28233,15 +28173,10 @@ pub fn vminq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmin_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v8i8")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smin.v8i8" - )] - fn _vmin_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t; + unsafe { + let mask: int8x8_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vmin_s8(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminq_s8)"] @@ -28262,15 +28197,10 @@ pub fn vmin_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vminq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v16i8")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smin.v16i8" - )] - fn _vminq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t; + unsafe { + let mask: int8x16_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vminq_s8(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmin_s16)"] @@ -28291,15 +28221,10 @@ pub fn vminq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmin_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v4i16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smin.v4i16" - )] - fn _vmin_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t; + unsafe { + let mask: int16x4_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vmin_s16(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminq_s16)"] @@ -28320,15 +28245,10 @@ pub fn vmin_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vminq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v8i16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smin.v8i16" - )] - fn _vminq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t; + unsafe { + let mask: int16x8_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vminq_s16(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmin_s32)"] @@ -28349,15 +28269,10 @@ pub fn vminq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmin_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v2i32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smin.v2i32" - )] - fn _vmin_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t; + unsafe { + let mask: int32x2_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vmin_s32(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminq_s32)"] @@ -28378,15 +28293,10 @@ pub fn vmin_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vminq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v4i32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smin.v4i32" - )] - fn _vminq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t; + unsafe { + let mask: int32x4_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vminq_s32(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmin_u8)"] @@ -28407,15 +28317,10 @@ pub fn vminq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmin_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v8i8")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umin.v8i8" - )] - fn _vmin_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t; + unsafe { + let mask: uint8x8_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vmin_u8(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminq_u8)"] @@ -28436,15 +28341,10 @@ pub fn vmin_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vminq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v16i8")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umin.v16i8" - )] - fn _vminq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t; + unsafe { + let mask: uint8x16_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vminq_u8(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmin_u16)"] @@ -28465,15 +28365,10 @@ pub fn vminq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmin_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v4i16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umin.v4i16" - )] - fn _vmin_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t; + unsafe { + let mask: uint16x4_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vmin_u16(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminq_u16)"] @@ -28494,15 +28389,10 @@ pub fn vmin_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vminq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v8i16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umin.v8i16" - )] - fn _vminq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t; + unsafe { + let mask: uint16x8_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vminq_u16(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmin_u32)"] @@ -28523,15 +28413,10 @@ pub fn vminq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmin_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v2i32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umin.v2i32" - )] - fn _vmin_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t; + unsafe { + let mask: uint32x2_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vmin_u32(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminq_u32)"] @@ -28552,15 +28437,10 @@ pub fn vmin_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vminq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v4i32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umin.v4i32" - )] - fn _vminq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t; + unsafe { + let mask: uint32x4_t = simd_le(a, b); + simd_select(mask, a, b) } - unsafe { _vminq_u32(a, b) } } #[doc = "Floating-point Minimum Number (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnm_f16)"] diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml index 118f5808f758..20caff2202bc 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml @@ -7135,13 +7135,8 @@ intrinsics: - int32x2_t - int32x4_t compose: - - LLVMLink: - name: "smax.{neon_type}" - links: - - link: "llvm.arm.neon.vmaxs.{neon_type}" - arch: arm - - link: "llvm.aarch64.neon.smax.{neon_type}" - arch: aarch64,arm64ec + - Let: [mask, "{neon_type}", {FnCall: [simd_ge, [a, b]]}] + - FnCall: [simd_select, [mask, a, b]] - name: "vmax{neon_type.no}" doc: Maximum (vector) @@ -7162,13 +7157,8 @@ intrinsics: - uint32x2_t - uint32x4_t compose: - - LLVMLink: - name: "smax.{neon_type}" - links: - - link: "llvm.arm.neon.vmaxu.{neon_type}" - arch: arm - - link: "llvm.aarch64.neon.umax.{neon_type}" - arch: aarch64,arm64ec + - Let: [mask, "{neon_type}", {FnCall: [simd_ge, [a, b]]}] + - FnCall: [simd_select, [mask, a, b]] - name: "vmax{neon_type.no}" doc: Maximum (vector) @@ -7309,13 +7299,8 @@ intrinsics: - int32x2_t - int32x4_t compose: - - LLVMLink: - name: "smin.{neon_type}" - links: - - link: "llvm.arm.neon.vmins.{neon_type}" - arch: arm - - link: "llvm.aarch64.neon.smin.{neon_type}" - arch: aarch64,arm64ec + - Let: [mask, "{neon_type}", {FnCall: [simd_le, [a, b]]}] + - FnCall: [simd_select, [mask, a, b]] - name: "vmin{neon_type.no}" doc: "Minimum (vector)" @@ -7336,13 +7321,8 @@ intrinsics: - uint32x2_t - uint32x4_t compose: - - LLVMLink: - name: "umin.{neon_type}" - links: - - link: "llvm.arm.neon.vminu.{neon_type}" - arch: arm - - link: "llvm.aarch64.neon.umin.{neon_type}" - arch: aarch64,arm64ec + - Let: [mask, "{neon_type}", {FnCall: [simd_le, [a, b]]}] + - FnCall: [simd_select, [mask, a, b]] - name: "vmin{neon_type.no}" doc: "Minimum (vector)" From 0e00ba127bd9babd88d488060fd85ff9b840a80e Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 10 Jul 2025 17:50:49 -0400 Subject: [PATCH 012/183] Upgrade dependencies to the latest version This picks up a fix in `rustc_apfloat` [1] that resolves a problem with `fma`. [1]: https://github.com/rust-lang/rustc_apfloat/releases/tag/rustc_apfloat-v0.2.3%2Bllvm-462a31f5a5ab --- library/compiler-builtins/builtins-test/Cargo.toml | 2 +- library/compiler-builtins/crates/libm-macros/Cargo.toml | 2 +- library/compiler-builtins/crates/musl-math-sys/Cargo.toml | 2 +- library/compiler-builtins/libm-test/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/compiler-builtins/builtins-test/Cargo.toml b/library/compiler-builtins/builtins-test/Cargo.toml index 093d4633f874..4607342cd5b9 100644 --- a/library/compiler-builtins/builtins-test/Cargo.toml +++ b/library/compiler-builtins/builtins-test/Cargo.toml @@ -12,7 +12,7 @@ license = "MIT AND Apache-2.0 WITH LLVM-exception AND (MIT OR Apache-2.0)" # `xoshiro128**` is used for its quality, size, and speed at generating `u32` shift amounts. rand_xoshiro = "0.7" # To compare float builtins against -rustc_apfloat = "0.2.2" +rustc_apfloat = "0.2.3" # Really a dev dependency, but dev dependencies can't be optional iai-callgrind = { version = "0.14.1", optional = true } diff --git a/library/compiler-builtins/crates/libm-macros/Cargo.toml b/library/compiler-builtins/crates/libm-macros/Cargo.toml index 6bbf47784ff9..100a8d0ec30e 100644 --- a/library/compiler-builtins/crates/libm-macros/Cargo.toml +++ b/library/compiler-builtins/crates/libm-macros/Cargo.toml @@ -12,7 +12,7 @@ proc-macro = true heck = "0.5.0" proc-macro2 = "1.0.95" quote = "1.0.40" -syn = { version = "2.0.101", features = ["full", "extra-traits", "visit-mut"] } +syn = { version = "2.0.104", features = ["full", "extra-traits", "visit-mut"] } [lints.rust] # Values used during testing diff --git a/library/compiler-builtins/crates/musl-math-sys/Cargo.toml b/library/compiler-builtins/crates/musl-math-sys/Cargo.toml index 3b88117343b6..39f6fa9065bd 100644 --- a/library/compiler-builtins/crates/musl-math-sys/Cargo.toml +++ b/library/compiler-builtins/crates/musl-math-sys/Cargo.toml @@ -11,4 +11,4 @@ license = "MIT OR Apache-2.0" libm = { path = "../../libm" } [build-dependencies] -cc = "1.2.25" +cc = "1.2.29" diff --git a/library/compiler-builtins/libm-test/Cargo.toml b/library/compiler-builtins/libm-test/Cargo.toml index 05fcc3234e00..e577288c9c9d 100644 --- a/library/compiler-builtins/libm-test/Cargo.toml +++ b/library/compiler-builtins/libm-test/Cargo.toml @@ -32,7 +32,7 @@ anyhow = "1.0.98" # This is not directly used but is required so we can enable `gmp-mpfr-sys/force-cross`. gmp-mpfr-sys = { version = "1.6.5", optional = true, default-features = false } iai-callgrind = { version = "0.14.1", optional = true } -indicatif = { version = "0.17.11", default-features = false } +indicatif = { version = "0.18.0", default-features = false } libm = { path = "../libm", features = ["unstable-public-internals"] } libm-macros = { path = "../crates/libm-macros" } musl-math-sys = { path = "../crates/musl-math-sys", optional = true } From f5c9403551435781afd651d62cb700eb4e81321e Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 10 Jul 2025 17:55:08 -0400 Subject: [PATCH 013/183] Upgrade `iai-callgrind` to 0.15 Pick up the latest version of iai-callgrind, which includes some output improvements. Changelog: https://github.com/iai-callgrind/iai-callgrind/releases --- library/compiler-builtins/builtins-test/Cargo.toml | 2 +- library/compiler-builtins/ci/bench-icount.sh | 2 +- library/compiler-builtins/libm-test/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/compiler-builtins/builtins-test/Cargo.toml b/library/compiler-builtins/builtins-test/Cargo.toml index 4607342cd5b9..00a9d8579d11 100644 --- a/library/compiler-builtins/builtins-test/Cargo.toml +++ b/library/compiler-builtins/builtins-test/Cargo.toml @@ -14,7 +14,7 @@ rand_xoshiro = "0.7" # To compare float builtins against rustc_apfloat = "0.2.3" # Really a dev dependency, but dev dependencies can't be optional -iai-callgrind = { version = "0.14.1", optional = true } +iai-callgrind = { version = "0.15.2", optional = true } [dependencies.compiler_builtins] path = "../builtins-shim" diff --git a/library/compiler-builtins/ci/bench-icount.sh b/library/compiler-builtins/ci/bench-icount.sh index d2baebb52d8f..12228b9da971 100755 --- a/library/compiler-builtins/ci/bench-icount.sh +++ b/library/compiler-builtins/ci/bench-icount.sh @@ -28,7 +28,7 @@ function run_icount_benchmarks() { iai_args=( "--home" "$(pwd)/$iai_home" - "--regression=ir=5.0" + "--callgrind-limits=ir=5.0" "--save-summary" ) diff --git a/library/compiler-builtins/libm-test/Cargo.toml b/library/compiler-builtins/libm-test/Cargo.toml index e577288c9c9d..0af6b0c1da5c 100644 --- a/library/compiler-builtins/libm-test/Cargo.toml +++ b/library/compiler-builtins/libm-test/Cargo.toml @@ -31,7 +31,7 @@ short-benchmarks = [] anyhow = "1.0.98" # This is not directly used but is required so we can enable `gmp-mpfr-sys/force-cross`. gmp-mpfr-sys = { version = "1.6.5", optional = true, default-features = false } -iai-callgrind = { version = "0.14.1", optional = true } +iai-callgrind = { version = "0.15.2", optional = true } indicatif = { version = "0.18.0", default-features = false } libm = { path = "../libm", features = ["unstable-public-internals"] } libm-macros = { path = "../crates/libm-macros" } From a8110072ff086711d105141a4c072af5077c0fab Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Fri, 11 Jul 2025 11:13:13 +0000 Subject: [PATCH 014/183] thumbv7neon-unknown-linux-gnueabihf clippy fixes --- .../src/arm_shared/neon/generated.rs | 113 +++--------------- .../spec/neon/arm_shared.spec.yml | 38 +++--- 2 files changed, 38 insertions(+), 113 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs index b55d2383851d..088377c13fc3 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs @@ -39546,17 +39546,7 @@ pub fn vqrshrn_n_s16(a: int16x8_t) -> int8x8_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftns.v8i8")] fn _vqrshrn_n_s16(a: int16x8_t, n: int16x8_t) -> int8x8_t; } - unsafe { - _vqrshrn_n_s16( - a, - const { - int16x8_t([ - -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, - -N as i16, - ]) - }, - ) - } + unsafe { _vqrshrn_n_s16(a, const { int16x8_t([-N as i16; 8]) }) } } #[doc = "Signed saturating rounded shift right narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrn_n_s32)"] @@ -39572,12 +39562,7 @@ pub fn vqrshrn_n_s32(a: int32x4_t) -> int16x4_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftns.v4i16")] fn _vqrshrn_n_s32(a: int32x4_t, n: int32x4_t) -> int16x4_t; } - unsafe { - _vqrshrn_n_s32( - a, - const { int32x4_t([-N as i32, -N as i32, -N as i32, -N as i32]) }, - ) - } + unsafe { _vqrshrn_n_s32(a, const { int32x4_t([-N; 4]) }) } } #[doc = "Signed saturating rounded shift right narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrn_n_s64)"] @@ -39593,7 +39578,7 @@ pub fn vqrshrn_n_s64(a: int64x2_t) -> int32x2_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftns.v2i32")] fn _vqrshrn_n_s64(a: int64x2_t, n: int64x2_t) -> int32x2_t; } - unsafe { _vqrshrn_n_s64(a, const { int64x2_t([-N as i64, -N as i64]) }) } + unsafe { _vqrshrn_n_s64(a, const { int64x2_t([-N as i64; 2]) }) } } #[doc = "Signed saturating rounded shift right narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrn_n_s16)"] @@ -39786,17 +39771,7 @@ pub fn vqrshrun_n_s16(a: int16x8_t) -> uint8x8_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnsu.v8i8")] fn _vqrshrun_n_s16(a: int16x8_t, n: int16x8_t) -> uint8x8_t; } - unsafe { - _vqrshrun_n_s16( - a, - const { - int16x8_t([ - -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, - -N as i16, - ]) - }, - ) - } + unsafe { _vqrshrun_n_s16(a, const { int16x8_t([-N as i16; 8]) }) } } #[doc = "Signed saturating rounded shift right unsigned narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrun_n_s32)"] @@ -39812,12 +39787,7 @@ pub fn vqrshrun_n_s32(a: int32x4_t) -> uint16x4_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnsu.v4i16")] fn _vqrshrun_n_s32(a: int32x4_t, n: int32x4_t) -> uint16x4_t; } - unsafe { - _vqrshrun_n_s32( - a, - const { int32x4_t([-N as i32, -N as i32, -N as i32, -N as i32]) }, - ) - } + unsafe { _vqrshrun_n_s32(a, const { int32x4_t([-N; 4]) }) } } #[doc = "Signed saturating rounded shift right unsigned narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrun_n_s64)"] @@ -39833,7 +39803,7 @@ pub fn vqrshrun_n_s64(a: int64x2_t) -> uint32x2_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnsu.v2i32")] fn _vqrshrun_n_s64(a: int64x2_t, n: int64x2_t) -> uint32x2_t; } - unsafe { _vqrshrun_n_s64(a, const { int64x2_t([-N as i64, -N as i64]) }) } + unsafe { _vqrshrun_n_s64(a, const { int64x2_t([-N as i64; 2]) }) } } #[doc = "Signed saturating rounded shift right unsigned narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrun_n_s16)"] @@ -41018,17 +40988,7 @@ pub fn vqshrn_n_s16(a: int16x8_t) -> int8x8_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftns.v8i8")] fn _vqshrn_n_s16(a: int16x8_t, n: int16x8_t) -> int8x8_t; } - unsafe { - _vqshrn_n_s16( - a, - const { - int16x8_t([ - -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, - -N as i16, - ]) - }, - ) - } + unsafe { _vqshrn_n_s16(a, const { int16x8_t([-N as i16; 8]) }) } } #[doc = "Signed saturating shift right narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrn_n_s32)"] @@ -41044,12 +41004,7 @@ pub fn vqshrn_n_s32(a: int32x4_t) -> int16x4_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftns.v4i16")] fn _vqshrn_n_s32(a: int32x4_t, n: int32x4_t) -> int16x4_t; } - unsafe { - _vqshrn_n_s32( - a, - const { int32x4_t([-N as i32, -N as i32, -N as i32, -N as i32]) }, - ) - } + unsafe { _vqshrn_n_s32(a, const { int32x4_t([-N; 4]) }) } } #[doc = "Signed saturating shift right narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrn_n_s64)"] @@ -41065,7 +41020,7 @@ pub fn vqshrn_n_s64(a: int64x2_t) -> int32x2_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftns.v2i32")] fn _vqshrn_n_s64(a: int64x2_t, n: int64x2_t) -> int32x2_t; } - unsafe { _vqshrn_n_s64(a, const { int64x2_t([-N as i64, -N as i64]) }) } + unsafe { _vqshrn_n_s64(a, const { int64x2_t([-N as i64; 2]) }) } } #[doc = "Signed saturating shift right narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrn_n_s16)"] @@ -41258,17 +41213,7 @@ pub fn vqshrun_n_s16(a: int16x8_t) -> uint8x8_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnsu.v8i8")] fn _vqshrun_n_s16(a: int16x8_t, n: int16x8_t) -> uint8x8_t; } - unsafe { - _vqshrun_n_s16( - a, - const { - int16x8_t([ - -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, - -N as i16, - ]) - }, - ) - } + unsafe { _vqshrun_n_s16(a, const { int16x8_t([-N as i16; 8]) }) } } #[doc = "Signed saturating shift right unsigned narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrun_n_s32)"] @@ -41284,12 +41229,7 @@ pub fn vqshrun_n_s32(a: int32x4_t) -> uint16x4_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnsu.v4i16")] fn _vqshrun_n_s32(a: int32x4_t, n: int32x4_t) -> uint16x4_t; } - unsafe { - _vqshrun_n_s32( - a, - const { int32x4_t([-N as i32, -N as i32, -N as i32, -N as i32]) }, - ) - } + unsafe { _vqshrun_n_s32(a, const { int32x4_t([-N; 4]) }) } } #[doc = "Signed saturating shift right unsigned narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrun_n_s64)"] @@ -41305,7 +41245,7 @@ pub fn vqshrun_n_s64(a: int64x2_t) -> uint32x2_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnsu.v2i32")] fn _vqshrun_n_s64(a: int64x2_t, n: int64x2_t) -> uint32x2_t; } - unsafe { _vqshrun_n_s64(a, const { int64x2_t([-N as i64, -N as i64]) }) } + unsafe { _vqshrun_n_s64(a, const { int64x2_t([-N as i64; 2]) }) } } #[doc = "Signed saturating shift right unsigned narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrun_n_s16)"] @@ -59463,17 +59403,7 @@ pub fn vrshrn_n_s16(a: int16x8_t) -> int8x8_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftn.v8i8")] fn _vrshrn_n_s16(a: int16x8_t, n: int16x8_t) -> int8x8_t; } - unsafe { - _vrshrn_n_s16( - a, - const { - int16x8_t([ - -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, - -N as i16, - ]) - }, - ) - } + unsafe { _vrshrn_n_s16(a, const { int16x8_t([-N as i16; 8]) }) } } #[doc = "Rounding shift right narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrshrn_n_s32)"] @@ -59489,12 +59419,7 @@ pub fn vrshrn_n_s32(a: int32x4_t) -> int16x4_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftn.v4i16")] fn _vrshrn_n_s32(a: int32x4_t, n: int32x4_t) -> int16x4_t; } - unsafe { - _vrshrn_n_s32( - a, - const { int32x4_t([-N as i32, -N as i32, -N as i32, -N as i32]) }, - ) - } + unsafe { _vrshrn_n_s32(a, const { int32x4_t([-N; 4]) }) } } #[doc = "Rounding shift right narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrshrn_n_s64)"] @@ -59510,7 +59435,7 @@ pub fn vrshrn_n_s64(a: int64x2_t) -> int32x2_t { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftn.v2i32")] fn _vrshrn_n_s64(a: int64x2_t, n: int64x2_t) -> int32x2_t; } - unsafe { _vrshrn_n_s64(a, const { int64x2_t([-N as i64, -N as i64]) }) } + unsafe { _vrshrn_n_s64(a, const { int64x2_t([-N as i64; 2]) }) } } #[doc = "Rounding shift right narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrshrn_n_s16)"] @@ -63163,7 +63088,7 @@ pub fn vsli_n_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t { transmute(vshiftins_v2i32( transmute(a), transmute(b), - int32x2_t::splat(N as i32), + int32x2_t::splat(N), )) } } @@ -63181,7 +63106,7 @@ pub fn vsliq_n_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { transmute(vshiftins_v4i32( transmute(a), transmute(b), - int32x4_t::splat(N as i32), + int32x4_t::splat(N), )) } } @@ -63719,7 +63644,7 @@ pub fn vsriq_n_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t { static_assert!(1 <= N && N <= 32); - vshiftins_v2i32(a, b, int32x2_t::splat(-N as i32)) + vshiftins_v2i32(a, b, int32x2_t::splat(-N)) } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_s32)"] @@ -63731,7 +63656,7 @@ pub fn vsri_n_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { static_assert!(1 <= N && N <= 32); - vshiftins_v4i32(a, b, int32x4_t::splat(-N as i32)) + vshiftins_v4i32(a, b, int32x4_t::splat(-N)) } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_s64)"] diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml index f6d9103f055b..0264bb938d98 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml @@ -7874,9 +7874,9 @@ intrinsics: static_defs: ['const N: i32'] safety: safe types: - - [int16x8_t, int8x8_t, 'N >= 1 && N <= 8', 'const { int16x8_t([-N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16]) }'] - - [int32x4_t, int16x4_t, 'N >= 1 && N <= 16', 'const { int32x4_t([-N as i32, -N as i32, -N as i32, -N as i32]) }'] - - [int64x2_t, int32x2_t, 'N >= 1 && N <= 32', 'const { int64x2_t([-N as i64, -N as i64]) }'] + - [int16x8_t, int8x8_t, 'N >= 1 && N <= 8', 'const { int16x8_t([-N as i16; 8]) }'] + - [int32x4_t, int16x4_t, 'N >= 1 && N <= 16', 'const { int32x4_t([-N; 4]) }'] + - [int64x2_t, int32x2_t, 'N >= 1 && N <= 32', 'const { int64x2_t([-N as i64; 2]) }'] compose: - FnCall: [static_assert!, ["{type[2]}"]] - LLVMLink: @@ -7929,9 +7929,9 @@ intrinsics: static_defs: ['const N: i32'] safety: safe types: - - [int16x8_t, uint8x8_t, 'N >= 1 && N <= 8', 'const { int16x8_t([-N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16]) }'] - - [int32x4_t, uint16x4_t, 'N >= 1 && N <= 16', 'const { int32x4_t([-N as i32, -N as i32, -N as i32, -N as i32]) }'] - - [int64x2_t, uint32x2_t, 'N >= 1 && N <= 32', 'const { int64x2_t([-N as i64, -N as i64]) }'] + - [int16x8_t, uint8x8_t, 'N >= 1 && N <= 8', 'const { int16x8_t([-N as i16; 8]) }'] + - [int32x4_t, uint16x4_t, 'N >= 1 && N <= 16', 'const { int32x4_t([-N; 4]) }'] + - [int64x2_t, uint32x2_t, 'N >= 1 && N <= 32', 'const { int64x2_t([-N as i64; 2]) }'] compose: - FnCall: [static_assert!, ["{type[2]}"]] - LLVMLink: @@ -8105,9 +8105,9 @@ intrinsics: static_defs: ['const N: i32'] safety: safe types: - - [int16x8_t, int8x8_t, 'N >= 1 && N <= 8', 'const { int16x8_t([-N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16]) }'] - - [int32x4_t, int16x4_t, 'N >= 1 && N <= 16', 'const { int32x4_t([-N as i32, -N as i32, -N as i32, -N as i32]) }'] - - [int64x2_t, int32x2_t, 'N >= 1 && N <= 32', 'const { int64x2_t([-N as i64, -N as i64]) }'] + - [int16x8_t, int8x8_t, 'N >= 1 && N <= 8', 'const { int16x8_t([-N as i16; 8]) }'] + - [int32x4_t, int16x4_t, 'N >= 1 && N <= 16', 'const { int32x4_t([-N; 4]) }'] + - [int64x2_t, int32x2_t, 'N >= 1 && N <= 32', 'const { int64x2_t([-N as i64; 2]) }'] compose: - FnCall: [static_assert!, ["{type[2]}"]] - LLVMLink: @@ -8215,9 +8215,9 @@ intrinsics: static_defs: ['const N: i32'] safety: safe types: - - [int16x8_t, uint8x8_t, 'N >= 1 && N <= 8', 'const { int16x8_t([-N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16]) }'] - - [int32x4_t, uint16x4_t, 'N >= 1 && N <= 16', 'const { int32x4_t([-N as i32, -N as i32, -N as i32, -N as i32]) }'] - - [int64x2_t, uint32x2_t, 'N >= 1 && N <= 32', 'const { int64x2_t([-N as i64, -N as i64]) }'] + - [int16x8_t, uint8x8_t, 'N >= 1 && N <= 8', 'const { int16x8_t([-N as i16; 8]) }'] + - [int32x4_t, uint16x4_t, 'N >= 1 && N <= 16', 'const { int32x4_t([-N; 4]) }'] + - [int64x2_t, uint32x2_t, 'N >= 1 && N <= 32', 'const { int64x2_t([-N as i64; 2]) }'] compose: - FnCall: [static_assert!, ["{type[2]}"]] - LLVMLink: @@ -8939,9 +8939,9 @@ intrinsics: static_defs: ['const N: i32'] safety: safe types: - - [int16x8_t, int8x8_t, 'N >= 1 && N <= 8', 'const { int16x8_t([-N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16]) }'] - - [int32x4_t, int16x4_t, 'N >= 1 && N <= 16', 'const { int32x4_t([-N as i32, -N as i32, -N as i32, -N as i32]) }'] - - [int64x2_t, int32x2_t, 'N >= 1 && N <= 32', 'const { int64x2_t([-N as i64, -N as i64]) }'] + - [int16x8_t, int8x8_t, 'N >= 1 && N <= 8', 'const { int16x8_t([-N as i16; 8]) }'] + - [int32x4_t, int16x4_t, 'N >= 1 && N <= 16', 'const { int32x4_t([-N; 4]) }'] + - [int64x2_t, int32x2_t, 'N >= 1 && N <= 32', 'const { int64x2_t([-N as i64; 2]) }'] compose: - FnCall: [static_assert!, ["{type[2]}"]] - LLVMLink: @@ -13862,8 +13862,8 @@ intrinsics: - [int8x16_t, '8', '1 <= N && N <= 8', 'v16i8', 'int8x16_t::splat', '-N as i8'] - [int16x4_t, '16', '1 <= N && N <= 16', 'v4i16', 'int16x4_t::splat', '-N as i16'] - [int16x8_t, '16', '1 <= N && N <= 16', 'v8i16', 'int16x8_t::splat', '-N as i16'] - - [int32x2_t, '32', '1 <= N && N <= 32', 'v2i32', 'int32x2_t::splat', '-N as i32'] - - [int32x4_t, '32', '1 <= N && N <= 32', 'v4i32', 'int32x4_t::splat', '-N as i32'] + - [int32x2_t, '32', '1 <= N && N <= 32', 'v2i32', 'int32x2_t::splat', '-N'] + - [int32x4_t, '32', '1 <= N && N <= 32', 'v4i32', 'int32x4_t::splat', '-N'] - [int64x1_t, '64', '1 <= N && N <= 64', 'v1i64', 'int64x1_t::splat', '-N as i64'] - [int64x2_t, '64', '1 <= N && N <= 64', 'v2i64', 'int64x2_t::splat', '-N as i64'] compose: @@ -13891,8 +13891,8 @@ intrinsics: - [uint8x16_t, "neon,v7", '8', 'static_assert_uimm_bits!', 'N, 3', 'v16i8', 'int8x16_t::splat', 'N as i8'] - [uint16x4_t, "neon,v7", '16', 'static_assert_uimm_bits!', 'N, 4', 'v4i16', 'int16x4_t::splat', 'N as i16'] - [uint16x8_t, "neon,v7", '16', 'static_assert_uimm_bits!', 'N, 4', 'v8i16', 'int16x8_t::splat', 'N as i16'] - - [uint32x2_t, "neon,v7", '32', 'static_assert!', 'N >= 0 && N <= 31', 'v2i32', 'int32x2_t::splat', 'N as i32'] - - [uint32x4_t, "neon,v7", '32', 'static_assert!', 'N >= 0 && N <= 31', 'v4i32', 'int32x4_t::splat', 'N as i32'] + - [uint32x2_t, "neon,v7", '32', 'static_assert!', 'N >= 0 && N <= 31', 'v2i32', 'int32x2_t::splat', 'N'] + - [uint32x4_t, "neon,v7", '32', 'static_assert!', 'N >= 0 && N <= 31', 'v4i32', 'int32x4_t::splat', 'N'] - [uint64x1_t, "neon,v7", '64', 'static_assert!', 'N >= 0 && N <= 63', 'v1i64', 'int64x1_t::splat', 'N as i64'] - [uint64x2_t, "neon,v7", '64', 'static_assert!', 'N >= 0 && N <= 63', 'v2i64', 'int64x2_t::splat', 'N as i64'] - [poly8x8_t, "neon,v7", '8', 'static_assert_uimm_bits!', 'N, 3', 'v8i8', 'int8x8_t::splat', 'N as i8'] From beb1b7d1a8db453d31f324a6e3d036a7624fba55 Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Fri, 11 Jul 2025 13:07:52 +0000 Subject: [PATCH 015/183] connect5: clippy fixes --- library/stdarch/examples/connect5.rs | 37 +++++++++------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/library/stdarch/examples/connect5.rs b/library/stdarch/examples/connect5.rs index 2b451f45d71c..1d8e0f0990a6 100644 --- a/library/stdarch/examples/connect5.rs +++ b/library/stdarch/examples/connect5.rs @@ -558,7 +558,8 @@ fn search(pos: &Pos, alpha: i32, beta: i32, depth: i32, _ply: i32) -> i32 { assert_ne!(bm, MOVE_NONE); assert!(bs >= -EVAL_INF && bs <= EVAL_INF); - if _ply == 0 { bm } else { bs } //best move at the root node, best score elsewhere + // best move at the root node, best score elsewhere + if _ply == 0 { bm } else { bs } } /// Evaluation function: give different scores to different patterns after a fixed depth. @@ -570,15 +571,11 @@ fn eval(pos: &Pos, _ply: i32) -> i32 { #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { if check_x86_avx512_features() { - unsafe { - if check_patternlive4_avx512(pos, def) { - return -4096; - } - } - } else { - if check_patternlive4(pos, def) { + if unsafe { check_patternlive4_avx512(pos, def) } { return -4096; } + } else if check_patternlive4(pos, def) { + return -4096; } } @@ -593,15 +590,11 @@ fn eval(pos: &Pos, _ply: i32) -> i32 { #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { if check_x86_avx512_features() { - unsafe { - if check_patternlive4_avx512(pos, atk) { - return 2560; - } - } - } else { - if check_patternlive4(pos, atk) { + if unsafe { check_patternlive4_avx512(pos, atk) } { return 2560; } + } else if check_patternlive4(pos, atk) { + return 2560; } } @@ -616,15 +609,11 @@ fn eval(pos: &Pos, _ply: i32) -> i32 { #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { if check_x86_avx512_features() { - unsafe { - if check_patterndead4_avx512(pos, atk) > 0 { - return 2560; - } - } - } else { - if check_patterndead4(pos, atk) > 0 { + if unsafe { check_patterndead4_avx512(pos, atk) > 0 } { return 2560; } + } else if check_patterndead4(pos, atk) > 0 { + return 2560; } } @@ -909,9 +898,7 @@ fn pos_is_winner_avx512(pos: &Pos) -> bool { 0b00_10_10_10_10_11_10_10_10_10_11_11_11_11_11_10]; let mut count_match: i32 = 0; - for dir in 0..2 { - // direction 0 and 1 - let mut board0 = board0org[dir]; + for mut board0 in board0org { let boardf = _mm512_and_si512(answer, board0); let temp_mask = _mm512_mask_cmpeq_epi16_mask(answer_mask[0], answer, boardf); count_match += _popcnt32(temp_mask as i32); From 30556edc579a80ce1f206db0559c758c520b9e83 Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Fri, 11 Jul 2025 17:57:11 +0000 Subject: [PATCH 016/183] tests: neon is arm --- library/stdarch/crates/simd-test-macro/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/stdarch/crates/simd-test-macro/src/lib.rs b/library/stdarch/crates/simd-test-macro/src/lib.rs index 855e969e1eb7..aa36cb928a41 100644 --- a/library/stdarch/crates/simd-test-macro/src/lib.rs +++ b/library/stdarch/crates/simd-test-macro/src/lib.rs @@ -57,7 +57,7 @@ pub fn simd_test( .unwrap_or_else(|| panic!("target triple contained no \"-\": {target}")) { "i686" | "x86_64" | "i586" => "is_x86_feature_detected", - "arm" | "armv7" => "is_arm_feature_detected", + "arm" | "armv7" | "thumbv7neon" => "is_arm_feature_detected", "aarch64" | "arm64ec" | "aarch64_be" => "is_aarch64_feature_detected", maybe_riscv if maybe_riscv.starts_with("riscv") => "is_riscv_feature_detected", "powerpc" | "powerpcle" => "is_powerpc_feature_detected", From d6feec7735f78f1d87e103ff25806d9147afc4a9 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sat, 12 Jul 2025 00:49:36 +0200 Subject: [PATCH 017/183] `stdarch-gen-arm`: remove `lazy_static`, use `LazyLock` instead --- library/stdarch/Cargo.lock | 1 - .../stdarch/crates/stdarch-gen-arm/Cargo.toml | 1 - .../crates/stdarch-gen-arm/src/expression.rs | 8 +++----- .../stdarch-gen-arm/src/load_store_tests.rs | 20 ++++++++----------- .../crates/stdarch-gen-arm/src/typekinds.rs | 13 ++++++------ .../crates/stdarch-gen-arm/src/wildcards.rs | 9 ++++----- 6 files changed, 21 insertions(+), 31 deletions(-) diff --git a/library/stdarch/Cargo.lock b/library/stdarch/Cargo.lock index 80f424dfdd8d..4bdd423270c8 100644 --- a/library/stdarch/Cargo.lock +++ b/library/stdarch/Cargo.lock @@ -703,7 +703,6 @@ name = "stdarch-gen-arm" version = "0.1.0" dependencies = [ "itertools", - "lazy_static", "proc-macro2", "quote", "regex", diff --git a/library/stdarch/crates/stdarch-gen-arm/Cargo.toml b/library/stdarch/crates/stdarch-gen-arm/Cargo.toml index 899296d25ea7..312019f454cb 100644 --- a/library/stdarch/crates/stdarch-gen-arm/Cargo.toml +++ b/library/stdarch/crates/stdarch-gen-arm/Cargo.toml @@ -13,7 +13,6 @@ edition = "2024" [dependencies] itertools = "0.14.0" -lazy_static = "1.4.0" proc-macro2 = "1.0" quote = "1.0" regex = "1.5" diff --git a/library/stdarch/crates/stdarch-gen-arm/src/expression.rs b/library/stdarch/crates/stdarch-gen-arm/src/expression.rs index 56c94602fff9..d5644ef27d4b 100644 --- a/library/stdarch/crates/stdarch-gen-arm/src/expression.rs +++ b/library/stdarch/crates/stdarch-gen-arm/src/expression.rs @@ -1,5 +1,4 @@ use itertools::Itertools; -use lazy_static::lazy_static; use proc_macro2::{Literal, Punct, Spacing, TokenStream}; use quote::{ToTokens, TokenStreamExt, format_ident, quote}; use regex::Regex; @@ -7,6 +6,7 @@ use serde::de::{self, MapAccess, Visitor}; use serde::{Deserialize, Deserializer, Serialize}; use std::fmt; use std::str::FromStr; +use std::sync::LazyLock; use crate::intrinsic::Intrinsic; use crate::wildstring::WildStringPart; @@ -374,10 +374,8 @@ impl FromStr for Expression { type Err = String; fn from_str(s: &str) -> Result { - lazy_static! { - static ref MACRO_RE: Regex = - Regex::new(r"^(?P[\w\d_]+)!\((?P.*?)\);?$").unwrap(); - } + static MACRO_RE: LazyLock = + LazyLock::new(|| Regex::new(r"^(?P[\w\d_]+)!\((?P.*?)\);?$").unwrap()); if s == "SvUndef" { Ok(Expression::SvUndef) diff --git a/library/stdarch/crates/stdarch-gen-arm/src/load_store_tests.rs b/library/stdarch/crates/stdarch-gen-arm/src/load_store_tests.rs index 5cf39b2e11ae..3f3bfed132c7 100644 --- a/library/stdarch/crates/stdarch-gen-arm/src/load_store_tests.rs +++ b/library/stdarch/crates/stdarch-gen-arm/src/load_store_tests.rs @@ -2,6 +2,7 @@ use std::fs::File; use std::io::Write; use std::path::PathBuf; use std::str::FromStr; +use std::sync::LazyLock; use crate::format_code; use crate::input::InputType; @@ -10,7 +11,6 @@ use crate::typekinds::BaseType; use crate::typekinds::{ToRepr, TypeKind}; use itertools::Itertools; -use lazy_static::lazy_static; use proc_macro2::TokenStream; use quote::{format_ident, quote}; @@ -639,8 +639,8 @@ impl LdIntrCharacteristics { } } -lazy_static! { - static ref PREAMBLE: String = format!( +static PREAMBLE: LazyLock = LazyLock::new(|| { + format!( r#"#![allow(unused)] use super::*; @@ -801,13 +801,11 @@ fn assert_vector_matches_u64(vector: svuint64_t, expected: svuint64_t) {{ assert!(!svptest_any(defined, cmp)) }} "# - ); -} + ) +}); -lazy_static! { - static ref MANUAL_TESTS: String = format!( - "#[simd_test(enable = \"sve\")] -unsafe fn test_ffr() {{ +const MANUAL_TESTS: &str = "#[simd_test(enable = \"sve\")] +unsafe fn test_ffr() { svsetffr(); let ffr = svrdffr(); assert_vector_matches_u8(svdup_n_u8_z(ffr, 1), svindex_u8(1, 0)); @@ -816,7 +814,5 @@ unsafe fn test_ffr() {{ svwrffr(pred); let ffr = svrdffr_z(svptrue_b8()); assert_vector_matches_u8(svdup_n_u8_z(ffr, 1), svdup_n_u8_z(pred, 1)); -}} -" - ); } +"; diff --git a/library/stdarch/crates/stdarch-gen-arm/src/typekinds.rs b/library/stdarch/crates/stdarch-gen-arm/src/typekinds.rs index 7c697cb7c0c4..bd47ff2bd155 100644 --- a/library/stdarch/crates/stdarch-gen-arm/src/typekinds.rs +++ b/library/stdarch/crates/stdarch-gen-arm/src/typekinds.rs @@ -1,10 +1,10 @@ -use lazy_static::lazy_static; use proc_macro2::TokenStream; use quote::{ToTokens, TokenStreamExt, quote}; use regex::Regex; use serde_with::{DeserializeFromStr, SerializeDisplay}; use std::fmt; use std::str::FromStr; +use std::sync::LazyLock; use crate::context; use crate::expression::{Expression, FnCall}; @@ -496,9 +496,9 @@ impl FromStr for VectorType { type Err = String; fn from_str(s: &str) -> Result { - lazy_static! { - static ref RE: Regex = Regex::new(r"^(?:(?:sv(?P(?:uint|int|bool|float)(?:\d+)?))|(?:(?P(?:uint|int|bool|poly|float)(?:\d+)?)x(?P(?:\d+)?)))(?:x(?P2|3|4))?_t$").unwrap(); - } + static RE: LazyLock = LazyLock::new(|| { + Regex::new(r"^(?:(?:sv(?P(?:uint|int|bool|float)(?:\d+)?))|(?:(?P(?:uint|int|bool|poly|float)(?:\d+)?)x(?P(?:\d+)?)))(?:x(?P2|3|4))?_t$").unwrap() + }); if let Some(c) = RE.captures(s) { let (base_type, lanes) = Self::sanitise_lanes( @@ -698,9 +698,8 @@ impl FromStr for BaseType { type Err = String; fn from_str(s: &str) -> Result { - lazy_static! { - static ref RE: Regex = Regex::new(r"^(?P[a-zA-Z]+)(?P\d+)?(_t)?$").unwrap(); - } + static RE: LazyLock = + LazyLock::new(|| Regex::new(r"^(?P[a-zA-Z]+)(?P\d+)?(_t)?$").unwrap()); if let Some(c) = RE.captures(s) { let kind = c["kind"].parse()?; diff --git a/library/stdarch/crates/stdarch-gen-arm/src/wildcards.rs b/library/stdarch/crates/stdarch-gen-arm/src/wildcards.rs index 25aa80348927..6c40d88df45f 100644 --- a/library/stdarch/crates/stdarch-gen-arm/src/wildcards.rs +++ b/library/stdarch/crates/stdarch-gen-arm/src/wildcards.rs @@ -1,8 +1,7 @@ -use lazy_static::lazy_static; use regex::Regex; use serde_with::{DeserializeFromStr, SerializeDisplay}; -use std::fmt; use std::str::FromStr; +use std::{fmt, sync::LazyLock}; use crate::{ fn_suffix::SuffixKind, @@ -66,9 +65,9 @@ impl FromStr for Wildcard { type Err = String; fn from_str(s: &str) -> Result { - lazy_static! { - static ref RE: Regex = Regex::new(r"^(?P\w+?)(?:_x(?P[2-4]))?(?:\[(?P\d+)\])?(?:\.(?P\w+))?(?:\s+as\s+(?P.*?))?$").unwrap(); - } + static RE: LazyLock = LazyLock::new(|| { + Regex::new(r"^(?P\w+?)(?:_x(?P[2-4]))?(?:\[(?P\d+)\])?(?:\.(?P\w+))?(?:\s+as\s+(?P.*?))?$").unwrap() + }); if let Some(c) = RE.captures(s) { let wildcard_name = &c["wildcard"]; From 9de6e2c5477f56031b5737257f2213ba96e794ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sat, 12 Jul 2025 16:21:32 +0200 Subject: [PATCH 018/183] Add rustc-pull CI automation --- .../stdarch/.github/workflows/rustc-pull.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 library/stdarch/.github/workflows/rustc-pull.yml diff --git a/library/stdarch/.github/workflows/rustc-pull.yml b/library/stdarch/.github/workflows/rustc-pull.yml new file mode 100644 index 000000000000..6b90d8a500f0 --- /dev/null +++ b/library/stdarch/.github/workflows/rustc-pull.yml @@ -0,0 +1,22 @@ +# Perform a subtree sync (pull) using the josh-sync tool once every few days (or on demand). +name: rustc-pull + +on: + workflow_dispatch: + schedule: + # Run at 04:00 UTC every Monday and Thursday + - cron: '0 4 * * 1,4' + +jobs: + pull: + if: github.repository == 'rust-lang/stdarch' + uses: rust-lang/josh-sync/.github/workflows/rustc-pull.yml@main + with: + # https://rust-lang.zulipchat.com/#narrow/channel/208962-t-libs.2Fstdarch/topic/Subtree.20sync.20automation/with/528461782 + zulip-stream-id: 208962 + zulip-bot-email: "stdarch-ci-bot@rust-lang.zulipchat.com" + pr-base-branch: master + branch-name: rustc-pull + secrets: + zulip-api-token: ${{ secrets.ZULIP_API_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} From ca70466fa37bbd5233ea154d81cc51e7f8ceb3c9 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sat, 12 Jul 2025 16:42:12 +0200 Subject: [PATCH 019/183] `aarch64`: use `f16::min` and `f16::max` --- .../core_arch/src/aarch64/neon/generated.rs | 18 ++---------------- .../stdarch-gen-arm/spec/neon/aarch64.spec.yml | 12 ++---------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs index 32f144bc7adc..052e5762297a 100644 --- a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs @@ -13261,14 +13261,7 @@ pub fn vmaxnmq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg_attr(test, assert_instr(fmaxnm))] pub fn vmaxnmh_f16(a: f16, b: f16) -> f16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnm.f16" - )] - fn _vmaxnmh_f16(a: f16, b: f16) -> f16; - } - unsafe { _vmaxnmh_f16(a, b) } + f16::max(a, b) } #[doc = "Floating-point maximum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnmv_f16)"] @@ -13709,14 +13702,7 @@ pub fn vminnmq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg_attr(test, assert_instr(fminnm))] pub fn vminnmh_f16(a: f16, b: f16) -> f16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnm.f16" - )] - fn _vminnmh_f16(a: f16, b: f16) -> f16; - } - unsafe { _vminnmh_f16(a, b) } + f16::min(a, b) } #[doc = "Floating-point minimum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnmv_f16)"] diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml index f0dce681d9c3..2f9bf587872b 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml @@ -6611,11 +6611,7 @@ intrinsics: types: - f16 compose: - - LLVMLink: - name: "vmaxh.{neon_type}" - links: - - link: "llvm.aarch64.neon.fmaxnm.{type}" - arch: aarch64,arm64ec + - FnCall: ["f16::max", [a, b]] - name: "vminnmh_{type}" @@ -6630,11 +6626,7 @@ intrinsics: types: - f16 compose: - - LLVMLink: - name: "vminh.{neon_type}" - links: - - link: "llvm.aarch64.neon.fminnm.{type}" - arch: aarch64,arm64ec + - FnCall: ["f16::min", [a, b]] - name: "vmaxnmv{neon_type[0].no}" From 441824cfcad6c42069577c599e51707812b27a6c Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sat, 12 Jul 2025 16:45:51 +0200 Subject: [PATCH 020/183] `aarch64`: use `simd_fmin` and `simd_fmax` --- .../core_arch/src/aarch64/neon/generated.rs | 36 +++---------------- .../spec/neon/aarch64.spec.yml | 13 ++----- 2 files changed, 6 insertions(+), 43 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs index 052e5762297a..e888346a0818 100644 --- a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs @@ -13229,14 +13229,7 @@ pub fn vmaxh_f16(a: f16, b: f16) -> f16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(fmaxnm))] pub fn vmaxnm_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnm.v1f64" - )] - fn _vmaxnm_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t; - } - unsafe { _vmaxnm_f64(a, b) } + unsafe { simd_fmax(a, b) } } #[doc = "Floating-point Maximum Number (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnmq_f64)"] @@ -13245,14 +13238,7 @@ pub fn vmaxnm_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(fmaxnm))] pub fn vmaxnmq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnm.v2f64" - )] - fn _vmaxnmq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t; - } - unsafe { _vmaxnmq_f64(a, b) } + unsafe { simd_fmax(a, b) } } #[doc = "Floating-point Maximum Number"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnmh_f16)"] @@ -13670,14 +13656,7 @@ pub fn vminh_f16(a: f16, b: f16) -> f16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(fminnm))] pub fn vminnm_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnm.v1f64" - )] - fn _vminnm_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t; - } - unsafe { _vminnm_f64(a, b) } + unsafe { simd_fmin(a, b) } } #[doc = "Floating-point Minimum Number (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnmq_f64)"] @@ -13686,14 +13665,7 @@ pub fn vminnm_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(fminnm))] pub fn vminnmq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnm.v2f64" - )] - fn _vminnmq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t; - } - unsafe { _vminnmq_f64(a, b) } + unsafe { simd_fmin(a, b) } } #[doc = "Floating-point Minimum Number"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnmh_f16)"] diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml index 2f9bf587872b..821dc52bf37d 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml @@ -6580,7 +6580,6 @@ intrinsics: arch: aarch64,arm64ec - - name: "vmaxnm{neon_type.no}" doc: Floating-point Maximum Number (vector) arguments: ["a: {neon_type}", "b: {neon_type}"] @@ -6592,11 +6591,7 @@ intrinsics: - float64x1_t - float64x2_t compose: - - LLVMLink: - name: "fmaxnm.{neon_type}" - links: - - link: "llvm.aarch64.neon.fmaxnm.{neon_type}" - arch: aarch64,arm64ec + - FnCall: [simd_fmax, [a, b]] - name: "vmaxnmh_{type}" @@ -6806,11 +6801,7 @@ intrinsics: - float64x1_t - float64x2_t compose: - - LLVMLink: - name: "fminnm.{neon_type}" - links: - - link: "llvm.aarch64.neon.fminnm.{neon_type}" - arch: aarch64,arm64ec + - FnCall: [simd_fmin, [a, b]] - name: "vminnmv{neon_type[0].no}" doc: "Floating-point minimum number across vector" From 72afae5fd640b84d64462ade413f4077db9c01b4 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sat, 12 Jul 2025 16:49:52 +0200 Subject: [PATCH 021/183] `arm`: use `simd_fmin` and `simd_fmax` --- .../src/arm_shared/neon/generated.rs | 80 ++----------------- .../spec/neon/arm_shared.spec.yml | 32 +------- 2 files changed, 12 insertions(+), 100 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs index b61d57777783..40ccd7eb727d 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs @@ -27942,15 +27942,7 @@ pub fn vmaxq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] pub fn vmaxnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxnm.v4f16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnm.v4f16" - )] - fn _vmaxnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t; - } - unsafe { _vmaxnm_f16(a, b) } + unsafe { simd_fmax(a, b) } } #[doc = "Floating-point Maximum Number (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnmq_f16)"] @@ -27964,15 +27956,7 @@ pub fn vmaxnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] pub fn vmaxnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxnm.v8f16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnm.v8f16" - )] - fn _vmaxnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t; - } - unsafe { _vmaxnmq_f16(a, b) } + unsafe { simd_fmax(a, b) } } #[doc = "Floating-point Maximum Number (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnm_f32)"] @@ -27993,15 +27977,7 @@ pub fn vmaxnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmaxnm_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxnm.v2f32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnm.v2f32" - )] - fn _vmaxnm_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t; - } - unsafe { _vmaxnm_f32(a, b) } + unsafe { simd_fmax(a, b) } } #[doc = "Floating-point Maximum Number (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnmq_f32)"] @@ -28022,15 +27998,7 @@ pub fn vmaxnm_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vmaxnmq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxnm.v4f32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnm.v4f32" - )] - fn _vmaxnmq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t; - } - unsafe { _vmaxnmq_f32(a, b) } + unsafe { simd_fmax(a, b) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmin_f16)"] @@ -28434,15 +28402,7 @@ pub fn vminq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] pub fn vminnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminnm.v4f16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnm.v4f16" - )] - fn _vminnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t; - } - unsafe { _vminnm_f16(a, b) } + unsafe { simd_fmin(a, b) } } #[doc = "Floating-point Minimum Number (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnmq_f16)"] @@ -28456,15 +28416,7 @@ pub fn vminnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] pub fn vminnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminnm.v8f16")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnm.v8f16" - )] - fn _vminnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t; - } - unsafe { _vminnmq_f16(a, b) } + unsafe { simd_fmin(a, b) } } #[doc = "Floating-point Minimum Number (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnm_f32)"] @@ -28485,15 +28437,7 @@ pub fn vminnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vminnm_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminnm.v2f32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnm.v2f32" - )] - fn _vminnm_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t; - } - unsafe { _vminnm_f32(a, b) } + unsafe { simd_fmin(a, b) } } #[doc = "Floating-point Minimum Number (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnmq_f32)"] @@ -28514,15 +28458,7 @@ pub fn vminnm_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vminnmq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t { - unsafe extern "unadjusted" { - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminnm.v4f32")] - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnm.v4f32" - )] - fn _vminnmq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t; - } - unsafe { _vminnmq_f32(a, b) } + unsafe { simd_fmin(a, b) } } #[doc = "Floating-point multiply-add to accumulator"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmla_f32)"] diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml index c836a47a7409..814d4d998402 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml @@ -7223,13 +7223,7 @@ intrinsics: - float32x2_t - float32x4_t compose: - - LLVMLink: - name: "fmaxnm.{neon_type}" - links: - - link: "llvm.arm.neon.vmaxnm.{neon_type}" - arch: arm - - link: "llvm.aarch64.neon.fmaxnm.{neon_type}" - arch: aarch64,arm64ec + - FnCall: [simd_fmax, [a, b]] - name: "vmaxnm{neon_type.no}" @@ -7247,13 +7241,7 @@ intrinsics: - float16x4_t - float16x8_t compose: - - LLVMLink: - name: "fmaxnm.{neon_type}" - links: - - link: "llvm.arm.neon.vmaxnm.{neon_type}" - arch: arm - - link: "llvm.aarch64.neon.fmaxnm.{neon_type}" - arch: aarch64,arm64ec + - FnCall: [simd_fmax, [a, b]] - name: "vminnm{neon_type.no}" @@ -7271,13 +7259,7 @@ intrinsics: - float16x4_t - float16x8_t compose: - - LLVMLink: - name: "fminnm.{neon_type}" - links: - - link: "llvm.arm.neon.vminnm.{neon_type}" - arch: arm - - link: "llvm.aarch64.neon.fminnm.{neon_type}" - arch: aarch64,arm64ec + - FnCall: [simd_fmin, [a, b]] - name: "vmin{neon_type.no}" @@ -7388,13 +7370,7 @@ intrinsics: - float32x2_t - float32x4_t compose: - - LLVMLink: - name: "fminnm.{neon_type}" - links: - - link: "llvm.arm.neon.vminnm.{neon_type}" - arch: arm - - link: "llvm.aarch64.neon.fminnm.{neon_type}" - arch: aarch64,arm64ec + - FnCall: [simd_fmin, [a, b]] - name: "vpadd{neon_type.no}" doc: Floating-point add pairwise From 750ddfd8d34bada5b07f32eb22cb9aef8a6556eb Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sat, 12 Jul 2025 17:22:46 +0200 Subject: [PATCH 022/183] `aarch64`: use `simd_reduce_min` and `simd_reduce_max` for floats --- .../core_arch/src/aarch64/neon/generated.rs | 90 +++---------------- .../spec/neon/aarch64.spec.yml | 36 ++------ 2 files changed, 16 insertions(+), 110 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs index e888346a0818..0be902dbf2aa 100644 --- a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs @@ -13256,14 +13256,7 @@ pub fn vmaxnmh_f16(a: f16, b: f16) -> f16 { #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg_attr(test, assert_instr(fmaxnmv))] pub fn vmaxnmv_f16(a: float16x4_t) -> f16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnmv.f16.v4f16" - )] - fn _vmaxnmv_f16(a: float16x4_t) -> f16; - } - unsafe { _vmaxnmv_f16(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Floating-point maximum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnmvq_f16)"] @@ -13272,14 +13265,7 @@ pub fn vmaxnmv_f16(a: float16x4_t) -> f16 { #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg_attr(test, assert_instr(fmaxnmv))] pub fn vmaxnmvq_f16(a: float16x8_t) -> f16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnmv.f16.v8f16" - )] - fn _vmaxnmvq_f16(a: float16x8_t) -> f16; - } - unsafe { _vmaxnmvq_f16(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Floating-point maximum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnmv_f32)"] @@ -13288,14 +13274,7 @@ pub fn vmaxnmvq_f16(a: float16x8_t) -> f16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(fmaxnmp))] pub fn vmaxnmv_f32(a: float32x2_t) -> f32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnmv.f32.v2f32" - )] - fn _vmaxnmv_f32(a: float32x2_t) -> f32; - } - unsafe { _vmaxnmv_f32(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Floating-point maximum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnmvq_f64)"] @@ -13304,14 +13283,7 @@ pub fn vmaxnmv_f32(a: float32x2_t) -> f32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(fmaxnmp))] pub fn vmaxnmvq_f64(a: float64x2_t) -> f64 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnmv.f64.v2f64" - )] - fn _vmaxnmvq_f64(a: float64x2_t) -> f64; - } - unsafe { _vmaxnmvq_f64(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Floating-point maximum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxnmvq_f32)"] @@ -13320,14 +13292,7 @@ pub fn vmaxnmvq_f64(a: float64x2_t) -> f64 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(fmaxnmv))] pub fn vmaxnmvq_f32(a: float32x4_t) -> f32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fmaxnmv.f32.v4f32" - )] - fn _vmaxnmvq_f32(a: float32x4_t) -> f32; - } - unsafe { _vmaxnmvq_f32(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Floating-point maximum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxv_f16)"] @@ -13683,14 +13648,7 @@ pub fn vminnmh_f16(a: f16, b: f16) -> f16 { #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg_attr(test, assert_instr(fminnmv))] pub fn vminnmv_f16(a: float16x4_t) -> f16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnmv.f16.v4f16" - )] - fn _vminnmv_f16(a: float16x4_t) -> f16; - } - unsafe { _vminnmv_f16(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Floating-point minimum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnmvq_f16)"] @@ -13699,14 +13657,7 @@ pub fn vminnmv_f16(a: float16x4_t) -> f16 { #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg_attr(test, assert_instr(fminnmv))] pub fn vminnmvq_f16(a: float16x8_t) -> f16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnmv.f16.v8f16" - )] - fn _vminnmvq_f16(a: float16x8_t) -> f16; - } - unsafe { _vminnmvq_f16(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Floating-point minimum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnmv_f32)"] @@ -13715,14 +13666,7 @@ pub fn vminnmvq_f16(a: float16x8_t) -> f16 { #[cfg_attr(test, assert_instr(fminnmp))] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub fn vminnmv_f32(a: float32x2_t) -> f32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnmv.f32.v2f32" - )] - fn _vminnmv_f32(a: float32x2_t) -> f32; - } - unsafe { _vminnmv_f32(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Floating-point minimum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnmvq_f64)"] @@ -13731,14 +13675,7 @@ pub fn vminnmv_f32(a: float32x2_t) -> f32 { #[cfg_attr(test, assert_instr(fminnmp))] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub fn vminnmvq_f64(a: float64x2_t) -> f64 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnmv.f64.v2f64" - )] - fn _vminnmvq_f64(a: float64x2_t) -> f64; - } - unsafe { _vminnmvq_f64(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Floating-point minimum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminnmvq_f32)"] @@ -13747,14 +13684,7 @@ pub fn vminnmvq_f64(a: float64x2_t) -> f64 { #[cfg_attr(test, assert_instr(fminnmv))] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub fn vminnmvq_f32(a: float32x4_t) -> f32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.fminnmv.f32.v4f32" - )] - fn _vminnmvq_f32(a: float32x4_t) -> f32; - } - unsafe { _vminnmvq_f32(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Floating-point minimum number across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminv_f16)"] diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml index 821dc52bf37d..298583bbfba8 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml @@ -6635,11 +6635,7 @@ intrinsics: - [float32x2_t, f32] - [float64x2_t, f64] compose: - - LLVMLink: - name: "fmaxnmv.{neon_type[0]}" - links: - - link: "llvm.aarch64.neon.fmaxnmv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_max, [a]] - name: "vmaxnmv{neon_type[0].no}" doc: Floating-point maximum number across vector @@ -6651,11 +6647,7 @@ intrinsics: types: - [float32x4_t, f32] compose: - - LLVMLink: - name: "fmaxnmv.{neon_type[0]}" - links: - - link: "llvm.aarch64.neon.fmaxnmv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_max, [a]] - name: "vmaxnmv{neon_type[0].no}" @@ -6671,11 +6663,7 @@ intrinsics: - [float16x4_t, f16] - [float16x8_t, f16] compose: - - LLVMLink: - name: "fmaxnmv.{neon_type[0]}" - links: - - link: "llvm.aarch64.neon.fmaxnmv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_max, [a]] - name: "vminnmv{neon_type[0].no}" @@ -6691,11 +6679,7 @@ intrinsics: - [float16x4_t, f16] - [float16x8_t, f16] compose: - - LLVMLink: - name: "fminnmv.{neon_type[0]}" - links: - - link: "llvm.aarch64.neon.fminnmv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_min, [a]] - name: "vmaxv{neon_type[0].no}" @@ -6815,11 +6799,7 @@ intrinsics: - [float32x2_t, "f32"] - [float64x2_t, "f64"] compose: - - LLVMLink: - name: "vminnmv.{neon_type[0]}" - links: - - link: "llvm.aarch64.neon.fminnmv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_min, [a]] - name: "vminnmv{neon_type[0].no}" doc: "Floating-point minimum number across vector" @@ -6832,11 +6812,7 @@ intrinsics: types: - [float32x4_t, "f32"] compose: - - LLVMLink: - name: "vminnmv.{neon_type[0]}" - links: - - link: "llvm.aarch64.neon.fminnmv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_min, [a]] - name: "vmovl_high{neon_type[0].noq}" doc: Vector move From 17b8fc938d86092674c8e72e0d66702e6fd05e5b Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sat, 12 Jul 2025 17:35:14 +0200 Subject: [PATCH 023/183] `aarch64`: use `simd_reduce_min` and `simd_reduce_max` for integers --- .../core_arch/src/aarch64/neon/generated.rs | 216 ++---------------- .../spec/neon/aarch64.spec.yml | 24 +- 2 files changed, 28 insertions(+), 212 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs index 0be902dbf2aa..5724f6d112f8 100644 --- a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs @@ -13381,14 +13381,7 @@ pub fn vmaxvq_f64(a: float64x2_t) -> f64 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(smaxv))] pub fn vmaxv_s8(a: int8x8_t) -> i8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smaxv.i8.v8i8" - )] - fn _vmaxv_s8(a: int8x8_t) -> i8; - } - unsafe { _vmaxv_s8(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxvq_s8)"] @@ -13397,14 +13390,7 @@ pub fn vmaxv_s8(a: int8x8_t) -> i8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(smaxv))] pub fn vmaxvq_s8(a: int8x16_t) -> i8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smaxv.i8.v16i8" - )] - fn _vmaxvq_s8(a: int8x16_t) -> i8; - } - unsafe { _vmaxvq_s8(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxv_s16)"] @@ -13413,14 +13399,7 @@ pub fn vmaxvq_s8(a: int8x16_t) -> i8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(smaxv))] pub fn vmaxv_s16(a: int16x4_t) -> i16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smaxv.i16.v4i16" - )] - fn _vmaxv_s16(a: int16x4_t) -> i16; - } - unsafe { _vmaxv_s16(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxvq_s16)"] @@ -13429,14 +13408,7 @@ pub fn vmaxv_s16(a: int16x4_t) -> i16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(smaxv))] pub fn vmaxvq_s16(a: int16x8_t) -> i16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smaxv.i16.v8i16" - )] - fn _vmaxvq_s16(a: int16x8_t) -> i16; - } - unsafe { _vmaxvq_s16(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxv_s32)"] @@ -13445,14 +13417,7 @@ pub fn vmaxvq_s16(a: int16x8_t) -> i16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(smaxp))] pub fn vmaxv_s32(a: int32x2_t) -> i32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smaxv.i32.v2i32" - )] - fn _vmaxv_s32(a: int32x2_t) -> i32; - } - unsafe { _vmaxv_s32(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxvq_s32)"] @@ -13461,14 +13426,7 @@ pub fn vmaxv_s32(a: int32x2_t) -> i32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(smaxv))] pub fn vmaxvq_s32(a: int32x4_t) -> i32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.smaxv.i32.v4i32" - )] - fn _vmaxvq_s32(a: int32x4_t) -> i32; - } - unsafe { _vmaxvq_s32(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxv_u8)"] @@ -13477,14 +13435,7 @@ pub fn vmaxvq_s32(a: int32x4_t) -> i32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(umaxv))] pub fn vmaxv_u8(a: uint8x8_t) -> u8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umaxv.i8.v8i8" - )] - fn _vmaxv_u8(a: uint8x8_t) -> u8; - } - unsafe { _vmaxv_u8(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxvq_u8)"] @@ -13493,14 +13444,7 @@ pub fn vmaxv_u8(a: uint8x8_t) -> u8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(umaxv))] pub fn vmaxvq_u8(a: uint8x16_t) -> u8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umaxv.i8.v16i8" - )] - fn _vmaxvq_u8(a: uint8x16_t) -> u8; - } - unsafe { _vmaxvq_u8(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxv_u16)"] @@ -13509,14 +13453,7 @@ pub fn vmaxvq_u8(a: uint8x16_t) -> u8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(umaxv))] pub fn vmaxv_u16(a: uint16x4_t) -> u16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umaxv.i16.v4i16" - )] - fn _vmaxv_u16(a: uint16x4_t) -> u16; - } - unsafe { _vmaxv_u16(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxvq_u16)"] @@ -13525,14 +13462,7 @@ pub fn vmaxv_u16(a: uint16x4_t) -> u16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(umaxv))] pub fn vmaxvq_u16(a: uint16x8_t) -> u16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umaxv.i16.v8i16" - )] - fn _vmaxvq_u16(a: uint16x8_t) -> u16; - } - unsafe { _vmaxvq_u16(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxv_u32)"] @@ -13541,14 +13471,7 @@ pub fn vmaxvq_u16(a: uint16x8_t) -> u16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(umaxp))] pub fn vmaxv_u32(a: uint32x2_t) -> u32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umaxv.i32.v2i32" - )] - fn _vmaxv_u32(a: uint32x2_t) -> u32; - } - unsafe { _vmaxv_u32(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Horizontal vector max."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmaxvq_u32)"] @@ -13557,14 +13480,7 @@ pub fn vmaxv_u32(a: uint32x2_t) -> u32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(umaxv))] pub fn vmaxvq_u32(a: uint32x4_t) -> u32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.umaxv.i32.v4i32" - )] - fn _vmaxvq_u32(a: uint32x4_t) -> u32; - } - unsafe { _vmaxvq_u32(a) } + unsafe { simd_reduce_max(a) } } #[doc = "Minimum (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmin_f64)"] @@ -13773,14 +13689,7 @@ pub fn vminvq_f64(a: float64x2_t) -> f64 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(sminv))] pub fn vminv_s8(a: int8x8_t) -> i8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.sminv.i8.v8i8" - )] - fn _vminv_s8(a: int8x8_t) -> i8; - } - unsafe { _vminv_s8(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminvq_s8)"] @@ -13789,14 +13698,7 @@ pub fn vminv_s8(a: int8x8_t) -> i8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(sminv))] pub fn vminvq_s8(a: int8x16_t) -> i8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.sminv.i8.v16i8" - )] - fn _vminvq_s8(a: int8x16_t) -> i8; - } - unsafe { _vminvq_s8(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminv_s16)"] @@ -13805,14 +13707,7 @@ pub fn vminvq_s8(a: int8x16_t) -> i8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(sminv))] pub fn vminv_s16(a: int16x4_t) -> i16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.sminv.i16.v4i16" - )] - fn _vminv_s16(a: int16x4_t) -> i16; - } - unsafe { _vminv_s16(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminvq_s16)"] @@ -13821,14 +13716,7 @@ pub fn vminv_s16(a: int16x4_t) -> i16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(sminv))] pub fn vminvq_s16(a: int16x8_t) -> i16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.sminv.i16.v8i16" - )] - fn _vminvq_s16(a: int16x8_t) -> i16; - } - unsafe { _vminvq_s16(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminv_s32)"] @@ -13837,14 +13725,7 @@ pub fn vminvq_s16(a: int16x8_t) -> i16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(sminp))] pub fn vminv_s32(a: int32x2_t) -> i32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.sminv.i32.v2i32" - )] - fn _vminv_s32(a: int32x2_t) -> i32; - } - unsafe { _vminv_s32(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminvq_s32)"] @@ -13853,14 +13734,7 @@ pub fn vminv_s32(a: int32x2_t) -> i32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(sminv))] pub fn vminvq_s32(a: int32x4_t) -> i32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.sminv.i32.v4i32" - )] - fn _vminvq_s32(a: int32x4_t) -> i32; - } - unsafe { _vminvq_s32(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminv_u8)"] @@ -13869,14 +13743,7 @@ pub fn vminvq_s32(a: int32x4_t) -> i32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(uminv))] pub fn vminv_u8(a: uint8x8_t) -> u8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uminv.i8.v8i8" - )] - fn _vminv_u8(a: uint8x8_t) -> u8; - } - unsafe { _vminv_u8(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminvq_u8)"] @@ -13885,14 +13752,7 @@ pub fn vminv_u8(a: uint8x8_t) -> u8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(uminv))] pub fn vminvq_u8(a: uint8x16_t) -> u8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uminv.i8.v16i8" - )] - fn _vminvq_u8(a: uint8x16_t) -> u8; - } - unsafe { _vminvq_u8(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminv_u16)"] @@ -13901,14 +13761,7 @@ pub fn vminvq_u8(a: uint8x16_t) -> u8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(uminv))] pub fn vminv_u16(a: uint16x4_t) -> u16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uminv.i16.v4i16" - )] - fn _vminv_u16(a: uint16x4_t) -> u16; - } - unsafe { _vminv_u16(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminvq_u16)"] @@ -13917,14 +13770,7 @@ pub fn vminv_u16(a: uint16x4_t) -> u16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(uminv))] pub fn vminvq_u16(a: uint16x8_t) -> u16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uminv.i16.v8i16" - )] - fn _vminvq_u16(a: uint16x8_t) -> u16; - } - unsafe { _vminvq_u16(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminv_u32)"] @@ -13933,14 +13779,7 @@ pub fn vminvq_u16(a: uint16x8_t) -> u16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(uminp))] pub fn vminv_u32(a: uint32x2_t) -> u32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uminv.i32.v2i32" - )] - fn _vminv_u32(a: uint32x2_t) -> u32; - } - unsafe { _vminv_u32(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Horizontal vector min."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vminvq_u32)"] @@ -13949,14 +13788,7 @@ pub fn vminv_u32(a: uint32x2_t) -> u32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(uminv))] pub fn vminvq_u32(a: uint32x4_t) -> u32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uminv.i32.v4i32" - )] - fn _vminvq_u32(a: uint32x4_t) -> u32; - } - unsafe { _vminvq_u32(a) } + unsafe { simd_reduce_min(a) } } #[doc = "Floating-point multiply-add to accumulator"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmla_f64)"] diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml index 298583bbfba8..92a2666a3695 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml @@ -13286,11 +13286,7 @@ intrinsics: - [int16x8_t, i16, 'smaxv'] - [int32x4_t, i32, 'smaxv'] compose: - - LLVMLink: - name: "vmaxv{neon_type[0].no}" - links: - - link: "llvm.aarch64.neon.smaxv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_max, [a]] - name: "vmaxv{neon_type[0].no}" doc: "Horizontal vector max." @@ -13308,11 +13304,7 @@ intrinsics: - [uint16x8_t, u16, 'umaxv'] - [uint32x4_t, u32, 'umaxv'] compose: - - LLVMLink: - name: "vmaxv{neon_type[0].no}" - links: - - link: "llvm.aarch64.neon.umaxv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_max, [a]] - name: "vmaxv{neon_type[0].no}" doc: "Horizontal vector max." @@ -13349,11 +13341,7 @@ intrinsics: - [int16x8_t, i16, 'sminv'] - [int32x4_t, i32, 'sminv'] compose: - - LLVMLink: - name: "vminv{neon_type[0].no}" - links: - - link: "llvm.aarch64.neon.sminv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_min, [a]] - name: "vminv{neon_type[0].no}" doc: "Horizontal vector min." @@ -13371,11 +13359,7 @@ intrinsics: - [uint16x8_t, u16, 'uminv'] - [uint32x4_t, u32, 'uminv'] compose: - - LLVMLink: - name: "vminv{neon_type[0].no}" - links: - - link: "llvm.aarch64.neon.uminv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_min, [a]] - name: "vminv{neon_type[0].no}" doc: "Horizontal vector min." From 42bcb0668ec27b7ee2af17649c185f09f0491872 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sat, 12 Jul 2025 19:15:51 +0200 Subject: [PATCH 024/183] `aarch64`: use `simd_reduce_add_unordered` --- .../core_arch/src/aarch64/neon/generated.rs | 142 ++---------------- .../src/arm_shared/neon/generated.rs | 72 +++------ .../spec/neon/aarch64.spec.yml | 44 +----- .../spec/neon/arm_shared.spec.yml | 17 ++- 4 files changed, 58 insertions(+), 217 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs index 32f144bc7adc..9595b30789e8 100644 --- a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs @@ -604,14 +604,7 @@ pub fn vaddvq_f64(a: float64x2_t) -> f64 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vaddv_s32(a: int32x2_t) -> i32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.saddv.i32.v2i32" - )] - fn _vaddv_s32(a: int32x2_t) -> i32; - } - unsafe { _vaddv_s32(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddv_s8)"] @@ -620,14 +613,7 @@ pub fn vaddv_s32(a: int32x2_t) -> i32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddv_s8(a: int8x8_t) -> i8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.saddv.i8.v8i8" - )] - fn _vaddv_s8(a: int8x8_t) -> i8; - } - unsafe { _vaddv_s8(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_s8)"] @@ -636,14 +622,7 @@ pub fn vaddv_s8(a: int8x8_t) -> i8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_s8(a: int8x16_t) -> i8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.saddv.i8.v16i8" - )] - fn _vaddvq_s8(a: int8x16_t) -> i8; - } - unsafe { _vaddvq_s8(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddv_s16)"] @@ -652,14 +631,7 @@ pub fn vaddvq_s8(a: int8x16_t) -> i8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddv_s16(a: int16x4_t) -> i16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.saddv.i16.v4i16" - )] - fn _vaddv_s16(a: int16x4_t) -> i16; - } - unsafe { _vaddv_s16(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_s16)"] @@ -668,14 +640,7 @@ pub fn vaddv_s16(a: int16x4_t) -> i16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_s16(a: int16x8_t) -> i16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.saddv.i16.v8i16" - )] - fn _vaddvq_s16(a: int16x8_t) -> i16; - } - unsafe { _vaddvq_s16(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_s32)"] @@ -684,14 +649,7 @@ pub fn vaddvq_s16(a: int16x8_t) -> i16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_s32(a: int32x4_t) -> i32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.saddv.i32.v4i32" - )] - fn _vaddvq_s32(a: int32x4_t) -> i32; - } - unsafe { _vaddvq_s32(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddv_u32)"] @@ -700,14 +658,7 @@ pub fn vaddvq_s32(a: int32x4_t) -> i32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vaddv_u32(a: uint32x2_t) -> u32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uaddv.i32.v2i32" - )] - fn _vaddv_u32(a: uint32x2_t) -> u32; - } - unsafe { _vaddv_u32(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddv_u8)"] @@ -716,14 +667,7 @@ pub fn vaddv_u32(a: uint32x2_t) -> u32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddv_u8(a: uint8x8_t) -> u8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uaddv.i8.v8i8" - )] - fn _vaddv_u8(a: uint8x8_t) -> u8; - } - unsafe { _vaddv_u8(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_u8)"] @@ -732,14 +676,7 @@ pub fn vaddv_u8(a: uint8x8_t) -> u8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_u8(a: uint8x16_t) -> u8 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uaddv.i8.v16i8" - )] - fn _vaddvq_u8(a: uint8x16_t) -> u8; - } - unsafe { _vaddvq_u8(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddv_u16)"] @@ -748,14 +685,7 @@ pub fn vaddvq_u8(a: uint8x16_t) -> u8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddv_u16(a: uint16x4_t) -> u16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uaddv.i16.v4i16" - )] - fn _vaddv_u16(a: uint16x4_t) -> u16; - } - unsafe { _vaddv_u16(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_u16)"] @@ -764,14 +694,7 @@ pub fn vaddv_u16(a: uint16x4_t) -> u16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_u16(a: uint16x8_t) -> u16 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uaddv.i16.v8i16" - )] - fn _vaddvq_u16(a: uint16x8_t) -> u16; - } - unsafe { _vaddvq_u16(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_u32)"] @@ -780,14 +703,7 @@ pub fn vaddvq_u16(a: uint16x8_t) -> u16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_u32(a: uint32x4_t) -> u32 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uaddv.i32.v4i32" - )] - fn _vaddvq_u32(a: uint32x4_t) -> u32; - } - unsafe { _vaddvq_u32(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_s64)"] @@ -796,14 +712,7 @@ pub fn vaddvq_u32(a: uint32x4_t) -> u32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vaddvq_s64(a: int64x2_t) -> i64 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.saddv.i64.v2i64" - )] - fn _vaddvq_s64(a: int64x2_t) -> i64; - } - unsafe { _vaddvq_s64(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_u64)"] @@ -812,14 +721,7 @@ pub fn vaddvq_s64(a: int64x2_t) -> i64 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vaddvq_u64(a: uint64x2_t) -> u64 { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.uaddv.i64.v2i64" - )] - fn _vaddvq_u64(a: uint64x2_t) -> u64; - } - unsafe { _vaddvq_u64(a) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Multi-vector floating-point absolute maximum"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamax_f32)"] @@ -15951,23 +15853,11 @@ pub fn vpadds_f32(a: float32x2_t) -> f32 { #[doc = "Add pairwise"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpaddd_s64)"] #[inline] -#[cfg(target_endian = "little")] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vpaddd_s64(a: int64x2_t) -> i64 { - unsafe { transmute(vaddvq_u64(transmute(a))) } -} -#[doc = "Add pairwise"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpaddd_s64)"] -#[inline] -#[cfg(target_endian = "big")] -#[target_feature(enable = "neon")] -#[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(addp))] -pub fn vpaddd_s64(a: int64x2_t) -> i64 { - let a: int64x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; - unsafe { transmute(vaddvq_u64(transmute(a))) } + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Add pairwise"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpaddd_u64)"] @@ -15976,7 +15866,7 @@ pub fn vpaddd_s64(a: int64x2_t) -> i64 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vpaddd_u64(a: uint64x2_t) -> u64 { - vaddvq_u64(a) + unsafe { simd_reduce_add_unordered(a) } } #[doc = "Floating-point add pairwise"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpaddq_f16)"] diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs index b61d57777783..4bf926c3569b 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs @@ -1483,15 +1483,11 @@ pub fn vabsq_f32(a: float32x4_t) -> float32x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vabs_s8(a: int8x8_t) -> int8x8_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.abs.v8i8" - )] - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v8i8")] - fn _vabs_s8(a: int8x8_t) -> int8x8_t; + unsafe { + let neg: int8x8_t = simd_neg(a); + let mask: int8x8_t = simd_ge(a, neg); + simd_select(mask, a, neg) } - unsafe { _vabs_s8(a) } } #[doc = "Absolute value (wrapping)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabsq_s8)"] @@ -1512,15 +1508,11 @@ pub fn vabs_s8(a: int8x8_t) -> int8x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vabsq_s8(a: int8x16_t) -> int8x16_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.abs.v16i8" - )] - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v16i8")] - fn _vabsq_s8(a: int8x16_t) -> int8x16_t; + unsafe { + let neg: int8x16_t = simd_neg(a); + let mask: int8x16_t = simd_ge(a, neg); + simd_select(mask, a, neg) } - unsafe { _vabsq_s8(a) } } #[doc = "Absolute value (wrapping)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabs_s16)"] @@ -1541,15 +1533,11 @@ pub fn vabsq_s8(a: int8x16_t) -> int8x16_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vabs_s16(a: int16x4_t) -> int16x4_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.abs.v4i16" - )] - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v4i16")] - fn _vabs_s16(a: int16x4_t) -> int16x4_t; + unsafe { + let neg: int16x4_t = simd_neg(a); + let mask: int16x4_t = simd_ge(a, neg); + simd_select(mask, a, neg) } - unsafe { _vabs_s16(a) } } #[doc = "Absolute value (wrapping)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabsq_s16)"] @@ -1570,15 +1558,11 @@ pub fn vabs_s16(a: int16x4_t) -> int16x4_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vabsq_s16(a: int16x8_t) -> int16x8_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.abs.v8i16" - )] - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v8i16")] - fn _vabsq_s16(a: int16x8_t) -> int16x8_t; + unsafe { + let neg: int16x8_t = simd_neg(a); + let mask: int16x8_t = simd_ge(a, neg); + simd_select(mask, a, neg) } - unsafe { _vabsq_s16(a) } } #[doc = "Absolute value (wrapping)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabs_s32)"] @@ -1599,15 +1583,11 @@ pub fn vabsq_s16(a: int16x8_t) -> int16x8_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vabs_s32(a: int32x2_t) -> int32x2_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.abs.v2i32" - )] - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v2i32")] - fn _vabs_s32(a: int32x2_t) -> int32x2_t; + unsafe { + let neg: int32x2_t = simd_neg(a); + let mask: int32x2_t = simd_ge(a, neg); + simd_select(mask, a, neg) } - unsafe { _vabs_s32(a) } } #[doc = "Absolute value (wrapping)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabsq_s32)"] @@ -1628,15 +1608,11 @@ pub fn vabs_s32(a: int32x2_t) -> int32x2_t { unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") )] pub fn vabsq_s32(a: int32x4_t) -> int32x4_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.abs.v4i32" - )] - #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v4i32")] - fn _vabsq_s32(a: int32x4_t) -> int32x4_t; + unsafe { + let neg: int32x4_t = simd_neg(a); + let mask: int32x4_t = simd_ge(a, neg); + simd_select(mask, a, neg) } - unsafe { _vabsq_s32(a) } } #[doc = "Floating-point absolute value"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabsh_f16)"] diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml index f0dce681d9c3..2b5aab3e7f50 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml @@ -13142,11 +13142,7 @@ intrinsics: types: - [int64x2_t, i64] compose: - - FnCall: - - transmute - - - FnCall: - - "vaddvq_u64" - - - FnCall: [transmute, [a]] + - FnCall: [simd_reduce_add_unordered, [a]] - name: "vpaddd_u64" doc: "Add pairwise" @@ -13159,7 +13155,7 @@ intrinsics: types: - [uint64x2_t, u64] compose: - - FnCall: [vaddvq_u64, [a]] + - FnCall: [simd_reduce_add_unordered, [a]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13176,11 +13172,7 @@ intrinsics: - [int16x8_t, i16] - [int32x4_t, i32] compose: - - LLVMLink: - name: "vaddv{neon_type[0].no}" - links: - - link: "llvm.aarch64.neon.saddv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_add_unordered, [a]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13193,11 +13185,7 @@ intrinsics: types: - [int32x2_t, i32] compose: - - LLVMLink: - name: "vaddv{neon_type[0].no}" - links: - - link: "llvm.aarch64.neon.saddv.i32.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_add_unordered, [a]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13210,11 +13198,7 @@ intrinsics: types: - [int64x2_t, i64] compose: - - LLVMLink: - name: "vaddv{neon_type[0].no}" - links: - - link: "llvm.aarch64.neon.saddv.i64.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_add_unordered, [a]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13231,11 +13215,7 @@ intrinsics: - [uint16x8_t, u16] - [uint32x4_t, u32] compose: - - LLVMLink: - name: "vaddv{neon_type[0].no}" - links: - - link: "llvm.aarch64.neon.uaddv.{type[1]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_add_unordered, [a]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13248,11 +13228,7 @@ intrinsics: types: - [uint32x2_t, u32, i32] compose: - - LLVMLink: - name: "vaddv{neon_type[0].no}" - links: - - link: "llvm.aarch64.neon.uaddv.{type[2]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_add_unordered, [a]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13265,11 +13241,7 @@ intrinsics: types: - [uint64x2_t, u64, i64] compose: - - LLVMLink: - name: "vaddv{neon_type[0].no}" - links: - - link: "llvm.aarch64.neon.uaddv.{type[2]}.{neon_type[0]}" - arch: aarch64,arm64ec + - FnCall: [simd_reduce_add_unordered, [a]] - name: "vaddlv{neon_type[0].no}" doc: "Signed Add Long across Vector" diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml index c836a47a7409..58c26ae4f80d 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml @@ -12861,13 +12861,16 @@ intrinsics: - int16x8_t - int32x4_t compose: - - LLVMLink: - name: "vabs{neon_type.no}" - links: - - link: "llvm.aarch64.neon.abs.{neon_type}" - arch: aarch64,arm64ec - - link: "llvm.arm.neon.vabs.{neon_type}" - arch: arm + - Let: + - neg + - "{neon_type}" + - FnCall: [simd_neg, [a]] + - Let: + - mask + - "{neon_type}" + - FnCall: [simd_ge, [a, neg]] + - FnCall: [simd_select, [mask, a, neg]] + - name: "vpmin{neon_type.no}" doc: "Folding minimum of adjacent pairs" From 7a1593c597ba733260db2d17ddad8fd11db7ad29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sat, 12 Jul 2025 22:30:19 +0200 Subject: [PATCH 025/183] Add CI workflow for automatically performing subtree sync pulls This CI workflow will run the https://github.com/rust-lang/josh-sync tool on Mondays and Thursdays. It will try to do a pull (sync stdarch changes from rust-lang/rust into this repository). When it runs, three things can happen: - There are no rustc changes to be pulled, the bot does nothing. - There are some new changes to be pulled. In that case, the bot will either open or update an existing PR titled "Rustc pull update" on this repository with the changes. After the PR is merged, we should ideally do the opposite sync (push) manually. - The pull fails (usually because of a merge conflict), or the bot determines that a pull PR has been opened for more than a week without being merged. In that case, it will post a ping to https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/compiler-builtins.20subtree.20sync.20automation/with/528482375. --- .../.github/workflows/rustc-pull.yml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 library/compiler-builtins/.github/workflows/rustc-pull.yml diff --git a/library/compiler-builtins/.github/workflows/rustc-pull.yml b/library/compiler-builtins/.github/workflows/rustc-pull.yml new file mode 100644 index 000000000000..ba698492e42a --- /dev/null +++ b/library/compiler-builtins/.github/workflows/rustc-pull.yml @@ -0,0 +1,23 @@ +# Perform a subtree sync (pull) using the josh-sync tool once every few days (or on demand). +name: rustc-pull + +on: + workflow_dispatch: + schedule: + # Run at 04:00 UTC every Monday and Thursday + - cron: '0 4 * * 1,4' + +jobs: + pull: + if: github.repository == 'rust-lang/compiler-builtins' + uses: rust-lang/josh-sync/.github/workflows/rustc-pull.yml@main + with: + # https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/compiler-builtins.20subtree.20sync.20automation/with/528482375 + zulip-stream-id: 219381 + zulip-topic: 'compiler-builtins subtree sync automation' + zulip-bot-email: "compiler-builtins-ci-bot@rust-lang.zulipchat.com" + pr-base-branch: master + branch-name: rustc-pull + secrets: + zulip-api-token: ${{ secrets.ZULIP_API_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} From 93e0074aca1601132a12f7bb143e42824e21e1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sat, 12 Jul 2025 22:41:45 +0200 Subject: [PATCH 026/183] Tell triagebot to reopen bot PRs to run CI on them --- library/compiler-builtins/triagebot.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/compiler-builtins/triagebot.toml b/library/compiler-builtins/triagebot.toml index ecc05da01951..715be27fc65c 100644 --- a/library/compiler-builtins/triagebot.toml +++ b/library/compiler-builtins/triagebot.toml @@ -19,3 +19,6 @@ check-commits = false # Enable issue transfers within the org # Documentation at: https://forge.rust-lang.org/triagebot/transfer.html [transfer] + +# Automatically close and reopen PRs made by bots to run CI on them +[bot-pull-requests] From 74e2cb12d1732525a52df845072132e9431f27b0 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Mon, 14 Jul 2025 17:22:38 +0200 Subject: [PATCH 027/183] `s390x`: document the different rounding flavors --- .../crates/core_arch/src/s390x/vector.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/s390x/vector.rs b/library/stdarch/crates/core_arch/src/s390x/vector.rs index 1cd33c3554bd..63205f13ccc6 100644 --- a/library/stdarch/crates/core_arch/src/s390x/vector.rs +++ b/library/stdarch/crates/core_arch/src/s390x/vector.rs @@ -1181,6 +1181,20 @@ mod sealed { impl_vec_trait! { [VectorOrc vec_orc]+ 2c (orc) } + // Z vector intrinsic C23 math.h LLVM IR ISO/IEC 60559 operation inexact vfidb parameters + // + // vec_rint rint llvm.rint roundToIntegralExact yes 0, 0 + // vec_roundc nearbyint llvm.nearbyint n/a no 4, 0 + // vec_floor / vec_roundm floor llvm.floor roundToIntegralTowardNegative no 4, 7 + // vec_ceil / vec_roundp ceil llvm.ceil roundToIntegralTowardPositive no 4, 6 + // vec_trunc / vec_roundz trunc llvm.trunc roundToIntegralTowardZero no 4, 5 + // vec_round roundeven llvm.roundeven roundToIntegralTiesToEven no 4, 4 + // n/a round llvm.round roundToIntegralTiesAway no 4, 1 + + // `simd_round_ties_even` is implemented as `llvm.rint`. + test_impl! { vec_rint_f32 (a: vector_float) -> vector_float [simd_round_ties_even, "vector-enhancements-1" vfisb] } + test_impl! { vec_rint_f64 (a: vector_double) -> vector_double [simd_round_ties_even, vfidb] } + test_impl! { vec_roundc_f32 (a: vector_float) -> vector_float [nearbyint_v4f32, "vector-enhancements-1" vfisb] } test_impl! { vec_roundc_f64 (a: vector_double) -> vector_double [nearbyint_v2f64, vfidb] } @@ -1189,9 +1203,6 @@ mod sealed { test_impl! { vec_round_f32 (a: vector_float) -> vector_float [roundeven_v4f32, _] } test_impl! { vec_round_f64 (a: vector_double) -> vector_double [roundeven_v2f64, _] } - test_impl! { vec_rint_f32 (a: vector_float) -> vector_float [simd_round_ties_even, "vector-enhancements-1" vfisb] } - test_impl! { vec_rint_f64 (a: vector_double) -> vector_double [simd_round_ties_even, vfidb] } - #[unstable(feature = "stdarch_s390x", issue = "135681")] pub trait VectorRoundc { unsafe fn vec_roundc(self) -> Self; From 48c33b774825c92c9aa3a3d01424ed62e62c3174 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sat, 12 Jul 2025 21:54:23 +0200 Subject: [PATCH 028/183] `aarch64`: implement `vabs` using `instrinsics::simd` --- .../core_arch/src/aarch64/neon/generated.rs | 40 ++++++++----------- .../spec/neon/aarch64.spec.yml | 35 +++++++++++++--- 2 files changed, 46 insertions(+), 29 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs index 9595b30789e8..319cef2b1a1c 100644 --- a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs @@ -298,14 +298,24 @@ pub fn vabsq_f64(a: float64x2_t) -> float64x2_t { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(abs))] pub fn vabs_s64(a: int64x1_t) -> int64x1_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.abs.v1i64" - )] - fn _vabs_s64(a: int64x1_t) -> int64x1_t; + unsafe { + let neg: int64x1_t = simd_neg(a); + let mask: int64x1_t = simd_ge(a, neg); + simd_select(mask, a, neg) + } +} +#[doc = "Absolute Value (wrapping)."] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabsq_s64)"] +#[inline] +#[target_feature(enable = "neon")] +#[stable(feature = "neon_intrinsics", since = "1.59.0")] +#[cfg_attr(test, assert_instr(abs))] +pub fn vabsq_s64(a: int64x2_t) -> int64x2_t { + unsafe { + let neg: int64x2_t = simd_neg(a); + let mask: int64x2_t = simd_ge(a, neg); + simd_select(mask, a, neg) } - unsafe { _vabs_s64(a) } } #[doc = "Absolute Value (wrapping)."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabsd_s64)"] @@ -323,22 +333,6 @@ pub fn vabsd_s64(a: i64) -> i64 { } unsafe { _vabsd_s64(a) } } -#[doc = "Absolute Value (wrapping)."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabsq_s64)"] -#[inline] -#[target_feature(enable = "neon")] -#[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(abs))] -pub fn vabsq_s64(a: int64x2_t) -> int64x2_t { - unsafe extern "unadjusted" { - #[cfg_attr( - any(target_arch = "aarch64", target_arch = "arm64ec"), - link_name = "llvm.aarch64.neon.abs.v2i64" - )] - fn _vabsq_s64(a: int64x2_t) -> int64x2_t; - } - unsafe { _vabsq_s64(a) } -} #[doc = "Add"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddd_s64)"] #[inline] diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml index 2b5aab3e7f50..8fa33e5bb332 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml @@ -13023,6 +13023,26 @@ intrinsics: - link: "llvm.aarch64.crc32cx" arch: aarch64,arm64ec + - name: "vabsd_s64" + doc: "Absolute Value (wrapping)." + arguments: ["a: {type[1]}"] + return_type: "{type[1]}" + attr: + - *neon-stable + assert_instr: [abs] + safety: safe + types: + - [i64, i64] + compose: + # This is behaviorally equivalent to `i64::wrapping_abs`, but keeps the value in a SIMD + # register. That can be beneficial when combined with other instructions. This LLVM + # issue provides some extra context https://github.com/llvm/llvm-project/issues/148388. + - LLVMLink: + name: "vabsd_s64" + links: + - link: "llvm.aarch64.neon.abs.i64" + arch: aarch64,arm64ec + - name: "{type[0]}" doc: "Absolute Value (wrapping)." arguments: ["a: {type[1]}"] @@ -13032,15 +13052,18 @@ intrinsics: assert_instr: [abs] safety: safe types: - - ['vabsd_s64', i64, i64] - ['vabs_s64', int64x1_t, v1i64] - ['vabsq_s64', int64x2_t, v2i64] compose: - - LLVMLink: - name: "{type[0]}" - links: - - link: "llvm.aarch64.neon.abs.{type[2]}" - arch: aarch64,arm64ec + - Let: + - neg + - "{type[1]}" + - FnCall: [simd_neg, [a]] + - Let: + - mask + - "{type[1]}" + - FnCall: [simd_ge, [a, neg]] + - FnCall: [simd_select, [mask, a, neg]] - name: "vuqadd{neon_type[0].no}" doc: "Signed saturating Accumulate of Unsigned value." From 5cb1e01a94a51b0ad9d67e913c866fef4f78df14 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 15:48:57 +0200 Subject: [PATCH 029/183] update `Cargo.lock` --- library/stdarch/Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/stdarch/Cargo.lock b/library/stdarch/Cargo.lock index a30743925d92..ff0d83ac96e0 100644 --- a/library/stdarch/Cargo.lock +++ b/library/stdarch/Cargo.lock @@ -99,9 +99,9 @@ checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "clap" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" dependencies = [ "clap_builder", "clap_derive", @@ -109,9 +109,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" dependencies = [ "anstream", "anstyle", @@ -121,9 +121,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" dependencies = [ "heck", "proc-macro2", From 7ff9bcfd1ea1d03ccbff9e4fcc93298fd54840e5 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 15:48:41 +0200 Subject: [PATCH 030/183] `stdarch-test`: use `std::sync::LazyLock` instead of `lazy_static!` --- library/stdarch/Cargo.lock | 1 - library/stdarch/crates/stdarch-test/Cargo.toml | 1 - library/stdarch/crates/stdarch-test/src/lib.rs | 8 ++------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/library/stdarch/Cargo.lock b/library/stdarch/Cargo.lock index ff0d83ac96e0..4e01eb450e21 100644 --- a/library/stdarch/Cargo.lock +++ b/library/stdarch/Cargo.lock @@ -726,7 +726,6 @@ dependencies = [ "assert-instr-macro", "cc", "cfg-if", - "lazy_static", "rustc-demangle", "simd-test-macro", "wasmprinter", diff --git a/library/stdarch/crates/stdarch-test/Cargo.toml b/library/stdarch/crates/stdarch-test/Cargo.toml index e4791e4ec525..5d1171ee285e 100644 --- a/library/stdarch/crates/stdarch-test/Cargo.toml +++ b/library/stdarch/crates/stdarch-test/Cargo.toml @@ -7,7 +7,6 @@ edition = "2024" [dependencies] assert-instr-macro = { path = "../assert-instr-macro" } simd-test-macro = { path = "../simd-test-macro" } -lazy_static = "1.0" rustc-demangle = "0.1.8" cfg-if = "1.0" diff --git a/library/stdarch/crates/stdarch-test/src/lib.rs b/library/stdarch/crates/stdarch-test/src/lib.rs index f6614f6d51c9..f6732cd15cee 100644 --- a/library/stdarch/crates/stdarch-test/src/lib.rs +++ b/library/stdarch/crates/stdarch-test/src/lib.rs @@ -6,14 +6,12 @@ #![deny(rust_2018_idioms)] #![allow(clippy::missing_docs_in_private_items, clippy::print_stdout)] -#[macro_use] -extern crate lazy_static; #[macro_use] extern crate cfg_if; pub use assert_instr_macro::*; pub use simd_test_macro::*; -use std::{cmp, collections::HashSet, env, hash, hint::black_box, str}; +use std::{cmp, collections::HashSet, env, hash, hint::black_box, str, sync::LazyLock}; cfg_if! { if #[cfg(target_arch = "wasm32")] { @@ -25,9 +23,7 @@ cfg_if! { } } -lazy_static! { - static ref DISASSEMBLY: HashSet = disassemble_myself(); -} +static DISASSEMBLY: LazyLock> = LazyLock::new(disassemble_myself); #[derive(Debug)] struct Function { From 36340cd77453b783f22139a64ff008cc1b71034a Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 16:09:29 +0200 Subject: [PATCH 031/183] `stdarch-test`: misc cleanups --- .../stdarch/crates/stdarch-test/src/lib.rs | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/library/stdarch/crates/stdarch-test/src/lib.rs b/library/stdarch/crates/stdarch-test/src/lib.rs index f6732cd15cee..98f44f745fd5 100644 --- a/library/stdarch/crates/stdarch-test/src/lib.rs +++ b/library/stdarch/crates/stdarch-test/src/lib.rs @@ -61,11 +61,12 @@ pub fn assert(shim_addr: usize, fnname: &str, expected: &str) { black_box(shim_addr); //eprintln!("shim name: {fnname}"); - let function = &DISASSEMBLY - .get(&Function::new(fnname)) - .unwrap_or_else(|| panic!("function \"{fnname}\" not found in the disassembly")); + let Some(function) = &DISASSEMBLY.get(&Function::new(fnname)) else { + panic!("function `{fnname}` not found in the disassembly") + }; //eprintln!(" function: {:?}", function); + // Trim any filler instructions. let mut instrs = &function.instrs[..]; while instrs.last().is_some_and(|s| s == "nop" || s == "int3") { instrs = &instrs[..instrs.len() - 1]; @@ -80,11 +81,17 @@ pub fn assert(shim_addr: usize, fnname: &str, expected: &str) { // 2. It is a mark, indicating that the instruction will be // compiled into other instructions - mainly because of llvm // optimization. - let expected = if expected == "unknown" { - "" // Workaround for rust-lang/stdarch#1674, todo: remove when the issue is fixed - } else { - expected + let expected = match expected { + // `` is what LLVM will generate for unknown instructions. We use this to fail + // loudly when LLVM does start supporting these instructions. + // + // This was introduced in https://github.com/rust-lang/stdarch/pull/1674 to work around the + // RISC-V P extension not yet being supported. + "unknown" => "", + _ => expected, }; + + // Check whether the given instruction is part of the disassemblied body. let found = expected == "nop" || instrs.iter().any(|s| s.starts_with(expected)); // Look for subroutine call instructions in the disassembly to detect whether From f8de93acbe41241d6a17c6ba9cba663f9588fe43 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 16:12:05 +0200 Subject: [PATCH 032/183] `stdarch-test`: error if only part of an instruction matched --- library/stdarch/crates/stdarch-test/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/stdarch/crates/stdarch-test/src/lib.rs b/library/stdarch/crates/stdarch-test/src/lib.rs index 98f44f745fd5..317b46410596 100644 --- a/library/stdarch/crates/stdarch-test/src/lib.rs +++ b/library/stdarch/crates/stdarch-test/src/lib.rs @@ -92,7 +92,13 @@ pub fn assert(shim_addr: usize, fnname: &str, expected: &str) { }; // Check whether the given instruction is part of the disassemblied body. - let found = expected == "nop" || instrs.iter().any(|s| s.starts_with(expected)); + let found = expected == "nop" + || instrs.iter().any(|instruction| { + // Check that the next character is non-alphabetic. This prevents false negatives + // when e.g. `fminnm` was used but `fmin` was expected. + instruction.starts_with(expected) + && !instruction[expected.len()..].starts_with(|c: char| c.is_ascii_alphabetic()) + }); // Look for subroutine call instructions in the disassembly to detect whether // inlining failed: all intrinsics are `#[inline(always)]`, so calling one From f6f6715990a8cb49fbbaf83e65fd884e0d63d17d Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 16:17:07 +0200 Subject: [PATCH 033/183] s390x: fix tests that matched on prefix of instruction --- library/stdarch/crates/core_arch/src/s390x/vector.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/s390x/vector.rs b/library/stdarch/crates/core_arch/src/s390x/vector.rs index 63205f13ccc6..a09a27a029c1 100644 --- a/library/stdarch/crates/core_arch/src/s390x/vector.rs +++ b/library/stdarch/crates/core_arch/src/s390x/vector.rs @@ -2265,14 +2265,14 @@ mod sealed { #[inline] #[target_feature(enable = "vector")] - #[cfg_attr(test, assert_instr("vlbb"))] + #[cfg_attr(test, assert_instr(vlbb))] unsafe fn test_vec_load_bndry(ptr: *const i32) -> MaybeUninit { vector_signed_int::vec_load_bndry::<512>(ptr) } #[inline] #[target_feature(enable = "vector")] - #[cfg_attr(test, assert_instr(vst))] + #[cfg_attr(test, assert_instr(vstl))] unsafe fn test_vec_store_len(vector: vector_signed_int, ptr: *mut i32, byte_count: u32) { vector.vec_store_len(ptr, byte_count) } @@ -2798,11 +2798,11 @@ mod sealed { } test_impl! { vec_vmal_ib(a: vector_signed_char, b: vector_signed_char, c: vector_signed_char) -> vector_signed_char [simd_mladd, vmalb ] } - test_impl! { vec_vmal_ih(a: vector_signed_short, b: vector_signed_short, c: vector_signed_short) -> vector_signed_short[simd_mladd, vmalh ] } + test_impl! { vec_vmal_ih(a: vector_signed_short, b: vector_signed_short, c: vector_signed_short) -> vector_signed_short[simd_mladd, vmalhw ] } test_impl! { vec_vmal_if(a: vector_signed_int, b: vector_signed_int, c: vector_signed_int) -> vector_signed_int [simd_mladd, vmalf ] } test_impl! { vec_vmal_ub(a: vector_unsigned_char, b: vector_unsigned_char, c: vector_unsigned_char) -> vector_unsigned_char [simd_mladd, vmalb ] } - test_impl! { vec_vmal_uh(a: vector_unsigned_short, b: vector_unsigned_short, c: vector_unsigned_short) -> vector_unsigned_short[simd_mladd, vmalh ] } + test_impl! { vec_vmal_uh(a: vector_unsigned_short, b: vector_unsigned_short, c: vector_unsigned_short) -> vector_unsigned_short[simd_mladd, vmalhw ] } test_impl! { vec_vmal_uf(a: vector_unsigned_int, b: vector_unsigned_int, c: vector_unsigned_int) -> vector_unsigned_int [simd_mladd, vmalf ] } impl_mul!([VectorMladd vec_mladd] vec_vmal_ib (vector_signed_char, vector_signed_char, vector_signed_char) -> vector_signed_char ); From 6444994556eb1f15aa2e19f7c175799d22d137c2 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 16:25:27 +0200 Subject: [PATCH 034/183] aarch64/arm: fix tests that matched on prefix of instruction --- .../crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml index e0667228d2e7..b2b4fd2f8551 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml @@ -14131,8 +14131,8 @@ intrinsics: - ['vld1q_dup_u32', '*const u32', 'uint32x4_t', 'vld1.32', 'ld1r', 'u32x4::splat'] - ['vld1q_dup_f32', '*const f32', 'float32x4_t', 'vld1.32', 'ld1r', 'f32x4::splat'] - - ['vld1q_dup_s64', '*const i64', 'int64x2_t', 'vldr', 'ld1', 'i64x2::splat'] - - ['vld1q_dup_u64', '*const u64', 'uint64x2_t', 'vldr', 'ld1', 'u64x2::splat'] + - ['vld1q_dup_s64', '*const i64', 'int64x2_t', 'vldr', 'ld1r', 'i64x2::splat'] + - ['vld1q_dup_u64', '*const u64', 'uint64x2_t', 'vldr', 'ld1r', 'u64x2::splat'] compose: - FnCall: - transmute From ce3eabfd70a11a90947954030c76040fb19ad96f Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Tue, 15 Jul 2025 22:09:43 +0200 Subject: [PATCH 035/183] `aarch64`: check for `zip1` and `zip2` --- .../src/arm_shared/neon/generated.rs | 160 +++++++++++++++--- .../spec/neon/arm_shared.spec.yml | 18 +- 2 files changed, 144 insertions(+), 34 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs index 03d140860707..e6c69bebb358 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs @@ -14609,7 +14609,7 @@ pub unsafe fn vld1q_dup_s32(ptr: *const i32) -> int32x4_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(ld1) + assert_instr(ld1r) )] #[cfg_attr( not(target_arch = "arm"), @@ -14701,7 +14701,7 @@ pub unsafe fn vld1q_dup_u32(ptr: *const u32) -> uint32x4_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(ld1) + assert_instr(ld1r) )] #[cfg_attr( not(target_arch = "arm"), @@ -73031,7 +73031,11 @@ pub fn vtrnq_f16(a: float16x8_t, b: float16x8_t) -> float16x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73056,7 +73060,11 @@ pub fn vtrn_f32(a: float32x2_t, b: float32x2_t) -> float32x2x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73081,7 +73089,11 @@ pub fn vtrn_s32(a: int32x2_t, b: int32x2_t) -> int32x2x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74083,7 +74095,11 @@ pub fn vuzpq_f16(a: float16x8_t, b: float16x8_t) -> float16x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74108,7 +74124,11 @@ pub fn vuzp_f32(a: float32x2_t, b: float32x2_t) -> float32x2x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74133,7 +74153,11 @@ pub fn vuzp_s32(a: int32x2_t, b: int32x2_t) -> int32x2x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74556,7 +74580,11 @@ pub fn vuzpq_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vzip.16"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] @@ -74574,7 +74602,11 @@ pub fn vzip_f16(a: float16x4_t, b: float16x4_t) -> float16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vzip.16"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] @@ -74593,7 +74625,11 @@ pub fn vzipq_f16(a: float16x8_t, b: float16x8_t) -> float16x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74618,7 +74654,11 @@ pub fn vzip_f32(a: float32x2_t, b: float32x2_t) -> float32x2x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74643,7 +74683,11 @@ pub fn vzip_s32(a: int32x2_t, b: int32x2_t) -> int32x2x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74668,7 +74712,11 @@ pub fn vzip_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74693,7 +74741,11 @@ pub fn vzip_s8(a: int8x8_t, b: int8x8_t) -> int8x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74718,7 +74770,11 @@ pub fn vzip_s16(a: int16x4_t, b: int16x4_t) -> int16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74743,7 +74799,11 @@ pub fn vzip_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74768,7 +74828,11 @@ pub fn vzip_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74793,7 +74857,11 @@ pub fn vzip_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74818,7 +74886,11 @@ pub fn vzip_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74843,7 +74915,11 @@ pub fn vzipq_f32(a: float32x4_t, b: float32x4_t) -> float32x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74876,7 +74952,11 @@ pub fn vzipq_s8(a: int8x16_t, b: int8x16_t) -> int8x16x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74901,7 +74981,11 @@ pub fn vzipq_s16(a: int16x8_t, b: int16x8_t) -> int16x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74926,7 +75010,11 @@ pub fn vzipq_s32(a: int32x4_t, b: int32x4_t) -> int32x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74959,7 +75047,11 @@ pub fn vzipq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74984,7 +75076,11 @@ pub fn vzipq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -75009,7 +75105,11 @@ pub fn vzipq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), @@ -75042,7 +75142,11 @@ pub fn vzipq_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(zip) + assert_instr(zip1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(zip2) )] #[cfg_attr( not(target_arch = "arm"), diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml index b2b4fd2f8551..8c6acd4fc55d 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml @@ -9601,7 +9601,8 @@ intrinsics: attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vtrn]]}]] - - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip1]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip2]]}]] - *neon-not-arm-stable - *neon-cfg-arm-unstable safety: safe @@ -9629,7 +9630,8 @@ intrinsics: attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vorr]]}]] - - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip1]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip2]]}]] - *neon-not-arm-stable - *neon-cfg-arm-unstable safety: safe @@ -9663,7 +9665,8 @@ intrinsics: attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vtrn]]}]] - - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip1]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip2]]}]] - *neon-not-arm-stable - *neon-cfg-arm-unstable safety: safe @@ -9691,7 +9694,8 @@ intrinsics: attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vzip]]}]] - - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip1]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip2]]}]] - *neon-not-arm-stable - *neon-cfg-arm-unstable safety: safe @@ -9723,7 +9727,8 @@ intrinsics: attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vzip.16"']]}]] - - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip1]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip2]]}]] - *neon-fp16 - *neon-unstable-f16 safety: safe @@ -9819,7 +9824,8 @@ intrinsics: attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vtrn]]}]] - - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip1]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip2]]}]] - *neon-not-arm-stable - *neon-cfg-arm-unstable safety: safe From c13e3aa6b4be163bb3c84f479b4f424023337b89 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Tue, 15 Jul 2025 22:12:12 +0200 Subject: [PATCH 036/183] `aarch64`: check for `uzp1` and `uzp2` --- .../src/arm_shared/neon/generated.rs | 102 +++++++++++++++--- .../spec/neon/arm_shared.spec.yml | 6 +- 2 files changed, 89 insertions(+), 19 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs index e6c69bebb358..8e369915868a 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs @@ -74058,7 +74058,11 @@ pub fn vusmmlaq_s32(a: int32x4_t, b: uint8x16_t, c: int8x16_t) -> int32x4_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] @@ -74076,7 +74080,11 @@ pub fn vuzp_f16(a: float16x4_t, b: float16x4_t) -> float16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] @@ -74182,7 +74190,11 @@ pub fn vuzp_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74207,7 +74219,11 @@ pub fn vuzpq_f32(a: float32x4_t, b: float32x4_t) -> float32x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74232,7 +74248,11 @@ pub fn vuzp_s8(a: int8x8_t, b: int8x8_t) -> int8x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74265,7 +74285,11 @@ pub fn vuzpq_s8(a: int8x16_t, b: int8x16_t) -> int8x16x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74290,7 +74314,11 @@ pub fn vuzp_s16(a: int16x4_t, b: int16x4_t) -> int16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74315,7 +74343,11 @@ pub fn vuzpq_s16(a: int16x8_t, b: int16x8_t) -> int16x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74340,7 +74372,11 @@ pub fn vuzpq_s32(a: int32x4_t, b: int32x4_t) -> int32x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74365,7 +74401,11 @@ pub fn vuzp_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74398,7 +74438,11 @@ pub fn vuzpq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74423,7 +74467,11 @@ pub fn vuzp_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74448,7 +74496,11 @@ pub fn vuzpq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74473,7 +74525,11 @@ pub fn vuzpq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74498,7 +74554,11 @@ pub fn vuzp_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74531,7 +74591,11 @@ pub fn vuzpq_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), @@ -74556,7 +74620,11 @@ pub fn vuzp_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(uzp) + assert_instr(uzp1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(uzp2) )] #[cfg_attr( not(target_arch = "arm"), diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml index 8c6acd4fc55d..3bf8bc1f4360 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml @@ -9755,7 +9755,8 @@ intrinsics: attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vuzp]]}]] - - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [uzp]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [uzp1]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [uzp2]]}]] - *neon-not-arm-stable - *neon-cfg-arm-unstable safety: safe @@ -9796,7 +9797,8 @@ intrinsics: attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vuzp]]}]] - - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [uzp]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [uzp1]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [uzp2]]}]] - *neon-fp16 - *neon-unstable-f16 safety: safe From bdd1ca1eeaf9ad3348aaa8039b98188bcd3bea6d Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Tue, 15 Jul 2025 22:14:21 +0200 Subject: [PATCH 037/183] `aarch64`: check for `trn1` and `trn2` --- .../src/arm_shared/neon/generated.rs | 102 +++++++++++++++--- .../spec/neon/arm_shared.spec.yml | 6 +- 2 files changed, 89 insertions(+), 19 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs index 8e369915868a..32531c7da135 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs @@ -72994,7 +72994,11 @@ pub fn vtbx4_p8(a: poly8x8_t, b: poly8x8x4_t, c: uint8x8_t) -> poly8x8_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] @@ -73012,7 +73016,11 @@ pub fn vtrn_f16(a: float16x4_t, b: float16x4_t) -> float16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] @@ -73118,7 +73126,11 @@ pub fn vtrn_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73143,7 +73155,11 @@ pub fn vtrnq_f32(a: float32x4_t, b: float32x4_t) -> float32x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73168,7 +73184,11 @@ pub fn vtrn_s8(a: int8x8_t, b: int8x8_t) -> int8x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73201,7 +73221,11 @@ pub fn vtrnq_s8(a: int8x16_t, b: int8x16_t) -> int8x16x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73226,7 +73250,11 @@ pub fn vtrn_s16(a: int16x4_t, b: int16x4_t) -> int16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73251,7 +73279,11 @@ pub fn vtrnq_s16(a: int16x8_t, b: int16x8_t) -> int16x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73276,7 +73308,11 @@ pub fn vtrnq_s32(a: int32x4_t, b: int32x4_t) -> int32x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73301,7 +73337,11 @@ pub fn vtrn_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73334,7 +73374,11 @@ pub fn vtrnq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73359,7 +73403,11 @@ pub fn vtrn_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73384,7 +73432,11 @@ pub fn vtrnq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73409,7 +73461,11 @@ pub fn vtrnq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73434,7 +73490,11 @@ pub fn vtrn_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73467,7 +73527,11 @@ pub fn vtrnq_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), @@ -73492,7 +73556,11 @@ pub fn vtrn_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4x2_t { #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), - assert_instr(trn) + assert_instr(trn1) +)] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(trn2) )] #[cfg_attr( not(target_arch = "arm"), diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml index 3bf8bc1f4360..c96c6e2a0c0b 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml @@ -9532,7 +9532,8 @@ intrinsics: attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vtrn]]}]] - - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [trn]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [trn1]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [trn2]]}]] - *neon-not-arm-stable - *neon-cfg-arm-unstable safety: safe @@ -9573,7 +9574,8 @@ intrinsics: attr: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vtrn]]}]] - - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [trn]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [trn1]]}]] + - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [trn2]]}]] - *neon-fp16 - *neon-unstable-f16 safety: safe From 959d191a25165ab64baeb4de46b2561d11d4a18e Mon Sep 17 00:00:00 2001 From: Madhav Madhusoodanan Date: Wed, 16 Jul 2025 17:12:12 +0530 Subject: [PATCH 038/183] Modified Typekind to group the Signed and Unsigned version of types. --- .../intrinsic-test/src/arm/intrinsic.rs | 7 +- .../crates/intrinsic-test/src/arm/types.rs | 12 +-- .../src/common/intrinsic_helpers.rs | 84 ++++++++++++++----- 3 files changed, 72 insertions(+), 31 deletions(-) diff --git a/library/stdarch/crates/intrinsic-test/src/arm/intrinsic.rs b/library/stdarch/crates/intrinsic-test/src/arm/intrinsic.rs index 773dabf4d75b..8c17856b829e 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/intrinsic.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/intrinsic.rs @@ -1,7 +1,7 @@ use crate::common::argument::ArgumentList; use crate::common::indentation::Indentation; use crate::common::intrinsic::{Intrinsic, IntrinsicDefinition}; -use crate::common::intrinsic_helpers::{IntrinsicType, IntrinsicTypeDefinition, TypeKind}; +use crate::common::intrinsic_helpers::{IntrinsicType, IntrinsicTypeDefinition, Sign, TypeKind}; use std::ops::Deref; #[derive(Debug, Clone, PartialEq)] @@ -73,8 +73,9 @@ impl IntrinsicDefinition for Intrinsic { TypeKind::Float if self.results().inner_size() == 16 => "float16_t".to_string(), TypeKind::Float if self.results().inner_size() == 32 => "float".to_string(), TypeKind::Float if self.results().inner_size() == 64 => "double".to_string(), - TypeKind::Int => format!("int{}_t", self.results().inner_size()), - TypeKind::UInt => format!("uint{}_t", self.results().inner_size()), + TypeKind::Int(Sign::Signed) => format!("int{}_t", self.results().inner_size()), + TypeKind::Int(Sign::Unsigned) => + format!("uint{}_t", self.results().inner_size()), TypeKind::Poly => format!("poly{}_t", self.results().inner_size()), ty => todo!("print_result_c - Unknown type: {:#?}", ty), }, diff --git a/library/stdarch/crates/intrinsic-test/src/arm/types.rs b/library/stdarch/crates/intrinsic-test/src/arm/types.rs index 9f3d6302f460..05db8b738eda 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/types.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/types.rs @@ -1,6 +1,6 @@ use super::intrinsic::ArmIntrinsicType; use crate::common::cli::Language; -use crate::common::intrinsic_helpers::{IntrinsicType, IntrinsicTypeDefinition, TypeKind}; +use crate::common::intrinsic_helpers::{IntrinsicType, IntrinsicTypeDefinition, Sign, TypeKind}; impl IntrinsicTypeDefinition for ArmIntrinsicType { /// Gets a string containing the typename for this type in C format. @@ -73,8 +73,8 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType { format!( "vld{len}{quad}_{type}{size}", type = match k { - TypeKind::UInt => "u", - TypeKind::Int => "s", + TypeKind::Int(Sign::Unsigned) => "u", + TypeKind::Int(Sign::Signed) => "s", TypeKind::Float => "f", // The ACLE doesn't support 64-bit polynomial loads on Armv7 // if armv7 and bl == 64, use "s", else "p" @@ -107,8 +107,8 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType { format!( "vget{quad}_lane_{type}{size}", type = match k { - TypeKind::UInt => "u", - TypeKind::Int => "s", + TypeKind::Int(Sign::Unsigned) => "u", + TypeKind::Int(Sign::Signed) => "s", TypeKind::Float => "f", TypeKind::Poly => "p", x => todo!("get_load_function TypeKind: {:#?}", x), @@ -176,7 +176,7 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType { } else { let kind = start.parse::()?; let bit_len = match kind { - TypeKind::Int => Some(32), + TypeKind::Int(_) => Some(32), _ => None, }; Ok(Box::new(ArmIntrinsicType(IntrinsicType { diff --git a/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs b/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs index 3d200b19461e..ea210c78bda7 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs @@ -8,14 +8,22 @@ use super::cli::Language; use super::indentation::Indentation; use super::values::value_for_array; +#[derive(Debug, PartialEq, Copy, Clone)] +pub enum Sign { + Signed, + Unsigned, +} + #[derive(Debug, PartialEq, Copy, Clone)] pub enum TypeKind { BFloat, Float, - Int, - UInt, + Int(Sign), + Char(Sign), Poly, Void, + Mask, + Vector, } impl FromStr for TypeKind { @@ -23,12 +31,17 @@ impl FromStr for TypeKind { fn from_str(s: &str) -> Result { match s { - "bfloat" => Ok(Self::BFloat), - "float" => Ok(Self::Float), - "int" => Ok(Self::Int), + "bfloat" | "BF16" => Ok(Self::BFloat), + "float" | "double" | "FP16" | "FP32" | "FP64" => Ok(Self::Float), + "int" | "long" | "short" | "SI8" | "SI16" | "SI32" | "SI64" => { + Ok(Self::Int(Sign::Signed)) + } "poly" => Ok(Self::Poly), - "uint" | "unsigned" => Ok(Self::UInt), + "char" => Ok(Self::Char(Sign::Signed)), + "uint" | "unsigned" | "UI8" | "UI16" | "UI32" | "UI64" => Ok(Self::Int(Sign::Unsigned)), "void" => Ok(Self::Void), + "MASK" => Ok(Self::Mask), + "M64" | "M128" | "M256" | "M512" => Ok(Self::Vector), _ => Err(format!("Impossible to parse argument kind {s}")), } } @@ -42,10 +55,14 @@ impl fmt::Display for TypeKind { match self { Self::BFloat => "bfloat", Self::Float => "float", - Self::Int => "int", - Self::UInt => "uint", + Self::Int(Sign::Signed) => "int", + Self::Int(Sign::Unsigned) => "uint", Self::Poly => "poly", Self::Void => "void", + Self::Char(Sign::Signed) => "char", + Self::Char(Sign::Unsigned) => "unsigned char", + Self::Mask => "mask", + Self::Vector => "vector", } ) } @@ -56,9 +73,10 @@ impl TypeKind { pub fn c_prefix(&self) -> &str { match self { Self::Float => "float", - Self::Int => "int", - Self::UInt => "uint", + Self::Int(Sign::Signed) => "int", + Self::Int(Sign::Unsigned) => "uint", Self::Poly => "poly", + Self::Char(Sign::Signed) => "char", _ => unreachable!("Not used: {:#?}", self), } } @@ -66,10 +84,13 @@ impl TypeKind { /// Gets the rust prefix for the type kind i.e. i, u, f. pub fn rust_prefix(&self) -> &str { match self { + Self::BFloat => "bf", Self::Float => "f", - Self::Int => "i", - Self::UInt => "u", + Self::Int(Sign::Signed) => "i", + Self::Int(Sign::Unsigned) => "u", Self::Poly => "u", + Self::Char(Sign::Unsigned) => "u", + Self::Char(Sign::Signed) => "i", _ => unreachable!("Unused type kind: {:#?}", self), } } @@ -133,11 +154,14 @@ impl IntrinsicType { } pub fn c_scalar_type(&self) -> String { - format!( - "{prefix}{bits}_t", - prefix = self.kind().c_prefix(), - bits = self.inner_size() - ) + match self.kind() { + TypeKind::Char(_) => String::from("char"), + _ => format!( + "{prefix}{bits}_t", + prefix = self.kind().c_prefix(), + bits = self.inner_size() + ), + } } pub fn rust_scalar_type(&self) -> String { @@ -155,8 +179,8 @@ impl IntrinsicType { bit_len: Some(8), .. } => match kind { - TypeKind::Int => "(int)", - TypeKind::UInt => "(unsigned int)", + TypeKind::Int(Sign::Signed) => "(int)", + TypeKind::Int(Sign::Unsigned) => "(unsigned int)", TypeKind::Poly => "(unsigned int)(uint8_t)", _ => "", }, @@ -172,6 +196,21 @@ impl IntrinsicType { 128 => "", _ => panic!("invalid bit_len"), }, + IntrinsicType { + kind: TypeKind::Float, + bit_len: Some(bit_len), + .. + } => match bit_len { + 16 => "(float16_t)", + 32 => "(float)", + 64 => "(double)", + 128 => "", + _ => panic!("invalid bit_len"), + }, + IntrinsicType { + kind: TypeKind::Char(_), + .. + } => "(char)", _ => "", } } @@ -185,7 +224,7 @@ impl IntrinsicType { match self { IntrinsicType { bit_len: Some(bit_len @ (8 | 16 | 32 | 64)), - kind: kind @ (TypeKind::Int | TypeKind::UInt | TypeKind::Poly), + kind: kind @ (TypeKind::Int(_) | TypeKind::Poly | TypeKind::Char(_)), simd_len, vec_len, .. @@ -201,7 +240,8 @@ impl IntrinsicType { .format_with(",\n", |i, fmt| { let src = value_for_array(*bit_len, i); assert!(src == 0 || src.ilog2() < *bit_len); - if *kind == TypeKind::Int && (src >> (*bit_len - 1)) != 0 { + if *kind == TypeKind::Int(Sign::Signed) && (src >> (*bit_len - 1)) != 0 + { // `src` is a two's complement representation of a negative value. let mask = !0u64 >> (64 - *bit_len); let ones_compl = src ^ mask; @@ -257,7 +297,7 @@ impl IntrinsicType { .. } => false, IntrinsicType { - kind: TypeKind::Int | TypeKind::UInt | TypeKind::Poly, + kind: TypeKind::Int(_) | TypeKind::Poly, .. } => true, _ => unimplemented!(), From d8a783dab57b9d427cc4147e746a35576d7256c0 Mon Sep 17 00:00:00 2001 From: sayantn Date: Tue, 15 Jul 2025 16:46:37 +0530 Subject: [PATCH 039/183] Update SDE to v9.58.0 --- .../x86_64-unknown-linux-gnu/Dockerfile | 2 +- .../docker/x86_64-unknown-linux-gnu/cpuid.def | 36 ++++++++----------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile index acde432794e5..b13050cdc66e 100644 --- a/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ wget \ xz-utils -RUN wget http://ci-mirrors.rust-lang.org/stdarch/sde-external-9.53.0-2025-03-16-lin.tar.xz -O sde.tar.xz +RUN wget http://ci-mirrors.rust-lang.org/stdarch/sde-external-9.58.0-2025-06-16-lin.tar.xz -O sde.tar.xz RUN mkdir intel-sde RUN tar -xJf sde.tar.xz --strip-components=1 -C intel-sde ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="/intel-sde/sde64 \ diff --git a/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/cpuid.def b/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/cpuid.def index 4cce9d7a3c00..95cef6199311 100644 --- a/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/cpuid.def +++ b/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/cpuid.def @@ -1,41 +1,35 @@ -# Copyright (C) 2024-2024 Intel Corporation. -# +# Copyright (C) 2017-2025 Intel Corporation. +# # This software and the related documents are Intel copyrighted materials, and your # use of them is governed by the express license under which they were provided to # you ("License"). Unless the License provides otherwise, you may not use, modify, # copy, publish, distribute, disclose or transmit this software or the related # documents without Intel's prior written permission. -# +# # This software and the related documents are provided as is, with no express or # implied warranties, other than those that are expressly stated in the License. # -# The CPUID information in this file is for software enabling purposes only and -# it is not a full and accurate representation of the CPU under development which -# it represents. -# The CPUID information in this file is not a guarantee of the availability of -# features or characteristics in the final released CPU. -# # CPUID_VERSION = 1.0 # Input => Output # EAX ECX => EAX EBX ECX EDX 00000000 ******** => 00000024 68747541 444d4163 69746e65 -00000001 ******** => 000d06f0 00100800 7ffaf3ff bfebfbff +00000001 ******** => 00400f10 00100800 7ffaf3ff bfebfbff 00000002 ******** => 76035a01 00f0b6ff 00000000 00c10000 00000003 ******** => 00000000 00000000 00000000 00000000 -00000004 00000000 => 7c004121 02c0003f 0000003f 00000000 #Deterministic Cache +00000004 00000000 => 7c004121 01c0003f 0000003f 00000000 #Deterministic Cache 00000004 00000001 => 7c004122 01c0003f 0000003f 00000000 -00000004 00000002 => 7c004143 03c0003f 000007ff 00000000 -00000004 00000003 => 7c0fc163 04c0003f 0005ffff 00000004 +00000004 00000002 => 7c004143 03c0003f 000003ff 00000000 +00000004 00000003 => 7c0fc163 0280003f 0000dfff 00000004 00000004 00000004 => 00000000 00000000 00000000 00000000 00000005 ******** => 00000040 00000040 00000003 00042120 #MONITOR/MWAIT 00000006 ******** => 00000077 00000002 00000001 00000000 #Thermal and Power -00000007 00000000 => 00000001 f3bfbfbf bbc05ffe 03d55130 #Extended Features -00000007 00000001 => 88ee00bf 00000002 00000000 1d29cd3e +00000007 00000000 => 00000001 f3bfbfbf bac05ffe 03d54130 #Extended Features +00000007 00000001 => 98ee00bf 00000002 00000020 1d29cd3e 00000008 ******** => 00000000 00000000 00000000 00000000 00000009 ******** => 00000000 00000000 00000000 00000000 #Direct Cache 0000000a ******** => 07300403 00000000 00000000 00000603 -0000000b 00000000 => 00000001 00000002 00000100 0000001e #Extended Topology -0000000b 00000001 => 00000004 00000002 00000201 0000001e +0000000b 00000000 => 00000001 00000002 00000100 00000000 #Extended Topology +0000000b 00000001 => 00000004 00000002 00000201 00000000 0000000c ******** => 00000000 00000000 00000000 00000000 0000000d 00000000 => 000e02e7 00002b00 00002b00 00000000 #xcr0 0000000d 00000001 => 0000001f 00000240 00000100 00000000 @@ -52,10 +46,8 @@ 0000001d 00000001 => 04002000 00080040 00000010 00000000 #AMX Palette1 0000001e 00000000 => 00000001 00004010 00000000 00000000 #AMX Tmul 0000001e 00000001 => 000001ff 00000000 00000000 00000000 -0000001f 00000000 => 00000001 00000002 00000100 0000001e -0000001f 00000001 => 00000007 00000070 00000201 0000001e -0000001f 00000002 => 00000000 00000000 00000002 0000001e -00000024 00000000 => 00000000 00070002 00000000 00000000 #AVX10 +00000024 00000000 => 00000001 00070002 00000000 00000000 #AVX10 +00000024 00000001 => 00000000 00000000 00000004 00000000 80000000 ******** => 80000008 00000000 00000000 00000000 80000001 ******** => 00000000 00000000 00200961 2c100000 80000002 ******** => 00000000 00000000 00000000 00000000 @@ -66,6 +58,6 @@ 80000007 ******** => 00000000 00000000 00000000 00000100 80000008 ******** => 00003028 00000200 00000200 00000000 -# This file was copied from intel-sde/misc/cpuid/dmr/cpuid.def, and modified to +# This file was copied from intel-sde/misc/cpuid/future/cpuid.def, and modified to # use "AuthenticAMD" as the vendor and the support for `XOP`, `SSE4a`, `TBM`, # `AVX512_VP2INTERSECT` and the VEX variants of AVX512 was added in the CPUID. From a2486a5138477739a6101aae9403c92c1df5c3d0 Mon Sep 17 00:00:00 2001 From: sayantn Date: Tue, 15 Jul 2025 16:55:32 +0530 Subject: [PATCH 040/183] Update Docker OS to Ubuntu-25.10 --- library/stdarch/ci/docker/aarch64-unknown-linux-gnu/Dockerfile | 2 +- .../stdarch/ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile | 2 +- .../stdarch/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile | 2 +- library/stdarch/ci/docker/i586-unknown-linux-gnu/Dockerfile | 2 +- library/stdarch/ci/docker/i686-unknown-linux-gnu/Dockerfile | 2 +- .../stdarch/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile | 2 +- library/stdarch/ci/docker/mips-unknown-linux-gnu/Dockerfile | 2 +- .../stdarch/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile | 2 +- .../ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile | 2 +- library/stdarch/ci/docker/mipsel-unknown-linux-musl/Dockerfile | 2 +- library/stdarch/ci/docker/nvptx64-nvidia-cuda/Dockerfile | 2 +- library/stdarch/ci/docker/powerpc-unknown-linux-gnu/Dockerfile | 2 +- .../stdarch/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile | 2 +- .../stdarch/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile | 2 +- .../stdarch/ci/docker/riscv32gc-unknown-linux-gnu/Dockerfile | 2 +- .../stdarch/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile | 2 +- library/stdarch/ci/docker/s390x-unknown-linux-gnu/Dockerfile | 2 +- library/stdarch/ci/docker/wasm32-wasip1/Dockerfile | 2 +- library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/library/stdarch/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/aarch64-unknown-linux-gnu/Dockerfile index 17025efffea6..e09f77d73959 100644 --- a/library/stdarch/ci/docker/aarch64-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/aarch64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ g++ \ diff --git a/library/stdarch/ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile index 74f770556dbe..e424e92656e9 100644 --- a/library/stdarch/ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ diff --git a/library/stdarch/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/library/stdarch/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile index 14eaf9f9eef0..6d4ff2482867 100644 --- a/library/stdarch/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile +++ b/library/stdarch/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ ca-certificates \ diff --git a/library/stdarch/ci/docker/i586-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/i586-unknown-linux-gnu/Dockerfile index 5a4a22369a80..49d5cecc71ea 100644 --- a/library/stdarch/ci/docker/i586-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/i586-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc-multilib \ libc6-dev \ diff --git a/library/stdarch/ci/docker/i686-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/i686-unknown-linux-gnu/Dockerfile index 5a4a22369a80..49d5cecc71ea 100644 --- a/library/stdarch/ci/docker/i686-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/i686-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc-multilib \ libc6-dev \ diff --git a/library/stdarch/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile index 99ccf286f36d..ec7ed5846d9d 100644 --- a/library/stdarch/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/library/stdarch/ci/docker/mips-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/mips-unknown-linux-gnu/Dockerfile index f43a3c966331..f521ba317937 100644 --- a/library/stdarch/ci/docker/mips-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/mips-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/library/stdarch/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile b/library/stdarch/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile index 235ac0997b1e..a8b352881e81 100644 --- a/library/stdarch/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile +++ b/library/stdarch/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/library/stdarch/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile b/library/stdarch/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile index 6041d8911749..147a3df61455 100644 --- a/library/stdarch/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile +++ b/library/stdarch/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/library/stdarch/ci/docker/mipsel-unknown-linux-musl/Dockerfile b/library/stdarch/ci/docker/mipsel-unknown-linux-musl/Dockerfile index cd38348eeb5c..ed57511de7b9 100644 --- a/library/stdarch/ci/docker/mipsel-unknown-linux-musl/Dockerfile +++ b/library/stdarch/ci/docker/mipsel-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/library/stdarch/ci/docker/nvptx64-nvidia-cuda/Dockerfile b/library/stdarch/ci/docker/nvptx64-nvidia-cuda/Dockerfile index 5b4869863c70..65cf281b1477 100644 --- a/library/stdarch/ci/docker/nvptx64-nvidia-cuda/Dockerfile +++ b/library/stdarch/ci/docker/nvptx64-nvidia-cuda/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ libc6-dev \ diff --git a/library/stdarch/ci/docker/powerpc-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/powerpc-unknown-linux-gnu/Dockerfile index baad95d57843..82d05f0b25d1 100644 --- a/library/stdarch/ci/docker/powerpc-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/powerpc-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/library/stdarch/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile index dcbcb43513ee..c5460e1544fa 100644 --- a/library/stdarch/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/library/stdarch/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile index 8dfac0ec1e41..3d3eb8c6f34e 100644 --- a/library/stdarch/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/library/stdarch/ci/docker/riscv32gc-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/riscv32gc-unknown-linux-gnu/Dockerfile index 81f7b6239af5..dbe74914f2c2 100644 --- a/library/stdarch/ci/docker/riscv32gc-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/riscv32gc-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/library/stdarch/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile index 7ee69e46e2e5..10316cae6c29 100644 --- a/library/stdarch/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/library/stdarch/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/s390x-unknown-linux-gnu/Dockerfile index af02ebcbd169..04e5464b9c92 100644 --- a/library/stdarch/ci/docker/s390x-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/s390x-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates \ diff --git a/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile b/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile index eeafde79733e..76b69592bcfe 100644 --- a/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile +++ b/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -y && apt-get install -y --no-install-recommends \ diff --git a/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile index b13050cdc66e..99bfd056fb44 100644 --- a/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.04 +FROM ubuntu:25.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ libc6-dev \ From ed2918988b6ac1fb76de343fa05ed737554b17de Mon Sep 17 00:00:00 2001 From: sayantn Date: Tue, 15 Jul 2025 17:21:17 +0530 Subject: [PATCH 041/183] Bump versions in CI - `clang-19` -> `clang-20` in ARM - `gcc-14.2` -> `gcc-14.3` in AArch64-BE - `gcc-14` ->`gcc-15` in LA64 - `riscv-gnu-v2025.01.20` -> `riscv-gnu-v2025.07.03` in Risc-V 32 - `wasmtime-v18.0.2` -> `wasmtime-v34.0.1` --- .../stdarch/ci/docker/aarch64-unknown-linux-gnu/Dockerfile | 2 +- .../ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile | 6 +++--- .../ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile | 2 +- .../ci/docker/loongarch64-unknown-linux-gnu/Dockerfile | 2 +- .../ci/docker/riscv32gc-unknown-linux-gnu/Dockerfile | 2 +- library/stdarch/ci/docker/wasm32-wasip1/Dockerfile | 6 ++++-- library/stdarch/ci/run.sh | 6 +++--- library/stdarch/crates/intrinsic-test/src/arm/compile.rs | 6 +++--- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/library/stdarch/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/aarch64-unknown-linux-gnu/Dockerfile index e09f77d73959..70c06509755c 100644 --- a/library/stdarch/ci/docker/aarch64-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/aarch64-unknown-linux-gnu/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ qemu-user \ make \ file \ - clang-19 \ + clang \ lld ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ diff --git a/library/stdarch/ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile index e424e92656e9..56ddbd990b18 100644 --- a/library/stdarch/ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile @@ -9,15 +9,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ qemu-user \ make \ file \ - clang-19 \ + clang \ curl \ xz-utils \ lld -ENV TOOLCHAIN="arm-gnu-toolchain-14.2.rel1-x86_64-aarch64_be-none-linux-gnu" +ENV TOOLCHAIN="arm-gnu-toolchain-14.3.rel1-x86_64-aarch64_be-none-linux-gnu" # Download the aarch64_be gcc toolchain -RUN curl -L "https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/${TOOLCHAIN}.tar.xz" -o "${TOOLCHAIN}.tar.xz" +RUN curl -L "https://developer.arm.com/-/media/Files/downloads/gnu/14.3.rel1/binrel/${TOOLCHAIN}.tar.xz" -o "${TOOLCHAIN}.tar.xz" RUN tar -xvf "${TOOLCHAIN}.tar.xz" RUN mkdir /toolchains && mv "./${TOOLCHAIN}" /toolchains diff --git a/library/stdarch/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile b/library/stdarch/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile index 2086e117d92b..602249c0ece5 100644 --- a/library/stdarch/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile +++ b/library/stdarch/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ qemu-user \ make \ file \ - clang-19 \ + clang \ lld ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -cpu max -L /usr/arm-linux-gnueabihf" \ diff --git a/library/stdarch/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile index ec7ed5846d9d..5ab3431ba272 100644 --- a/library/stdarch/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:25.10 RUN apt-get update && \ apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user-static ca-certificates \ - gcc-14-loongarch64-linux-gnu libc6-dev-loong64-cross + gcc-loongarch64-linux-gnu libc6-dev-loong64-cross ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER=loongarch64-linux-gnu-gcc-14 \ diff --git a/library/stdarch/ci/docker/riscv32gc-unknown-linux-gnu/Dockerfile b/library/stdarch/ci/docker/riscv32gc-unknown-linux-gnu/Dockerfile index dbe74914f2c2..fb1718b338f8 100644 --- a/library/stdarch/ci/docker/riscv32gc-unknown-linux-gnu/Dockerfile +++ b/library/stdarch/ci/docker/riscv32gc-unknown-linux-gnu/Dockerfile @@ -4,7 +4,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ wget xz-utils make file llvm -ENV VERSION=2025.01.20 +ENV VERSION=2025.07.03 RUN wget "https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/${VERSION}/riscv32-glibc-ubuntu-24.04-gcc-nightly-${VERSION}-nightly.tar.xz" \ -O riscv-toolchain.tar.xz diff --git a/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile b/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile index 76b69592bcfe..f618b94291f5 100644 --- a/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile +++ b/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile @@ -7,7 +7,9 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \ xz-utils \ clang -RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.2/wasmtime-v18.0.2-x86_64-linux.tar.xz | tar xJf - -ENV PATH=$PATH:/wasmtime-v18.0.2-x86_64-linux +ENV VERSION=v34.0.1 + +RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/${VERSION}/wasmtime-${VERSION}-x86_64-linux.tar.xz | tar xJf - +ENV PATH=$PATH:/wasmtime-${VERSION}-x86_64-linux ENV CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime --dir /checkout/target/wasm32-wasip1/release/deps::." diff --git a/library/stdarch/ci/run.sh b/library/stdarch/ci/run.sh index 8eadb9285c99..78a808b46a04 100755 --- a/library/stdarch/ci/run.sh +++ b/library/stdarch/ci/run.sh @@ -144,21 +144,21 @@ case ${TARGET} in aarch64-unknown-linux-gnu*) TEST_CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/" TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64.txt - TEST_CXX_COMPILER="clang++-19" + TEST_CXX_COMPILER="clang++" TEST_RUNNER="${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}" ;; aarch64_be-unknown-linux-gnu*) TEST_CPPFLAGS="-fuse-ld=lld" TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64.txt - TEST_CXX_COMPILER="clang++-19" + TEST_CXX_COMPILER="clang++" TEST_RUNNER="${CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_RUNNER}" ;; armv7-unknown-linux-gnueabihf*) TEST_CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/" TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_arm.txt - TEST_CXX_COMPILER="clang++-19" + TEST_CXX_COMPILER="clang++" TEST_RUNNER="${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}" ;; *) diff --git a/library/stdarch/crates/intrinsic-test/src/arm/compile.rs b/library/stdarch/crates/intrinsic-test/src/arm/compile.rs index 8276cd87c1cb..79cd32dedc5f 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/compile.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/compile.rs @@ -38,9 +38,9 @@ pub fn compile_c_arm( .set_include_paths(vec![ "/include", "/aarch64_be-none-linux-gnu/include", - "/aarch64_be-none-linux-gnu/include/c++/14.2.1", - "/aarch64_be-none-linux-gnu/include/c++/14.2.1/aarch64_be-none-linux-gnu", - "/aarch64_be-none-linux-gnu/include/c++/14.2.1/backward", + "/aarch64_be-none-linux-gnu/include/c++/14.3.1", + "/aarch64_be-none-linux-gnu/include/c++/14.3.1/aarch64_be-none-linux-gnu", + "/aarch64_be-none-linux-gnu/include/c++/14.3.1/backward", "/aarch64_be-none-linux-gnu/libc/usr/include", ]); } From 08ef07171754b6cdd0949395a225eab6ba7e6b48 Mon Sep 17 00:00:00 2001 From: sayantn Date: Wed, 16 Jul 2025 17:17:33 +0530 Subject: [PATCH 042/183] Update `wasmprinter` to latest --- library/stdarch/Cargo.lock | 28 ++++++++++++------- .../stdarch/crates/stdarch-test/Cargo.toml | 2 +- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/library/stdarch/Cargo.lock b/library/stdarch/Cargo.lock index a30743925d92..122b3057b2f6 100644 --- a/library/stdarch/Cargo.lock +++ b/library/stdarch/Cargo.lock @@ -82,6 +82,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + [[package]] name = "cc" version = "1.2.29" @@ -99,9 +105,9 @@ checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "clap" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" dependencies = [ "clap_builder", "clap_derive", @@ -109,9 +115,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" dependencies = [ "anstream", "anstyle", @@ -121,9 +127,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" dependencies = [ "heck", "proc-macro2", @@ -833,21 +839,23 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasmparser" -version = "0.113.3" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" +checksum = "161296c618fa2d63f6ed5fffd1112937e803cb9ec71b32b01a76321555660917" dependencies = [ + "bitflags", "indexmap 2.10.0", "semver", ] [[package]] name = "wasmprinter" -version = "0.2.67" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6615a5587149e753bf4b93f90fa3c3f41c88597a7a2da72879afcabeda9648f" +checksum = "75aa8e9076de6b9544e6dab4badada518cca0bf4966d35b131bbd057aed8fa0a" dependencies = [ "anyhow", + "termcolor", "wasmparser", ] diff --git a/library/stdarch/crates/stdarch-test/Cargo.toml b/library/stdarch/crates/stdarch-test/Cargo.toml index e4791e4ec525..299bc8c63bf2 100644 --- a/library/stdarch/crates/stdarch-test/Cargo.toml +++ b/library/stdarch/crates/stdarch-test/Cargo.toml @@ -20,7 +20,7 @@ cc = "1.0" # time, and we want to make updates to this explicit rather than automatically # picking up updates which might break CI with new instruction names. [target.'cfg(target_arch = "wasm32")'.dependencies] -wasmprinter = "=0.2.67" +wasmprinter = "=0.235" [features] default = [] From 6e3b9ddc3a3884e110ad6b2b57e861d8c0c98771 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 16 Jul 2025 13:40:56 +0200 Subject: [PATCH 043/183] triagebot welcome message for new users --- src/tools/miri/CONTRIBUTING.md | 2 +- src/tools/miri/triagebot.toml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/tools/miri/CONTRIBUTING.md b/src/tools/miri/CONTRIBUTING.md index fef7f807e936..e4302b734aa5 100644 --- a/src/tools/miri/CONTRIBUTING.md +++ b/src/tools/miri/CONTRIBUTING.md @@ -13,7 +13,7 @@ for a list of Miri maintainers. [Rust Zulip]: https://rust-lang.zulipchat.com -### Pull review process +### PR review process When you get a review, please take care of the requested changes in new commits. Do not amend existing commits. Generally avoid force-pushing. The only time you should force push is when there diff --git a/src/tools/miri/triagebot.toml b/src/tools/miri/triagebot.toml index 60e80c3f6733..c109b620846d 100644 --- a/src/tools/miri/triagebot.toml +++ b/src/tools/miri/triagebot.toml @@ -17,6 +17,17 @@ allow-unauthenticated = [ [assign] warn_non_default_branch = true contributing_url = "https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md" +[assign.custom_welcome_messages] +welcome-message = """ +Welcome, and thank you for contributing to Miri! +To ensure a smooth reviewing experience, please read https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#pr-review-process. +In particular, please do not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it. +""" +welcome-message-no-reviewer = """ +Welcome, and thank you for contributing to Miri! +To ensure a smooth reviewing experience, please read https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#pr-review-process. +In particular, please do not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it. +""" [no-merges] exclude_titles = ["Rustup"] From 0d9d2094178fcaa1cae5b71d18198859bdaa40bf Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Wed, 16 Jul 2025 16:27:51 +0200 Subject: [PATCH 044/183] fix space in generated loongarch --- library/stdarch/crates/stdarch-gen-loongarch/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/stdarch/crates/stdarch-gen-loongarch/src/main.rs b/library/stdarch/crates/stdarch-gen-loongarch/src/main.rs index aa9990b6ccd1..9e10a4c3f031 100644 --- a/library/stdarch/crates/stdarch-gen-loongarch/src/main.rs +++ b/library/stdarch/crates/stdarch-gen-loongarch/src/main.rs @@ -280,7 +280,7 @@ fn gen_bind_body( let fn_output = if out_t.to_lowercase() == "void" { String::new() } else { - format!("-> {}", type_to_rst(out_t, is_store)) + format!(" -> {}", type_to_rst(out_t, is_store)) }; let fn_inputs = match para_num { 1 => format!("(a: {})", type_to_rst(in_t[0], is_store)), @@ -304,7 +304,7 @@ fn gen_bind_body( ), _ => panic!("unsupported parameter number"), }; - format!("fn __{current_name}{fn_inputs} {fn_output};") + format!("fn __{current_name}{fn_inputs}{fn_output};") }; let function = format!( r#" #[link_name = "llvm.loongarch.{}"] From 10d7b7b6767368f940eec85cec8543ce1c9a6989 Mon Sep 17 00:00:00 2001 From: Madhav Madhusoodanan Date: Wed, 16 Jul 2025 23:49:04 +0530 Subject: [PATCH 045/183] Implemented DerefMut for ArmIntrinsicTest More details: 1. Moved the return type of IntrinsicType::from_c to Rust from Result, String> --- .../crates/intrinsic-test/src/arm/intrinsic.rs | 8 +++++++- .../crates/intrinsic-test/src/arm/json_parser.rs | 2 +- .../crates/intrinsic-test/src/arm/types.rs | 15 +++++++-------- .../crates/intrinsic-test/src/common/argument.rs | 2 +- .../src/common/intrinsic_helpers.rs | 4 +++- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/library/stdarch/crates/intrinsic-test/src/arm/intrinsic.rs b/library/stdarch/crates/intrinsic-test/src/arm/intrinsic.rs index 8c17856b829e..16572b2c03f1 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/intrinsic.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/intrinsic.rs @@ -2,7 +2,7 @@ use crate::common::argument::ArgumentList; use crate::common::indentation::Indentation; use crate::common::intrinsic::{Intrinsic, IntrinsicDefinition}; use crate::common::intrinsic_helpers::{IntrinsicType, IntrinsicTypeDefinition, Sign, TypeKind}; -use std::ops::Deref; +use std::ops::{Deref, DerefMut}; #[derive(Debug, Clone, PartialEq)] pub struct ArmIntrinsicType(pub IntrinsicType); @@ -15,6 +15,12 @@ impl Deref for ArmIntrinsicType { } } +impl DerefMut for ArmIntrinsicType { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + impl IntrinsicDefinition for Intrinsic { fn arguments(&self) -> ArgumentList { self.arguments.clone() diff --git a/library/stdarch/crates/intrinsic-test/src/arm/json_parser.rs b/library/stdarch/crates/intrinsic-test/src/arm/json_parser.rs index 0ac47484b019..58d366c86a93 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/json_parser.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/json_parser.rs @@ -110,7 +110,7 @@ fn json_to_intrinsic( Ok(Intrinsic { name, arguments, - results: *results, + results: results, arch_tags: intr.architectures, }) } diff --git a/library/stdarch/crates/intrinsic-test/src/arm/types.rs b/library/stdarch/crates/intrinsic-test/src/arm/types.rs index 05db8b738eda..77f5e8d0e560 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/types.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/types.rs @@ -121,7 +121,7 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType { } } - fn from_c(s: &str, target: &str) -> Result, String> { + fn from_c(s: &str, target: &str) -> Result { const CONST_STR: &str = "const"; if let Some(s) = s.strip_suffix('*') { let (s, constant) = match s.trim().strip_suffix(CONST_STR) { @@ -131,9 +131,8 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType { let s = s.trim_end(); let temp_return = ArmIntrinsicType::from_c(s, target); temp_return.map(|mut op| { - let edited = op.as_mut(); - edited.0.ptr = true; - edited.0.ptr_constant = constant; + op.ptr = true; + op.ptr_constant = constant; op }) } else { @@ -163,7 +162,7 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType { ), None => None, }; - Ok(Box::new(ArmIntrinsicType(IntrinsicType { + Ok(ArmIntrinsicType(IntrinsicType { ptr: false, ptr_constant: false, constant, @@ -172,14 +171,14 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType { simd_len, vec_len, target: target.to_string(), - }))) + })) } else { let kind = start.parse::()?; let bit_len = match kind { TypeKind::Int(_) => Some(32), _ => None, }; - Ok(Box::new(ArmIntrinsicType(IntrinsicType { + Ok(ArmIntrinsicType(IntrinsicType { ptr: false, ptr_constant: false, constant, @@ -188,7 +187,7 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType { simd_len: None, vec_len: None, target: target.to_string(), - }))) + })) } } } diff --git a/library/stdarch/crates/intrinsic-test/src/common/argument.rs b/library/stdarch/crates/intrinsic-test/src/common/argument.rs index 443ccb919f46..e0c93651918a 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/argument.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/argument.rs @@ -76,7 +76,7 @@ where Argument { pos, name: String::from(var_name), - ty: *ty, + ty: ty, constraint, } } diff --git a/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs b/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs index ea210c78bda7..697f9c8754da 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs @@ -322,7 +322,9 @@ pub trait IntrinsicTypeDefinition: Deref { fn get_lane_function(&self) -> String; /// can be implemented in an `impl` block - fn from_c(_s: &str, _target: &str) -> Result, String>; + fn from_c(_s: &str, _target: &str) -> Result + where + Self: Sized; /// Gets a string containing the typename for this type in C format. /// can be directly defined in `impl` blocks From b390c413882205de0716de3464f409d87f309d25 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 16 Jul 2025 19:42:52 +0200 Subject: [PATCH 046/183] triagebot: tweak welcome message --- src/tools/miri/triagebot.toml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/tools/miri/triagebot.toml b/src/tools/miri/triagebot.toml index c109b620846d..9352ac73424f 100644 --- a/src/tools/miri/triagebot.toml +++ b/src/tools/miri/triagebot.toml @@ -16,17 +16,12 @@ allow-unauthenticated = [ # Enables assigning users to issues and PRs. [assign] warn_non_default_branch = true -contributing_url = "https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md" +contributing_url = "https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#pr-review-process" [assign.custom_welcome_messages] -welcome-message = """ -Welcome, and thank you for contributing to Miri! -To ensure a smooth reviewing experience, please read https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#pr-review-process. -In particular, please do not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it. -""" +welcome-message = "(unused)" welcome-message-no-reviewer = """ -Welcome, and thank you for contributing to Miri! -To ensure a smooth reviewing experience, please read https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#pr-review-process. -In particular, please do not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it. +Thank you for contributing to Miri! +Please remember to not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it. """ [no-merges] From 6728da5396b3ac80e2b6b53027c4f7cea4dbba02 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 16 Jul 2025 22:17:16 +0200 Subject: [PATCH 047/183] set S-waiting-on labels on new PRs --- src/tools/miri/triagebot.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools/miri/triagebot.toml b/src/tools/miri/triagebot.toml index 9352ac73424f..a0ce9f800242 100644 --- a/src/tools/miri/triagebot.toml +++ b/src/tools/miri/triagebot.toml @@ -44,6 +44,12 @@ remove = [] add = ["S-waiting-on-author"] unless = ["S-blocked", "S-waiting-on-team", "S-waiting-on-review"] +[autolabel."S-waiting-on-review"] +new_pr = true + +[autolabel."S-waiting-on-author"] +new_draft = true + # Automatically close and reopen PRs made by bots to run CI on them [bot-pull-requests] From b74c4825cbb4d86995362e02025cc999005e6fd8 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 17 Jul 2025 02:00:42 +0200 Subject: [PATCH 048/183] test for the high version of a number of instructions --- .../core_arch/src/aarch64/neon/generated.rs | 58 +++++++++---------- .../spec/neon/aarch64.spec.yml | 30 +++++----- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs index 31618d39b947..bc4c438038dc 100644 --- a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs @@ -51,7 +51,7 @@ pub fn __crc32d(crc: u32, data: u64) -> u32 { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(sabal))] +#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(sabal2))] pub fn vabal_high_s8(a: int16x8_t, b: int8x16_t, c: int8x16_t) -> int16x8_t { unsafe { let d: int8x8_t = simd_shuffle!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]); @@ -66,7 +66,7 @@ pub fn vabal_high_s8(a: int16x8_t, b: int8x16_t, c: int8x16_t) -> int16x8_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(sabal))] +#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(sabal2))] pub fn vabal_high_s16(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t { unsafe { let d: int16x4_t = simd_shuffle!(b, b, [4, 5, 6, 7]); @@ -81,7 +81,7 @@ pub fn vabal_high_s16(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(sabal))] +#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(sabal2))] pub fn vabal_high_s32(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t { unsafe { let d: int32x2_t = simd_shuffle!(b, b, [2, 3]); @@ -96,7 +96,7 @@ pub fn vabal_high_s32(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(uabal))] +#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(uabal2))] pub fn vabal_high_u8(a: uint16x8_t, b: uint8x16_t, c: uint8x16_t) -> uint16x8_t { unsafe { let d: uint8x8_t = simd_shuffle!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]); @@ -110,7 +110,7 @@ pub fn vabal_high_u8(a: uint16x8_t, b: uint8x16_t, c: uint8x16_t) -> uint16x8_t #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(uabal))] +#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(uabal2))] pub fn vabal_high_u16(a: uint32x4_t, b: uint16x8_t, c: uint16x8_t) -> uint32x4_t { unsafe { let d: uint16x4_t = simd_shuffle!(b, b, [4, 5, 6, 7]); @@ -124,7 +124,7 @@ pub fn vabal_high_u16(a: uint32x4_t, b: uint16x8_t, c: uint16x8_t) -> uint32x4_t #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(uabal))] +#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(uabal2))] pub fn vabal_high_u32(a: uint64x2_t, b: uint32x4_t, c: uint32x4_t) -> uint64x2_t { unsafe { let d: uint32x2_t = simd_shuffle!(b, b, [2, 3]); @@ -197,7 +197,7 @@ pub fn vabdh_f16(a: f16, b: f16) -> f16 { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(sabdl))] +#[cfg_attr(test, assert_instr(sabdl2))] pub fn vabdl_high_s16(a: int16x8_t, b: int16x8_t) -> int32x4_t { unsafe { let c: int16x4_t = simd_shuffle!(a, a, [4, 5, 6, 7]); @@ -211,7 +211,7 @@ pub fn vabdl_high_s16(a: int16x8_t, b: int16x8_t) -> int32x4_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(sabdl))] +#[cfg_attr(test, assert_instr(sabdl2))] pub fn vabdl_high_s32(a: int32x4_t, b: int32x4_t) -> int64x2_t { unsafe { let c: int32x2_t = simd_shuffle!(a, a, [2, 3]); @@ -225,7 +225,7 @@ pub fn vabdl_high_s32(a: int32x4_t, b: int32x4_t) -> int64x2_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(sabdl))] +#[cfg_attr(test, assert_instr(sabdl2))] pub fn vabdl_high_s8(a: int8x16_t, b: int8x16_t) -> int16x8_t { unsafe { let c: int8x8_t = simd_shuffle!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]); @@ -238,7 +238,7 @@ pub fn vabdl_high_s8(a: int8x16_t, b: int8x16_t) -> int16x8_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabdl_high_u8)"] #[inline] #[target_feature(enable = "neon")] -#[cfg_attr(test, assert_instr(uabdl))] +#[cfg_attr(test, assert_instr(uabdl2))] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub fn vabdl_high_u8(a: uint8x16_t, b: uint8x16_t) -> uint16x8_t { unsafe { @@ -251,7 +251,7 @@ pub fn vabdl_high_u8(a: uint8x16_t, b: uint8x16_t) -> uint16x8_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabdl_high_u16)"] #[inline] #[target_feature(enable = "neon")] -#[cfg_attr(test, assert_instr(uabdl))] +#[cfg_attr(test, assert_instr(uabdl2))] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub fn vabdl_high_u16(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t { unsafe { @@ -264,7 +264,7 @@ pub fn vabdl_high_u16(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vabdl_high_u32)"] #[inline] #[target_feature(enable = "neon")] -#[cfg_attr(test, assert_instr(uabdl))] +#[cfg_attr(test, assert_instr(uabdl2))] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub fn vabdl_high_u32(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t { unsafe { @@ -7177,7 +7177,7 @@ pub fn vcvt_high_f32_f16(a: float16x8_t) -> float32x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcvt_high_f32_f64)"] #[inline] #[target_feature(enable = "neon")] -#[cfg_attr(test, assert_instr(fcvtn))] +#[cfg_attr(test, assert_instr(fcvtn2))] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub fn vcvt_high_f32_f64(a: float32x2_t, b: float64x2_t) -> float32x4_t { unsafe { simd_shuffle!(a, simd_cast(b), [0, 1, 2, 3]) } @@ -7186,7 +7186,7 @@ pub fn vcvt_high_f32_f64(a: float32x2_t, b: float64x2_t) -> float32x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcvt_high_f64_f32)"] #[inline] #[target_feature(enable = "neon")] -#[cfg_attr(test, assert_instr(fcvtl))] +#[cfg_attr(test, assert_instr(fcvtl2))] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub fn vcvt_high_f64_f32(a: float32x4_t) -> float64x2_t { unsafe { @@ -9286,7 +9286,7 @@ pub fn vcvtx_f32_f64(a: float64x2_t) -> float32x2_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcvtx_high_f32_f64)"] #[inline] #[target_feature(enable = "neon")] -#[cfg_attr(test, assert_instr(fcvtxn))] +#[cfg_attr(test, assert_instr(fcvtxn2))] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub fn vcvtx_high_f32_f64(a: float32x2_t, b: float64x2_t) -> float32x4_t { unsafe { simd_shuffle!(a, vcvtx_f32_f64(b), [0, 1, 2, 3]) } @@ -14893,7 +14893,7 @@ pub fn vmull_high_n_u32(a: uint32x4_t, b: u32) -> uint64x2_t { #[inline] #[target_feature(enable = "neon,aes")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(pmull))] +#[cfg_attr(test, assert_instr(pmull2))] pub fn vmull_high_p64(a: poly64x2_t, b: poly64x2_t) -> p128 { unsafe { vmull_p64(simd_extract!(a, 1), simd_extract!(b, 1)) } } @@ -14902,7 +14902,7 @@ pub fn vmull_high_p64(a: poly64x2_t, b: poly64x2_t) -> p128 { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(pmull))] +#[cfg_attr(test, assert_instr(pmull2))] pub fn vmull_high_p8(a: poly8x16_t, b: poly8x16_t) -> poly16x8_t { unsafe { let a: poly8x8_t = simd_shuffle!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]); @@ -26497,7 +26497,7 @@ pub fn vsubh_f16(a: f16, b: f16) -> f16 { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(ssubl))] +#[cfg_attr(test, assert_instr(ssubl2))] pub fn vsubl_high_s8(a: int8x16_t, b: int8x16_t) -> int16x8_t { unsafe { let c: int8x8_t = simd_shuffle!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]); @@ -26512,7 +26512,7 @@ pub fn vsubl_high_s8(a: int8x16_t, b: int8x16_t) -> int16x8_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(ssubl))] +#[cfg_attr(test, assert_instr(ssubl2))] pub fn vsubl_high_s16(a: int16x8_t, b: int16x8_t) -> int32x4_t { unsafe { let c: int16x4_t = simd_shuffle!(a, a, [4, 5, 6, 7]); @@ -26527,7 +26527,7 @@ pub fn vsubl_high_s16(a: int16x8_t, b: int16x8_t) -> int32x4_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(ssubl))] +#[cfg_attr(test, assert_instr(ssubl2))] pub fn vsubl_high_s32(a: int32x4_t, b: int32x4_t) -> int64x2_t { unsafe { let c: int32x2_t = simd_shuffle!(a, a, [2, 3]); @@ -26542,7 +26542,7 @@ pub fn vsubl_high_s32(a: int32x4_t, b: int32x4_t) -> int64x2_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(usubl))] +#[cfg_attr(test, assert_instr(usubl2))] pub fn vsubl_high_u8(a: uint8x16_t, b: uint8x16_t) -> uint16x8_t { unsafe { let c: uint8x8_t = simd_shuffle!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]); @@ -26557,7 +26557,7 @@ pub fn vsubl_high_u8(a: uint8x16_t, b: uint8x16_t) -> uint16x8_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(usubl))] +#[cfg_attr(test, assert_instr(usubl2))] pub fn vsubl_high_u16(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t { unsafe { let c: uint16x4_t = simd_shuffle!(a, a, [4, 5, 6, 7]); @@ -26572,7 +26572,7 @@ pub fn vsubl_high_u16(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(usubl))] +#[cfg_attr(test, assert_instr(usubl2))] pub fn vsubl_high_u32(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t { unsafe { let c: uint32x2_t = simd_shuffle!(a, a, [2, 3]); @@ -26587,7 +26587,7 @@ pub fn vsubl_high_u32(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(ssubw))] +#[cfg_attr(test, assert_instr(ssubw2))] pub fn vsubw_high_s8(a: int16x8_t, b: int8x16_t) -> int16x8_t { unsafe { let c: int8x8_t = simd_shuffle!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]); @@ -26599,7 +26599,7 @@ pub fn vsubw_high_s8(a: int16x8_t, b: int8x16_t) -> int16x8_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(ssubw))] +#[cfg_attr(test, assert_instr(ssubw2))] pub fn vsubw_high_s16(a: int32x4_t, b: int16x8_t) -> int32x4_t { unsafe { let c: int16x4_t = simd_shuffle!(b, b, [4, 5, 6, 7]); @@ -26611,7 +26611,7 @@ pub fn vsubw_high_s16(a: int32x4_t, b: int16x8_t) -> int32x4_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(ssubw))] +#[cfg_attr(test, assert_instr(ssubw2))] pub fn vsubw_high_s32(a: int64x2_t, b: int32x4_t) -> int64x2_t { unsafe { let c: int32x2_t = simd_shuffle!(b, b, [2, 3]); @@ -26623,7 +26623,7 @@ pub fn vsubw_high_s32(a: int64x2_t, b: int32x4_t) -> int64x2_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(usubw))] +#[cfg_attr(test, assert_instr(usubw2))] pub fn vsubw_high_u8(a: uint16x8_t, b: uint8x16_t) -> uint16x8_t { unsafe { let c: uint8x8_t = simd_shuffle!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]); @@ -26635,7 +26635,7 @@ pub fn vsubw_high_u8(a: uint16x8_t, b: uint8x16_t) -> uint16x8_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(usubw))] +#[cfg_attr(test, assert_instr(usubw2))] pub fn vsubw_high_u16(a: uint32x4_t, b: uint16x8_t) -> uint32x4_t { unsafe { let c: uint16x4_t = simd_shuffle!(b, b, [4, 5, 6, 7]); @@ -26647,7 +26647,7 @@ pub fn vsubw_high_u16(a: uint32x4_t, b: uint16x8_t) -> uint32x4_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(usubw))] +#[cfg_attr(test, assert_instr(usubw2))] pub fn vsubw_high_u32(a: uint64x2_t, b: uint32x4_t) -> uint64x2_t { unsafe { let c: uint32x2_t = simd_shuffle!(b, b, [2, 3]); diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml index b20c1b3c36bb..a31613e6b1ae 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml @@ -187,7 +187,7 @@ intrinsics: arguments: ["a: {neon_type[0]}", "b: {neon_type[0]}"] return_type: "{neon_type[1]}" attr: [*neon-stable] - assert_instr: [sabdl] + assert_instr: [sabdl2] safety: safe types: - [int8x16_t, int16x8_t, int8x8_t, uint8x8_t] @@ -230,7 +230,7 @@ intrinsics: - stable - - 'feature = "neon_intrinsics"' - 'since = "1.59.0"' - assert_instr: [sabdl] + assert_instr: [sabdl2] safety: safe types: - [int16x8_t, int32x4_t, int16x4_t, uint16x4_t] @@ -273,7 +273,7 @@ intrinsics: - stable - - 'feature = "neon_intrinsics"' - 'since = "1.59.0"' - assert_instr: [sabdl] + assert_instr: [sabdl2] safety: safe types: - [int32x4_t, int64x2_t, int32x2_t, uint32x2_t] @@ -1462,7 +1462,7 @@ intrinsics: arguments: ["a: {neon_type[0]}"] return_type: "{neon_type[1]}" attr: - - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtl]]}]] + - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtl2]]}]] - FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']] safety: safe types: @@ -1530,7 +1530,7 @@ intrinsics: arguments: ["a: {neon_type[0]}", "b: {neon_type[1]}"] return_type: "{neon_type[2]}" attr: - - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtn]]}]] + - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtn2]]}]] - FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']] safety: safe types: @@ -1582,7 +1582,7 @@ intrinsics: arguments: ["a: {type[0]}", "b: {neon_type[1]}"] return_type: "{type[2]}" attr: - - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtxn]]}]] + - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtxn2]]}]] - FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']] safety: safe types: @@ -5147,7 +5147,7 @@ intrinsics: attr: - *neon-stable safety: safe - assert_instr: [pmull] + assert_instr: [pmull2] types: - [poly8x16_t, poly8x8_t, '[8, 9, 10, 11, 12, 13, 14, 15]', poly16x8_t] compose: @@ -5169,7 +5169,7 @@ intrinsics: - *neon-aes - *neon-stable safety: safe - assert_instr: [pmull] + assert_instr: [pmull2] types: - [poly64x2_t, "p128"] compose: @@ -5741,7 +5741,7 @@ intrinsics: arguments: ["a: {neon_type[0]}", "b: {neon_type[1]}"] return_type: "{neon_type[0]}" attr: [*neon-stable] - assert_instr: [ssubw] + assert_instr: [ssubw2] safety: safe types: - [int16x8_t, int8x16_t, int8x8_t, '[8, 9, 10, 11, 12, 13, 14, 15]'] @@ -5762,7 +5762,7 @@ intrinsics: arguments: ["a: {neon_type[0]}", "b: {neon_type[1]}"] return_type: "{neon_type[0]}" attr: [*neon-stable] - assert_instr: [usubw] + assert_instr: [usubw2] safety: safe types: - [uint16x8_t, uint8x16_t, uint8x8_t, '[8, 9, 10, 11, 12, 13, 14, 15]'] @@ -5783,7 +5783,7 @@ intrinsics: arguments: ["a: {neon_type[0]}", "b: {neon_type[0]}"] return_type: "{neon_type[1]}" attr: [*neon-stable] - assert_instr: [ssubl] + assert_instr: [ssubl2] safety: safe types: - [int8x16_t, int16x8_t, '[8, 9, 10, 11, 12, 13, 14, 15]', int8x8_t] @@ -5813,7 +5813,7 @@ intrinsics: arguments: ["a: {neon_type[0]}", "b: {neon_type[0]}"] return_type: "{neon_type[1]}" attr: [*neon-stable] - assert_instr: [usubl] + assert_instr: [usubl2] safety: safe types: - [uint8x16_t, uint16x8_t, '[8, 9, 10, 11, 12, 13, 14, 15]', uint8x8_t] @@ -9909,7 +9909,7 @@ intrinsics: return_type: "{neon_type[0]}" attr: - FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']] - - FnCall: [cfg_attr, [{FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]]}, {FnCall: [assert_instr, [uabal]]}]] + - FnCall: [cfg_attr, [{FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]]}, {FnCall: [assert_instr, [uabal2]]}]] safety: safe types: - [uint16x8_t, uint8x16_t, uint8x8_t, '[8, 9, 10, 11, 12, 13, 14, 15]', '[8, 9, 10, 11, 12, 13, 14, 15]'] @@ -9936,7 +9936,7 @@ intrinsics: return_type: "{neon_type[0]}" attr: - *neon-stable - - FnCall: [cfg_attr, [{FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]]}, {FnCall: [assert_instr, [sabal]]}]] + - FnCall: [cfg_attr, [{FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]]}, {FnCall: [assert_instr, [sabal2]]}]] safety: safe types: - [int16x8_t, int8x16_t, int8x16_t, '[8, 9, 10, 11, 12, 13, 14, 15]', int8x8_t, uint8x8_t] @@ -11345,7 +11345,7 @@ intrinsics: arguments: ["a: {neon_type[0]}", "b: {neon_type[0]}"] return_type: "{neon_type[1]}" attr: - - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [uabdl]]}]] + - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [uabdl2]]}]] - FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']] safety: safe types: From 5438a7c110127ec66002d6a15d168858a20a802c Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 17:10:46 +0200 Subject: [PATCH 049/183] `stdarch-test`: for now, allow if only part of an instruction matched --- library/stdarch/crates/stdarch-test/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/stdarch/crates/stdarch-test/src/lib.rs b/library/stdarch/crates/stdarch-test/src/lib.rs index 317b46410596..ecaf95f61766 100644 --- a/library/stdarch/crates/stdarch-test/src/lib.rs +++ b/library/stdarch/crates/stdarch-test/src/lib.rs @@ -94,10 +94,12 @@ pub fn assert(shim_addr: usize, fnname: &str, expected: &str) { // Check whether the given instruction is part of the disassemblied body. let found = expected == "nop" || instrs.iter().any(|instruction| { - // Check that the next character is non-alphabetic. This prevents false negatives - // when e.g. `fminnm` was used but `fmin` was expected. instruction.starts_with(expected) - && !instruction[expected.len()..].starts_with(|c: char| c.is_ascii_alphabetic()) + // Check that the next character is non-alphanumeric. This prevents false negatives + // when e.g. `fminnm` was used but `fmin` was expected. + // + // TODO: resolve the conflicts (x86_64 and aarch64 have a bunch, probably others) + // && !instruction[expected.len()..].starts_with(|c: char| c.is_ascii_alphanumeric()) }); // Look for subroutine call instructions in the disassembly to detect whether From 5946616c064330cb7418930dd20f317e5a4d5339 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Thu, 17 Jul 2025 04:59:14 +0000 Subject: [PATCH 050/183] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 67f27e7aa2c7..3f10132b684b 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -7f2065a4bae1faed5bab928c670964eafbf43b55 +fd2eb391d032181459773f3498c17b198513e0d0 From 5157aa1a0f4d9a7a5f90bff59a7f9f7ca39ca1e9 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 17 Jul 2025 03:58:43 -0500 Subject: [PATCH 051/183] Allow a new lint failure in nightly ```text warning: function `f32_to_bits` is never used --> libm/src/math/support/float_traits.rs:367:14 | 367 | pub const fn f32_to_bits(x: f32) -> u32 { | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: function `f64_to_bits` is never used --> libm/src/math/support/float_traits.rs:381:14 | 381 | pub const fn f64_to_bits(x: f64) -> u64 { | ^^^^^^^^^^^ warning: `libm` (lib) generated 2 warnings ``` This is a false positive, see RUST-144060. --- library/compiler-builtins/libm/src/math/support/float_traits.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/compiler-builtins/libm/src/math/support/float_traits.rs b/library/compiler-builtins/libm/src/math/support/float_traits.rs index c3e7eeec245c..fb790e696159 100644 --- a/library/compiler-builtins/libm/src/math/support/float_traits.rs +++ b/library/compiler-builtins/libm/src/math/support/float_traits.rs @@ -363,6 +363,7 @@ pub const fn f32_from_bits(bits: u32) -> f32 { } /// `f32::to_bits` +#[allow(dead_code)] // workaround for false positive RUST-144060 #[allow(unnecessary_transmutes)] // lint appears in newer versions of Rust pub const fn f32_to_bits(x: f32) -> u32 { // SAFETY: POD cast with no preconditions @@ -377,6 +378,7 @@ pub const fn f64_from_bits(bits: u64) -> f64 { } /// `f64::to_bits` +#[allow(dead_code)] // workaround for false positive RUST-144060 #[allow(unnecessary_transmutes)] // lint appears in newer versions of Rust pub const fn f64_to_bits(x: f64) -> u64 { // SAFETY: POD cast with no preconditions From 387b6037c5522d2ceee41358e0d91cd9222e19d8 Mon Sep 17 00:00:00 2001 From: Nia Espera Date: Wed, 16 Jul 2025 04:38:26 +0200 Subject: [PATCH 052/183] allow using different cargo binary --- src/tools/miri/CONTRIBUTING.md | 1 + src/tools/miri/miri | 3 ++- src/tools/miri/miri-script/src/util.rs | 15 ++++++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/tools/miri/CONTRIBUTING.md b/src/tools/miri/CONTRIBUTING.md index e4302b734aa5..aff5fbcae944 100644 --- a/src/tools/miri/CONTRIBUTING.md +++ b/src/tools/miri/CONTRIBUTING.md @@ -348,6 +348,7 @@ https. Add the following to your `.gitconfig`: The following environment variables are relevant to `./miri`: +* `CARGO` sets the binary used to execute Cargo; if none is specified, defaults to `cargo`. * `MIRI_AUTO_OPS` indicates whether the automatic execution of rustfmt, clippy and toolchain setup (as controlled by the `./auto-*` files) should be skipped. If it is set to `no`, they are skipped. This is used to allow automated IDE actions to avoid the auto ops. diff --git a/src/tools/miri/miri b/src/tools/miri/miri index 549998ae44a3..a5f2bb1550af 100755 --- a/src/tools/miri/miri +++ b/src/tools/miri/miri @@ -15,8 +15,9 @@ if [ -n "$MIRI_IN_RA" ]; then CARGO_FLAGS+=("--message-format=json" "-Zroot-dir=$ROOT_DIR") TARGET_DIR="$ROOT_DIR"/target fi + # Run cargo. -cargo $TOOLCHAIN build --manifest-path "$ROOT_DIR"/miri-script/Cargo.toml \ +${CARGO:-cargo} $TOOLCHAIN build --manifest-path "$ROOT_DIR"/miri-script/Cargo.toml \ --target-dir "$TARGET_DIR" "${CARGO_FLAGS[@]}" || \ ( echo "Failed to build miri-script. Is the 'stable' toolchain installed?"; exit 1 ) # Instead of doing just `cargo run --manifest-path .. $@`, we invoke miri-script binary directly. diff --git a/src/tools/miri/miri-script/src/util.rs b/src/tools/miri/miri-script/src/util.rs index c100cf195ba4..6121096f8230 100644 --- a/src/tools/miri/miri-script/src/util.rs +++ b/src/tools/miri/miri-script/src/util.rs @@ -38,6 +38,8 @@ pub struct MiriEnv { pub miri_dir: PathBuf, /// active_toolchain is passed as `+toolchain` argument to cargo/rustc invocations. toolchain: String, + /// The cargo binary to use. + cargo_bin: String, /// Extra flags to pass to cargo. cargo_extra_flags: Vec, /// The rustc sysroot @@ -106,6 +108,9 @@ impl MiriEnv { sh.set_var("PATH", new_path); } + // Get the cargo binary to use, if one is set. + let cargo_bin = std::env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); + // Get extra flags for cargo. let cargo_extra_flags = std::env::var("CARGO_EXTRA_FLAGS").unwrap_or_default(); let mut cargo_extra_flags = flagsplit(&cargo_extra_flags); @@ -119,7 +124,7 @@ impl MiriEnv { // Also set `-Zroot-dir` for cargo, to print diagnostics relative to the miri dir. cargo_extra_flags.push(format!("-Zroot-dir={}", miri_dir.display())); - Ok(MiriEnv { miri_dir, toolchain, sh, sysroot, cargo_extra_flags, libdir }) + Ok(MiriEnv { miri_dir, toolchain, sh, sysroot, cargo_bin, cargo_extra_flags, libdir }) } /// Make sure the `features` you pass here exist for the specified `crate_dir`. For example, the @@ -130,12 +135,12 @@ impl MiriEnv { cmd: &str, features: &[String], ) -> Cmd<'_> { - let MiriEnv { toolchain, cargo_extra_flags, .. } = self; + let MiriEnv { toolchain, cargo_extra_flags, cargo_bin, .. } = self; let manifest_path = path!(self.miri_dir / crate_dir.as_ref() / "Cargo.toml"); let features = features_to_args(features); cmd!( self.sh, - "cargo +{toolchain} {cmd} {cargo_extra_flags...} --manifest-path {manifest_path} {features...}" + "{cargo_bin} +{toolchain} {cmd} {cargo_extra_flags...} --manifest-path {manifest_path} {features...}" ) } @@ -147,12 +152,12 @@ impl MiriEnv { features: &[String], args: impl IntoIterator>, ) -> Result<()> { - let MiriEnv { sysroot, toolchain, cargo_extra_flags, .. } = self; + let MiriEnv { sysroot, toolchain, cargo_extra_flags, cargo_bin, .. } = self; let path = path!(self.miri_dir / crate_dir.as_ref()); let features = features_to_args(features); // Install binaries to the miri toolchain's `sysroot` so they do not interact with other toolchains. // (Not using `cargo_cmd` as `install` is special and doesn't use `--manifest-path`.) - cmd!(self.sh, "cargo +{toolchain} install {cargo_extra_flags...} --path {path} --force --root {sysroot} {features...} {args...}").run()?; + cmd!(self.sh, "{cargo_bin} +{toolchain} install {cargo_extra_flags...} --path {path} --force --root {sysroot} {features...} {args...}").run()?; Ok(()) } From 1205c539463c939cfb684b8acbf85ee700dd24b0 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 17 Jul 2025 11:32:43 +0200 Subject: [PATCH 053/183] tweak PR process description --- src/tools/miri/CONTRIBUTING.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tools/miri/CONTRIBUTING.md b/src/tools/miri/CONTRIBUTING.md index e4302b734aa5..bef3ffe7e952 100644 --- a/src/tools/miri/CONTRIBUTING.md +++ b/src/tools/miri/CONTRIBUTING.md @@ -19,10 +19,14 @@ When you get a review, please take care of the requested changes in new commits. existing commits. Generally avoid force-pushing. The only time you should force push is when there is a conflict with the master branch (in that case you should rebase across master, not merge), and all the way at the end of the review process when the reviewer tells you that the PR is done and you -should squash the commits. If you are unsure how to use `git rebase` to squash commits, use `./miri -squash` which automates the process but leaves little room for customization. (All this is to work -around the fact that Github is quite bad at dealing with force pushes and does not support `git -range-diff`. Maybe one day Github will be good at git and then life can become easier.) +should squash the commits. (All this is to work around the fact that Github is quite bad at +dealing with force pushes and does not support `git range-diff`.) + +The recommended way to squash commits is to use `./miri squash`, which will make everything into a +single commit. You will be asked for the commit message; please ensure it describes the entire PR. +You can also use `git rebase` manually if you need more control (e.g. if there should be more than +one commit at the end), but then please use `--keep-base` to ensure the PR remains based on the same +upstream commit. Most PRs bounce back and forth between the reviewer and the author several times, so it is good to keep track of who is expected to take the next step. We are using the `S-waiting-for-review` and From d963c78140a9636810e7ffd0c50022b23be902cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 17 Jul 2025 12:30:52 +0200 Subject: [PATCH 054/183] Update the `no-merges` PR title Match the new CI-created PRs: https://github.com/rust-lang/compiler-builtins/pull/974. --- library/compiler-builtins/triagebot.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/compiler-builtins/triagebot.toml b/library/compiler-builtins/triagebot.toml index 715be27fc65c..8a2356c2b1c0 100644 --- a/library/compiler-builtins/triagebot.toml +++ b/library/compiler-builtins/triagebot.toml @@ -4,7 +4,7 @@ # Warns when a PR contains merge commits # Documentation at: https://forge.rust-lang.org/triagebot/no-merge.html [no-merges] -exclude_titles = ["Update from"] +exclude_titles = ["Rustc pull update"] # Canonicalize issue numbers to avoid closing the wrong issue # when commits are included in subtrees, as well as warning links in commits. From b57ff35641496006a13cc709923e4e59a0e93054 Mon Sep 17 00:00:00 2001 From: WANG Rui Date: Sat, 28 Jun 2025 12:13:15 +0800 Subject: [PATCH 055/183] loongarch: Mark partial basic intrinsics as safe --- .../crates/core_arch/src/loongarch64/mod.rs | 15 ++-- .../core_arch/src/loongarch_shared/mod.rs | 70 +++++++++---------- 2 files changed, 41 insertions(+), 44 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/loongarch64/mod.rs b/library/stdarch/crates/core_arch/src/loongarch64/mod.rs index 3f1bfbcd0e1e..e8249805eae2 100644 --- a/library/stdarch/crates/core_arch/src/loongarch64/mod.rs +++ b/library/stdarch/crates/core_arch/src/loongarch64/mod.rs @@ -13,10 +13,9 @@ use crate::arch::asm; /// Reads the 64-bit stable counter value and the counter ID #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn rdtime_d() -> (i64, isize) { - let val: i64; - let tid: isize; - asm!("rdtime.d {}, {}", out(reg) val, out(reg) tid, options(readonly, nostack)); +pub fn rdtime_d() -> (i64, isize) { + let (val, tid): (i64, isize); + unsafe { asm!("rdtime.d {}, {}", out(reg) val, out(reg) tid, options(readonly, nostack)) }; (val, tid) } @@ -51,15 +50,15 @@ unsafe extern "unadjusted" { /// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crc_w_d_w(a: i64, b: i32) -> i32 { - __crc_w_d_w(a, b) +pub fn crc_w_d_w(a: i64, b: i32) -> i32 { + unsafe { __crc_w_d_w(a, b) } } /// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crcc_w_d_w(a: i64, b: i32) -> i32 { - __crcc_w_d_w(a, b) +pub fn crcc_w_d_w(a: i64, b: i32) -> i32 { + unsafe { __crcc_w_d_w(a, b) } } /// Generates the cache operation instruction diff --git a/library/stdarch/crates/core_arch/src/loongarch_shared/mod.rs b/library/stdarch/crates/core_arch/src/loongarch_shared/mod.rs index da716ffd279e..710b926f8df4 100644 --- a/library/stdarch/crates/core_arch/src/loongarch_shared/mod.rs +++ b/library/stdarch/crates/core_arch/src/loongarch_shared/mod.rs @@ -5,20 +5,18 @@ use crate::arch::asm; /// Reads the lower 32-bit stable counter value and the counter ID #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn rdtimel_w() -> (i32, isize) { - let val: i32; - let tid: isize; - asm!("rdtimel.w {}, {}", out(reg) val, out(reg) tid, options(readonly, nostack)); +pub fn rdtimel_w() -> (i32, isize) { + let (val, tid): (i32, isize); + unsafe { asm!("rdtimel.w {}, {}", out(reg) val, out(reg) tid, options(readonly, nostack)) }; (val, tid) } /// Reads the upper 32-bit stable counter value and the counter ID #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn rdtimeh_w() -> (i32, isize) { - let val: i32; - let tid: isize; - asm!("rdtimeh.w {}, {}", out(reg) val, out(reg) tid, options(readonly, nostack)); +pub fn rdtimeh_w() -> (i32, isize) { + let (val, tid): (i32, isize); + unsafe { asm!("rdtimeh.w {}, {}", out(reg) val, out(reg) tid, options(readonly, nostack)) }; (val, tid) } @@ -75,59 +73,59 @@ unsafe extern "unadjusted" { /// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crc_w_b_w(a: i32, b: i32) -> i32 { - __crc_w_b_w(a, b) +pub fn crc_w_b_w(a: i32, b: i32) -> i32 { + unsafe { __crc_w_b_w(a, b) } } /// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crc_w_h_w(a: i32, b: i32) -> i32 { - __crc_w_h_w(a, b) +pub fn crc_w_h_w(a: i32, b: i32) -> i32 { + unsafe { __crc_w_h_w(a, b) } } /// Calculate the CRC value using the IEEE 802.3 polynomial (0xEDB88320) #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crc_w_w_w(a: i32, b: i32) -> i32 { - __crc_w_w_w(a, b) +pub fn crc_w_w_w(a: i32, b: i32) -> i32 { + unsafe { __crc_w_w_w(a, b) } } /// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crcc_w_b_w(a: i32, b: i32) -> i32 { - __crcc_w_b_w(a, b) +pub fn crcc_w_b_w(a: i32, b: i32) -> i32 { + unsafe { __crcc_w_b_w(a, b) } } /// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crcc_w_h_w(a: i32, b: i32) -> i32 { - __crcc_w_h_w(a, b) +pub fn crcc_w_h_w(a: i32, b: i32) -> i32 { + unsafe { __crcc_w_h_w(a, b) } } /// Calculate the CRC value using the Castagnoli polynomial (0x82F63B78) #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn crcc_w_w_w(a: i32, b: i32) -> i32 { - __crcc_w_w_w(a, b) +pub fn crcc_w_w_w(a: i32, b: i32) -> i32 { + unsafe { __crcc_w_w_w(a, b) } } /// Generates the memory barrier instruction #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn dbar() { +pub fn dbar() { static_assert_uimm_bits!(IMM15, 15); - __dbar(IMM15); + unsafe { __dbar(IMM15) }; } /// Generates the instruction-fetch barrier instruction #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn ibar() { +pub fn ibar() { static_assert_uimm_bits!(IMM15, 15); - __ibar(IMM15); + unsafe { __ibar(IMM15) }; } /// Moves data from a GPR to the FCSR @@ -141,9 +139,9 @@ pub unsafe fn movgr2fcsr(a: i32) { /// Moves data from a FCSR to the GPR #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn movfcsr2gr() -> i32 { +pub fn movfcsr2gr() -> i32 { static_assert_uimm_bits!(IMM5, 5); - __movfcsr2gr(IMM5) + unsafe { __movfcsr2gr(IMM5) } } /// Reads the 8-bit IO-CSR @@ -199,8 +197,8 @@ pub unsafe fn brk() { /// Reads the CPU configuration register #[inline] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn cpucfg(a: i32) -> i32 { - __cpucfg(a) +pub fn cpucfg(a: i32) -> i32 { + unsafe { __cpucfg(a) } } /// Generates the syscall instruction @@ -215,30 +213,30 @@ pub unsafe fn syscall() { #[inline] #[target_feature(enable = "frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn frecipe_s(a: f32) -> f32 { - __frecipe_s(a) +pub fn frecipe_s(a: f32) -> f32 { + unsafe { __frecipe_s(a) } } /// Calculate the approximate double-precision result of 1.0 divided #[inline] #[target_feature(enable = "frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn frecipe_d(a: f64) -> f64 { - __frecipe_d(a) +pub fn frecipe_d(a: f64) -> f64 { + unsafe { __frecipe_d(a) } } /// Calculate the approximate single-precision result of dividing 1.0 by the square root #[inline] #[target_feature(enable = "frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn frsqrte_s(a: f32) -> f32 { - __frsqrte_s(a) +pub fn frsqrte_s(a: f32) -> f32 { + unsafe { __frsqrte_s(a) } } /// Calculate the approximate double-precision result of dividing 1.0 by the square root #[inline] #[target_feature(enable = "frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn frsqrte_d(a: f64) -> f64 { - __frsqrte_d(a) +pub fn frsqrte_d(a: f64) -> f64 { + unsafe { __frsqrte_d(a) } } From 60f6ad81a12600ec7a584bd004a81611928875f3 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Fri, 18 Jul 2025 05:00:24 +0000 Subject: [PATCH 056/183] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 3f10132b684b..f9457b3e447d 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -fd2eb391d032181459773f3498c17b198513e0d0 +e4662966273ed58b51f9ff8d682accc202aa1210 From 24ea3e22d3e2e02ccf055a45cac3550457a7ae3d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 18 Jul 2025 09:40:58 +0200 Subject: [PATCH 057/183] make native-lib support compile-time-optional, and centralize cfg usage --- src/tools/miri/Cargo.toml | 15 ++++++------ src/tools/miri/src/alloc/alloc_bytes.rs | 9 ++------ src/tools/miri/src/alloc/mod.rs | 28 ++++++++++++++++++++++- src/tools/miri/src/bin/miri.rs | 7 +++--- src/tools/miri/src/lib.rs | 2 +- src/tools/miri/src/machine.rs | 20 +++++----------- src/tools/miri/src/shims/foreign_items.rs | 2 +- src/tools/miri/src/shims/mod.rs | 4 ++-- src/tools/miri/tests/ui.rs | 2 +- 9 files changed, 52 insertions(+), 37 deletions(-) diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index 75476d7923c7..0aff34e9fbe6 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -38,14 +38,14 @@ features = ['unprefixed_malloc_on_supported_platforms'] [target.'cfg(unix)'.dependencies] libc = "0.2" -libffi = "4.0.0" -libloading = "0.8" +libffi = { version = "4.0.0", optional = true } +libloading = { version = "0.8", optional = true } +nix = { version = "0.30.1", features = ["mman", "ptrace", "signal"], optional = true } [target.'cfg(target_os = "linux")'.dependencies] -nix = { version = "0.30.1", features = ["mman", "ptrace", "signal"] } -ipc-channel = "0.19.0" -serde = { version = "1.0.219", features = ["derive"] } -capstone = "0.13" +ipc-channel = { version = "0.19.0", optional = true } +serde = { version = "1.0.219", features = ["derive"], optional = true } +capstone = { version = "0.13", optional = true } [dev-dependencies] ui_test = "0.29.1" @@ -64,11 +64,12 @@ name = "ui" harness = false [features] -default = ["stack-cache"] +default = ["stack-cache", "native-lib"] genmc = [] stack-cache = [] stack-cache-consistency-check = ["stack-cache"] tracing = ["serde_json"] +native-lib = ["dep:libffi", "dep:libloading", "dep:capstone", "dep:ipc-channel", "dep:nix", "dep:serde"] [lints.rust.unexpected_cfgs] level = "warn" diff --git a/src/tools/miri/src/alloc/alloc_bytes.rs b/src/tools/miri/src/alloc/alloc_bytes.rs index 2a253952b27a..5d00d3eafcb5 100644 --- a/src/tools/miri/src/alloc/alloc_bytes.rs +++ b/src/tools/miri/src/alloc/alloc_bytes.rs @@ -1,20 +1,18 @@ use std::alloc::Layout; use std::borrow::Cow; +use std::cell::RefCell; +use std::rc::Rc; use std::{alloc, slice}; -#[cfg(target_os = "linux")] -use std::{cell::RefCell, rc::Rc}; use rustc_abi::{Align, Size}; use rustc_middle::mir::interpret::AllocBytes; -#[cfg(target_os = "linux")] use crate::alloc::isolated_alloc::IsolatedAlloc; use crate::helpers::ToU64 as _; #[derive(Clone, Debug)] pub enum MiriAllocParams { Global, - #[cfg(target_os = "linux")] Isolated(Rc>), } @@ -56,7 +54,6 @@ impl Drop for MiriAllocBytes { unsafe { match self.params.clone() { MiriAllocParams::Global => alloc::dealloc(self.ptr, alloc_layout), - #[cfg(target_os = "linux")] MiriAllocParams::Isolated(alloc) => alloc.borrow_mut().dealloc(self.ptr, alloc_layout), } @@ -123,7 +120,6 @@ impl AllocBytes for MiriAllocBytes { let alloc_fn = |layout, params: &MiriAllocParams| unsafe { match params { MiriAllocParams::Global => alloc::alloc(layout), - #[cfg(target_os = "linux")] MiriAllocParams::Isolated(alloc) => alloc.borrow_mut().alloc(layout), } }; @@ -144,7 +140,6 @@ impl AllocBytes for MiriAllocBytes { let alloc_fn = |layout, params: &MiriAllocParams| unsafe { match params { MiriAllocParams::Global => alloc::alloc_zeroed(layout), - #[cfg(target_os = "linux")] MiriAllocParams::Isolated(alloc) => alloc.borrow_mut().alloc_zeroed(layout), } }; diff --git a/src/tools/miri/src/alloc/mod.rs b/src/tools/miri/src/alloc/mod.rs index 3be885920d22..35158f50a8ff 100644 --- a/src/tools/miri/src/alloc/mod.rs +++ b/src/tools/miri/src/alloc/mod.rs @@ -1,5 +1,31 @@ mod alloc_bytes; -#[cfg(target_os = "linux")] +#[cfg(all(unix, feature = "native-lib"))] pub mod isolated_alloc; +#[cfg(not(all(unix, feature = "native-lib")))] +pub mod isolated_alloc { + use std::alloc::Layout; + + /// Stub allocator to avoid `cfg`s in the rest of Miri. + #[derive(Debug)] + pub struct IsolatedAlloc(!); + + impl IsolatedAlloc { + pub fn new() -> Self { + unreachable!() + } + + pub unsafe fn alloc(&mut self, _layout: Layout) -> *mut u8 { + match self.0 {} + } + + pub unsafe fn alloc_zeroed(&mut self, _layout: Layout) -> *mut u8 { + match self.0 {} + } + + pub unsafe fn dealloc(&mut self, _ptr: *mut u8, _layout: Layout) { + match self.0 {} + } + } +} pub use self::alloc_bytes::{MiriAllocBytes, MiriAllocParams}; diff --git a/src/tools/miri/src/bin/miri.rs b/src/tools/miri/src/bin/miri.rs index 61cebedf0810..5d9c05807b89 100644 --- a/src/tools/miri/src/bin/miri.rs +++ b/src/tools/miri/src/bin/miri.rs @@ -335,9 +335,10 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls { fn exit(exit_code: i32) -> ! { // Drop the tracing guard before exiting, so tracing calls are flushed correctly. deinit_loggers(); - // Make sure the supervisor knows about the code code. - #[cfg(target_os = "linux")] + // Make sure the supervisor knows about the exit code. + #[cfg(all(unix, feature = "native-lib"))] miri::native_lib::register_retcode_sv(exit_code); + // Actually exit. std::process::exit(exit_code); } @@ -754,7 +755,7 @@ fn main() { debug!("crate arguments: {:?}", miri_config.args); if !miri_config.native_lib.is_empty() && miri_config.native_lib_enable_tracing { // SAFETY: No other threads are running - #[cfg(target_os = "linux")] + #[cfg(all(unix, feature = "native-lib"))] if unsafe { miri::native_lib::init_sv() }.is_err() { eprintln!( "warning: The native-lib tracer could not be started. Is this an x86 Linux system, and does Miri have permissions to ptrace?\n\ diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index a591d21071db..0f293c0d8f7c 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -97,7 +97,7 @@ pub use rustc_const_eval::interpret::{self, AllocMap, Provenance as _}; use rustc_middle::{bug, span_bug}; use tracing::{info, trace}; -#[cfg(target_os = "linux")] +#[cfg(all(unix, feature = "native-lib"))] pub mod native_lib { pub use crate::shims::{init_sv, register_retcode_sv}; } diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs index 9c077e5b7b6e..bce0063c9ce9 100644 --- a/src/tools/miri/src/machine.rs +++ b/src/tools/miri/src/machine.rs @@ -530,7 +530,6 @@ pub struct MiriMachine<'tcx> { pub(crate) rng: RefCell, /// The allocator used for the machine's `AllocBytes` in native-libs mode. - #[cfg(target_os = "linux")] pub(crate) allocator: Option>>, /// The allocation IDs to report when they are being allocated @@ -554,9 +553,9 @@ pub struct MiriMachine<'tcx> { pub(crate) basic_block_count: u64, /// Handle of the optional shared object file for native functions. - #[cfg(unix)] + #[cfg(all(unix, feature = "native-lib"))] pub native_lib: Vec<(libloading::Library, std::path::PathBuf)>, - #[cfg(not(unix))] + #[cfg(not(all(unix, feature = "native-lib")))] pub native_lib: Vec, /// Run a garbage collector for BorTags every N basic blocks. @@ -603,7 +602,7 @@ pub struct MiriMachine<'tcx> { /// Remembers whether we already warned about an extern type with Stacked Borrows. pub(crate) sb_extern_type_warned: Cell, /// Remember whether we already warned about sharing memory with a native call. - #[cfg(unix)] + #[allow(unused)] pub(crate) native_call_mem_warned: Cell, /// Remembers which shims have already shown the warning about erroring in isolation. pub(crate) reject_in_isolation_warned: RefCell>, @@ -718,7 +717,6 @@ impl<'tcx> MiriMachine<'tcx> { local_crates, extern_statics: FxHashMap::default(), rng: RefCell::new(rng), - #[cfg(target_os = "linux")] allocator: if !config.native_lib.is_empty() { Some(Rc::new(RefCell::new(crate::alloc::isolated_alloc::IsolatedAlloc::new()))) } else { None }, @@ -730,7 +728,7 @@ impl<'tcx> MiriMachine<'tcx> { report_progress: config.report_progress, basic_block_count: 0, monotonic_clock: MonotonicClock::new(config.isolated_op == IsolatedOp::Allow), - #[cfg(unix)] + #[cfg(all(unix, feature = "native-lib"))] native_lib: config.native_lib.iter().map(|lib_file_path| { let host_triple = rustc_session::config::host_tuple(); let target_triple = tcx.sess.opts.target_triple.tuple(); @@ -752,9 +750,9 @@ impl<'tcx> MiriMachine<'tcx> { lib_file_path.clone(), ) }).collect(), - #[cfg(not(unix))] + #[cfg(not(all(unix, feature = "native-lib")))] native_lib: config.native_lib.iter().map(|_| { - panic!("calling functions from native libraries via FFI is only supported on Unix") + panic!("calling functions from native libraries via FFI is not supported in this build of Miri") }).collect(), gc_interval: config.gc_interval, since_gc: 0, @@ -771,7 +769,6 @@ impl<'tcx> MiriMachine<'tcx> { pthread_rwlock_sanity: Cell::new(false), pthread_condvar_sanity: Cell::new(false), sb_extern_type_warned: Cell::new(false), - #[cfg(unix)] native_call_mem_warned: Cell::new(false), reject_in_isolation_warned: Default::default(), int2ptr_warned: Default::default(), @@ -924,7 +921,6 @@ impl VisitProvenance for MiriMachine<'_> { backtrace_style: _, local_crates: _, rng: _, - #[cfg(target_os = "linux")] allocator: _, tracked_alloc_ids: _, track_alloc_accesses: _, @@ -949,7 +945,6 @@ impl VisitProvenance for MiriMachine<'_> { pthread_rwlock_sanity: _, pthread_condvar_sanity: _, sb_extern_type_warned: _, - #[cfg(unix)] native_call_mem_warned: _, reject_in_isolation_warned: _, int2ptr_warned: _, @@ -1817,13 +1812,10 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> { fn get_default_alloc_params(&self) -> ::AllocParams { use crate::alloc::MiriAllocParams; - #[cfg(target_os = "linux")] match &self.allocator { Some(alloc) => MiriAllocParams::Isolated(alloc.clone()), None => MiriAllocParams::Global, } - #[cfg(not(target_os = "linux"))] - MiriAllocParams::Global } fn enter_trace_span(span: impl FnOnce() -> tracing::Span) -> impl EnteredTraceSpan { diff --git a/src/tools/miri/src/shims/foreign_items.rs b/src/tools/miri/src/shims/foreign_items.rs index 9ddba8c2b48d..94cda57658a1 100644 --- a/src/tools/miri/src/shims/foreign_items.rs +++ b/src/tools/miri/src/shims/foreign_items.rs @@ -237,7 +237,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { let this = self.eval_context_mut(); // First deal with any external C functions in linked .so file. - #[cfg(unix)] + #[cfg(all(unix, feature = "native-lib"))] if !this.machine.native_lib.is_empty() { use crate::shims::native_lib::EvalContextExt as _; // An Ok(false) here means that the function being called was not exported diff --git a/src/tools/miri/src/shims/mod.rs b/src/tools/miri/src/shims/mod.rs index 75540f6f1500..2a7709829ee6 100644 --- a/src/tools/miri/src/shims/mod.rs +++ b/src/tools/miri/src/shims/mod.rs @@ -4,7 +4,7 @@ mod aarch64; mod alloc; mod backtrace; mod files; -#[cfg(unix)] +#[cfg(all(unix, feature = "native-lib"))] mod native_lib; mod unix; mod wasi; @@ -23,7 +23,7 @@ pub mod tls; pub mod unwind; pub use self::files::FdTable; -#[cfg(target_os = "linux")] +#[cfg(all(unix, feature = "native-lib"))] pub use self::native_lib::trace::{init_sv, register_retcode_sv}; pub use self::unix::{DirTable, EpollInterestTable}; diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index 43f855d57dd5..e521269586de 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -335,7 +335,7 @@ fn main() -> Result<()> { ui(Mode::Panic, "tests/panic", &target, WithDependencies, tmpdir.path())?; ui(Mode::Fail, "tests/fail", &target, WithoutDependencies, tmpdir.path())?; ui(Mode::Fail, "tests/fail-dep", &target, WithDependencies, tmpdir.path())?; - if cfg!(unix) && target == host { + if cfg!(all(unix, feature = "native-lib")) && target == host { ui(Mode::Pass, "tests/native-lib/pass", &target, WithoutDependencies, tmpdir.path())?; ui(Mode::Fail, "tests/native-lib/fail", &target, WithoutDependencies, tmpdir.path())?; } From cc6bc7af2336923e1f1f0e9620e1ce426e5efe4f Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 18 Jul 2025 10:09:49 +0200 Subject: [PATCH 058/183] RA config: disable default features for faster build script build --- src/tools/miri/etc/rust_analyzer_helix.toml | 1 + src/tools/miri/etc/rust_analyzer_vscode.json | 1 + 2 files changed, 2 insertions(+) diff --git a/src/tools/miri/etc/rust_analyzer_helix.toml b/src/tools/miri/etc/rust_analyzer_helix.toml index 9bfb09120d8a..91e4070478c8 100644 --- a/src/tools/miri/etc/rust_analyzer_helix.toml +++ b/src/tools/miri/etc/rust_analyzer_helix.toml @@ -26,5 +26,6 @@ invocationStrategy = "once" overrideCommand = [ "./miri", "check", + "--no-default-features", "--message-format=json", ] diff --git a/src/tools/miri/etc/rust_analyzer_vscode.json b/src/tools/miri/etc/rust_analyzer_vscode.json index c646953e92b7..6917c6a1fd85 100644 --- a/src/tools/miri/etc/rust_analyzer_vscode.json +++ b/src/tools/miri/etc/rust_analyzer_vscode.json @@ -20,6 +20,7 @@ "rust-analyzer.cargo.buildScripts.overrideCommand": [ "./miri", "check", + "--no-default-features", "--message-format=json", ], } From 194aa89fdd2e627b7842e2f0b7a0db3263613e40 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Wed, 16 Jul 2025 16:50:34 +0200 Subject: [PATCH 059/183] add CI action to check that generated files are correctly checked in --- library/stdarch/.github/workflows/main.yml | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/library/stdarch/.github/workflows/main.yml b/library/stdarch/.github/workflows/main.yml index 8c6dee16fb61..59aad0b5d014 100644 --- a/library/stdarch/.github/workflows/main.yml +++ b/library/stdarch/.github/workflows/main.yml @@ -255,6 +255,28 @@ jobs: env: TARGET: ${{ matrix.target.tuple }} + # Check that the generated files agree with the checked-in versions. + check-stdarch-gen: + needs: [style] + name: Check stdarch-gen-{arm, loongarch} output + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + run: rustup update nightly && rustup default nightly && rustup component add rustfmt + - name: Check arm spec + run: | + cargo run --bin=stdarch-gen-arm --release -- crates/stdarch-gen-arm/spec + git diff --exit-code + - name: Check lsx.spec + run: | + cargo run --bin=stdarch-gen-loongarch --release -- crates/stdarch-gen-loongarch/lsx.spec + git diff --exit-code + - name: Check lasx.spec + run: | + cargo run --bin=stdarch-gen-loongarch --release -- crates/stdarch-gen-loongarch/lasx.spec + git diff --exit-code + build-std-detect: needs: [style] name: Build std_detect @@ -271,6 +293,7 @@ jobs: - verify - test - build-std-detect + - check-stdarch-gen runs-on: ubuntu-latest # We need to ensure this job does *not* get skipped if its dependencies fail, # because a skipped job is considered a success by GitHub. So we have to From 668fdbe41edba8bda2100a71fe412ab62322b8d5 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 20:09:46 +0200 Subject: [PATCH 060/183] pass the whole config to C compiler construction --- library/stdarch/Cargo.lock | 4 +- .../crates/intrinsic-test/src/arm/compile.rs | 45 ++++++++++++------- .../crates/intrinsic-test/src/arm/mod.rs | 13 +----- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/library/stdarch/Cargo.lock b/library/stdarch/Cargo.lock index 122b3057b2f6..f287ed6e3b73 100644 --- a/library/stdarch/Cargo.lock +++ b/library/stdarch/Cargo.lock @@ -90,9 +90,9 @@ checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "cc" -version = "1.2.29" +version = "1.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" +checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7" dependencies = [ "shlex", ] diff --git a/library/stdarch/crates/intrinsic-test/src/arm/compile.rs b/library/stdarch/crates/intrinsic-test/src/arm/compile.rs index 79cd32dedc5f..a90caf367ca6 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/compile.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/compile.rs @@ -1,23 +1,23 @@ +use crate::common::cli::ProcessedCli; use crate::common::compile_c::CompilationCommandBuilder; use crate::common::gen_c::compile_c_programs; -pub fn compile_c_arm( - intrinsics_name_list: &[String], - compiler: &str, - target: &str, - cxx_toolchain_dir: Option<&str>, -) -> bool { +pub fn compile_c_arm(config: &ProcessedCli, intrinsics_name_list: &[String]) -> bool { + let Some(ref cpp_compiler) = config.cpp_compiler else { + return true; + }; + // -ffp-contract=off emulates Rust's approach of not fusing separate mul-add operations let mut command = CompilationCommandBuilder::new() .add_arch_flags(vec!["armv8.6-a", "crypto", "crc", "dotprod", "fp16"]) - .set_compiler(compiler) - .set_target(target) + .set_compiler(cpp_compiler) + .set_target(&config.target) .set_opt_level("2") - .set_cxx_toolchain_dir(cxx_toolchain_dir) + .set_cxx_toolchain_dir(config.cxx_toolchain_dir.as_deref()) .set_project_root("c_programs") .add_extra_flags(vec!["-ffp-contract=off", "-Wno-narrowing"]); - if !target.contains("v7") { + if !config.target.contains("v7") { command = command.add_arch_flags(vec!["faminmax", "lut", "sha3"]); } @@ -30,22 +30,33 @@ pub fn compile_c_arm( * does not work as it gets caught up with `#include_next ` * not existing... */ - if target.contains("aarch64_be") { - command = command - .set_linker( - cxx_toolchain_dir.unwrap_or("").to_string() + "/bin/aarch64_be-none-linux-gnu-g++", + if config.target.contains("aarch64_be") { + let Some(ref cxx_toolchain_dir) = config.cxx_toolchain_dir else { + panic!( + "target `{}` must specify `cxx_toolchain_dir`", + config.target ) - .set_include_paths(vec![ + }; + + let linker = if let Some(ref linker) = config.linker { + linker.to_owned() + } else { + format!("{cxx_toolchain_dir}/bin/aarch64_be-none-linux-gnu-g++") + }; + + trace!("using linker: {linker}"); + + command = command.set_linker(linker).set_include_paths(vec![ "/include", "/aarch64_be-none-linux-gnu/include", "/aarch64_be-none-linux-gnu/include/c++/14.3.1", "/aarch64_be-none-linux-gnu/include/c++/14.3.1/aarch64_be-none-linux-gnu", "/aarch64_be-none-linux-gnu/include/c++/14.3.1/backward", "/aarch64_be-none-linux-gnu/libc/usr/include", - ]); + ]); } - if !compiler.contains("clang") { + if !cpp_compiler.contains("clang") { command = command.add_extra_flag("-flax-vector-conversions"); } diff --git a/library/stdarch/crates/intrinsic-test/src/arm/mod.rs b/library/stdarch/crates/intrinsic-test/src/arm/mod.rs index 1a66ed4268da..a2535dc6a7a9 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/mod.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/mod.rs @@ -11,7 +11,6 @@ use crate::common::gen_rust::compile_rust_programs; use crate::common::intrinsic::{Intrinsic, IntrinsicDefinition}; use crate::common::intrinsic_helpers::TypeKind; use crate::common::write_file::{write_c_testfiles, write_rust_testfiles}; -use compile::compile_c_arm; use config::{AARCH_CONFIGURATIONS, F16_FORMATTING_DEF, POLY128_OSTREAM_DEF, build_notices}; use intrinsic::ArmIntrinsicType; use json_parser::get_neon_intrinsics; @@ -51,9 +50,7 @@ impl SupportedArchitectureTest for ArmArchitectureTest { } fn build_c_file(&self) -> bool { - let compiler = self.cli_options.cpp_compiler.as_deref(); let target = &self.cli_options.target; - let cxx_toolchain_dir = self.cli_options.cxx_toolchain_dir.as_deref(); let c_target = "aarch64"; let intrinsics_name_list = write_c_testfiles( @@ -69,15 +66,7 @@ impl SupportedArchitectureTest for ArmArchitectureTest { &[POLY128_OSTREAM_DEF], ); - match compiler { - None => true, - Some(compiler) => compile_c_arm( - intrinsics_name_list.as_slice(), - compiler, - target, - cxx_toolchain_dir, - ), - } + compile::compile_c_arm(&self.cli_options, intrinsics_name_list.as_slice()) } fn build_rust_file(&self) -> bool { From 75887cf99557c84ebb64077a1b3f96ad8a597c22 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 10 Jul 2025 20:30:36 +0200 Subject: [PATCH 061/183] improve cpp compiler execution --- .../crates/intrinsic-test/src/arm/compile.rs | 68 ++++------ .../crates/intrinsic-test/src/arm/mod.rs | 4 +- .../intrinsic-test/src/common/compile_c.rs | 124 +++++++----------- .../crates/intrinsic-test/src/common/gen_c.rs | 40 +++--- 4 files changed, 92 insertions(+), 144 deletions(-) diff --git a/library/stdarch/crates/intrinsic-test/src/arm/compile.rs b/library/stdarch/crates/intrinsic-test/src/arm/compile.rs index a90caf367ca6..48a8ed950e3d 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/compile.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/compile.rs @@ -1,11 +1,8 @@ use crate::common::cli::ProcessedCli; -use crate::common::compile_c::CompilationCommandBuilder; -use crate::common::gen_c::compile_c_programs; +use crate::common::compile_c::{CompilationCommandBuilder, CppCompilation}; -pub fn compile_c_arm(config: &ProcessedCli, intrinsics_name_list: &[String]) -> bool { - let Some(ref cpp_compiler) = config.cpp_compiler else { - return true; - }; +pub fn build_cpp_compilation(config: &ProcessedCli) -> Option { + let cpp_compiler = config.cpp_compiler.as_ref()?; // -ffp-contract=off emulates Rust's approach of not fusing separate mul-add operations let mut command = CompilationCommandBuilder::new() @@ -21,15 +18,12 @@ pub fn compile_c_arm(config: &ProcessedCli, intrinsics_name_list: &[String]) -> command = command.add_arch_flags(vec!["faminmax", "lut", "sha3"]); } - /* - * clang++ cannot link an aarch64_be object file, so we invoke - * aarch64_be-unknown-linux-gnu's C++ linker. This ensures that we - * are testing the intrinsics against LLVM. - * - * Note: setting `--sysroot=<...>` which is the obvious thing to do - * does not work as it gets caught up with `#include_next ` - * not existing... - */ + if !cpp_compiler.contains("clang") { + command = command.add_extra_flag("-flax-vector-conversions"); + } + + let mut cpp_compiler = command.into_cpp_compilation(); + if config.target.contains("aarch64_be") { let Some(ref cxx_toolchain_dir) = config.cxx_toolchain_dir else { panic!( @@ -38,38 +32,20 @@ pub fn compile_c_arm(config: &ProcessedCli, intrinsics_name_list: &[String]) -> ) }; - let linker = if let Some(ref linker) = config.linker { - linker.to_owned() - } else { - format!("{cxx_toolchain_dir}/bin/aarch64_be-none-linux-gnu-g++") - }; - - trace!("using linker: {linker}"); - - command = command.set_linker(linker).set_include_paths(vec![ - "/include", - "/aarch64_be-none-linux-gnu/include", - "/aarch64_be-none-linux-gnu/include/c++/14.3.1", - "/aarch64_be-none-linux-gnu/include/c++/14.3.1/aarch64_be-none-linux-gnu", - "/aarch64_be-none-linux-gnu/include/c++/14.3.1/backward", - "/aarch64_be-none-linux-gnu/libc/usr/include", + cpp_compiler.command_mut().args([ + &format!("--sysroot={cxx_toolchain_dir}/aarch64_be-none-linux-gnu/libc"), + "--include-directory", + &format!("{cxx_toolchain_dir}/aarch64_be-none-linux-gnu/include/c++/14.3.1"), + "--include-directory", + &format!("{cxx_toolchain_dir}/aarch64_be-none-linux-gnu/include/c++/14.3.1/aarch64_be-none-linux-gnu"), + "-L", + &format!("{cxx_toolchain_dir}/lib/gcc/aarch64_be-none-linux-gnu/14.3.1"), + "-L", + &format!("{cxx_toolchain_dir}/aarch64_be-none-linux-gnu/libc/usr/lib"), + "-B", + &format!("{cxx_toolchain_dir}/lib/gcc/aarch64_be-none-linux-gnu/14.3.1"), ]); } - if !cpp_compiler.contains("clang") { - command = command.add_extra_flag("-flax-vector-conversions"); - } - - let compiler_commands = intrinsics_name_list - .iter() - .map(|intrinsic_name| { - command - .clone() - .set_input_name(intrinsic_name) - .set_output_name(intrinsic_name) - .make_string() - }) - .collect::>(); - - compile_c_programs(&compiler_commands) + Some(cpp_compiler) } diff --git a/library/stdarch/crates/intrinsic-test/src/arm/mod.rs b/library/stdarch/crates/intrinsic-test/src/arm/mod.rs index a2535dc6a7a9..18530e7e6bd2 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/mod.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/mod.rs @@ -7,6 +7,7 @@ mod types; use crate::common::SupportedArchitectureTest; use crate::common::cli::ProcessedCli; use crate::common::compare::compare_outputs; +use crate::common::gen_c::compile_c_programs; use crate::common::gen_rust::compile_rust_programs; use crate::common::intrinsic::{Intrinsic, IntrinsicDefinition}; use crate::common::intrinsic_helpers::TypeKind; @@ -66,7 +67,8 @@ impl SupportedArchitectureTest for ArmArchitectureTest { &[POLY128_OSTREAM_DEF], ); - compile::compile_c_arm(&self.cli_options, intrinsics_name_list.as_slice()) + let pipeline = compile::build_cpp_compilation(&self.cli_options).unwrap(); + compile_c_programs(&pipeline, &intrinsics_name_list) } fn build_rust_file(&self) -> bool { diff --git a/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs b/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs index aebb7b111e28..8e2eb8e0f408 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs @@ -5,11 +5,7 @@ pub struct CompilationCommandBuilder { cxx_toolchain_dir: Option, arch_flags: Vec, optimization: String, - include_paths: Vec, project_root: Option, - output: String, - input: String, - linker: Option, extra_flags: Vec, } @@ -21,11 +17,7 @@ impl CompilationCommandBuilder { cxx_toolchain_dir: None, arch_flags: Vec::new(), optimization: "2".to_string(), - include_paths: Vec::new(), project_root: None, - output: String::new(), - input: String::new(), - linker: None, extra_flags: Vec::new(), } } @@ -57,37 +49,12 @@ impl CompilationCommandBuilder { self } - /// Sets a list of include paths for compilation. - /// The paths that are passed must be relative to the - /// "cxx_toolchain_dir" directory path. - pub fn set_include_paths(mut self, paths: Vec<&str>) -> Self { - self.include_paths = paths.into_iter().map(|path| path.to_string()).collect(); - self - } - /// Sets the root path of all the generated test files. pub fn set_project_root(mut self, path: &str) -> Self { self.project_root = Some(path.to_string()); self } - /// The name of the output executable, without any suffixes - pub fn set_output_name(mut self, path: &str) -> Self { - self.output = path.to_string(); - self - } - - /// The name of the input C file, without any suffixes - pub fn set_input_name(mut self, path: &str) -> Self { - self.input = path.to_string(); - self - } - - pub fn set_linker(mut self, linker: String) -> Self { - self.linker = Some(linker); - self - } - pub fn add_extra_flags(mut self, flags: Vec<&str>) -> Self { let mut flags: Vec = flags.into_iter().map(|f| f.to_string()).collect(); self.extra_flags.append(&mut flags); @@ -100,55 +67,56 @@ impl CompilationCommandBuilder { } impl CompilationCommandBuilder { - pub fn make_string(self) -> String { - let arch_flags = self.arch_flags.join("+"); - let flags = std::env::var("CPPFLAGS").unwrap_or("".into()); - let project_root = self.project_root.unwrap_or_default(); - let project_root_str = project_root.as_str(); - let mut output = self.output.clone(); - if self.linker.is_some() { - output += ".o" - }; - let mut command = format!( - "{} {flags} -march={arch_flags} \ - -O{} \ - -o {project_root}/{} \ - {project_root}/{}.cpp", - self.compiler, self.optimization, output, self.input, - ); + pub fn into_cpp_compilation(self) -> CppCompilation { + let mut cpp_compiler = std::process::Command::new(self.compiler); - command = command + " " + self.extra_flags.join(" ").as_str(); + if let Some(project_root) = self.project_root { + cpp_compiler.current_dir(project_root); + } + + let flags = std::env::var("CPPFLAGS").unwrap_or("".into()); + cpp_compiler.args(flags.split_whitespace()); + + cpp_compiler.arg(format!("-march={}", self.arch_flags.join("+"))); + + cpp_compiler.arg(format!("-O{}", self.optimization)); + + cpp_compiler.args(self.extra_flags); if let Some(target) = &self.target { - command = command + " --target=" + target; + cpp_compiler.arg(format!("--target={target}")); } - if let (Some(linker), Some(cxx_toolchain_dir)) = (&self.linker, &self.cxx_toolchain_dir) { - let include_args = self - .include_paths - .iter() - .map(|path| "--include-directory=".to_string() + cxx_toolchain_dir + path) - .collect::>() - .join(" "); - - command = command - + " -c " - + include_args.as_str() - + " && " - + linker - + " " - + project_root_str - + "/" - + &output - + " -o " - + project_root_str - + "/" - + &self.output - + " && rm " - + project_root_str - + "/" - + &output; - } - command + CppCompilation(cpp_compiler) + } +} + +pub struct CppCompilation(std::process::Command); + +fn clone_command(command: &std::process::Command) -> std::process::Command { + let mut cmd = std::process::Command::new(command.get_program()); + if let Some(current_dir) = command.get_current_dir() { + cmd.current_dir(current_dir); + } + cmd.args(command.get_args()); + + for (key, val) in command.get_envs() { + cmd.env(key, val.unwrap_or_default()); + } + + cmd +} + +impl CppCompilation { + pub fn command_mut(&mut self) -> &mut std::process::Command { + &mut self.0 + } + + pub fn run(&self, inputs: &[String], output: &str) -> std::io::Result { + let mut cmd = clone_command(&self.0); + cmd.args(inputs); + cmd.args(["-o", output]); + + cmd.output() } } diff --git a/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs b/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs index 1cfb66c39b90..84167f2f4aef 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs @@ -1,7 +1,8 @@ use itertools::Itertools; use rayon::prelude::*; use std::collections::BTreeMap; -use std::process::Command; + +use crate::common::compile_c::CppCompilation; use super::argument::Argument; use super::indentation::Indentation; @@ -62,29 +63,30 @@ int main(int argc, char **argv) {{ ) } -pub fn compile_c_programs(compiler_commands: &[String]) -> bool { - compiler_commands +pub fn compile_c_programs(pipeline: &CppCompilation, intrinsics: &[String]) -> bool { + intrinsics .par_iter() - .map(|compiler_command| { - let output = Command::new("sh").arg("-c").arg(compiler_command).output(); - if let Ok(output) = output { - if output.status.success() { - true - } else { - error!( - "Failed to compile code for intrinsics: \n\nstdout:\n{}\n\nstderr:\n{}", + .map( + |intrinsic| match pipeline.run(&[format!("{intrinsic}.cpp")], intrinsic) { + Ok(output) if output.status.success() => Ok(()), + Ok(output) => { + let msg = format!( + "Failed to compile code for intrinsic `{intrinsic}`: \n\nstdout:\n{}\n\nstderr:\n{}", std::str::from_utf8(&output.stdout).unwrap_or(""), std::str::from_utf8(&output.stderr).unwrap_or("") ); - false + error!("{msg}"); + + Err(msg) } - } else { - error!("Command failed: {output:#?}"); - false - } - }) - .find_any(|x| !x) - .is_none() + Err(e) => { + error!("command for `{intrinsic}` failed with IO error: {e:?}"); + Err(e.to_string()) + } + }, + ) + .collect::>() + .is_ok() } // Creates directory structure and file path mappings From 4e53043395b747b267bee975080896fb781fe19f Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 18 Jul 2025 15:46:00 +0530 Subject: [PATCH 062/183] populate the target_config now before its usage and update the test accordingly --- src/bootstrap/src/core/builder/tests.rs | 2 ++ src/bootstrap/src/core/config/config.rs | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 51a906496923..7f0c6fbd8545 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -1638,6 +1638,7 @@ mod snapshot { .render_steps(), @r" [build] llvm [build] rustc 0 -> rustc 1 + [build] rustc 0 -> LldWrapper 1 [build] rustdoc 0 [doc] std 1 crates=[core] "); @@ -1653,6 +1654,7 @@ mod snapshot { .render_steps(), @r" [build] llvm [build] rustc 0 -> rustc 1 + [build] rustc 0 -> LldWrapper 1 [build] rustdoc 0 [doc] std 1 crates=[alloc,core] "); diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 22a75183404f..6e04f1154243 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -942,6 +942,7 @@ impl Config { config.rust_profile_use = flags_rust_profile_use; config.rust_profile_generate = flags_rust_profile_generate; + config.apply_target_config(toml.target); config.apply_rust_config(toml.rust, flags_warnings); config.reproducible_artifacts = flags_reproducible_artifact; @@ -967,8 +968,6 @@ impl Config { config.apply_gcc_config(toml.gcc); - config.apply_target_config(toml.target); - match ccache { Some(StringOrBool::String(ref s)) => config.ccache = Some(s.to_string()), Some(StringOrBool::Bool(true)) => { From 6ed7ee36e6839036b3e6d8b3a2d2f30310ddbfc6 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Fri, 11 Jul 2025 01:25:52 +0200 Subject: [PATCH 063/183] exclude generated rust programs from the workspace --- library/stdarch/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/stdarch/Cargo.toml b/library/stdarch/Cargo.toml index 0db26f31a2d3..597909643911 100644 --- a/library/stdarch/Cargo.toml +++ b/library/stdarch/Cargo.toml @@ -5,7 +5,8 @@ members = [ "examples", ] exclude = [ - "crates/wasm-assert-instr-tests" + "crates/wasm-assert-instr-tests", + "rust_programs", ] [profile.release] From 846c591bf60c551fc779ab8a489e9d7a74dab446 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Fri, 11 Jul 2025 01:26:34 +0200 Subject: [PATCH 064/183] `intrinsic-test`: combine C files for more efficient compilation --- .../crates/intrinsic-test/src/arm/mod.rs | 80 ++++- .../intrinsic-test/src/common/argument.rs | 30 +- .../intrinsic-test/src/common/compare.rs | 4 +- .../intrinsic-test/src/common/compile_c.rs | 17 +- .../crates/intrinsic-test/src/common/gen_c.rs | 325 +++++++++--------- .../intrinsic-test/src/common/write_file.rs | 33 -- 6 files changed, 259 insertions(+), 230 deletions(-) diff --git a/library/stdarch/crates/intrinsic-test/src/arm/mod.rs b/library/stdarch/crates/intrinsic-test/src/arm/mod.rs index 18530e7e6bd2..0a64a24e7313 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/mod.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/mod.rs @@ -4,15 +4,20 @@ mod intrinsic; mod json_parser; mod types; +use std::fs::File; + +use rayon::prelude::*; + +use crate::arm::config::POLY128_OSTREAM_DEF; use crate::common::SupportedArchitectureTest; use crate::common::cli::ProcessedCli; use crate::common::compare::compare_outputs; -use crate::common::gen_c::compile_c_programs; +use crate::common::gen_c::{write_main_cpp, write_mod_cpp}; use crate::common::gen_rust::compile_rust_programs; use crate::common::intrinsic::{Intrinsic, IntrinsicDefinition}; use crate::common::intrinsic_helpers::TypeKind; -use crate::common::write_file::{write_c_testfiles, write_rust_testfiles}; -use config::{AARCH_CONFIGURATIONS, F16_FORMATTING_DEF, POLY128_OSTREAM_DEF, build_notices}; +use crate::common::write_file::write_rust_testfiles; +use config::{AARCH_CONFIGURATIONS, F16_FORMATTING_DEF, build_notices}; use intrinsic::ArmIntrinsicType; use json_parser::get_neon_intrinsics; @@ -21,6 +26,13 @@ pub struct ArmArchitectureTest { cli_options: ProcessedCli, } +fn chunk_info(intrinsic_count: usize) -> (usize, usize) { + let available_parallelism = std::thread::available_parallelism().unwrap().get(); + let chunk_size = intrinsic_count.div_ceil(Ord::min(available_parallelism, intrinsic_count)); + + (chunk_size, intrinsic_count.div_ceil(chunk_size)) +} + impl SupportedArchitectureTest for ArmArchitectureTest { fn create(cli_options: ProcessedCli) -> Box { let a32 = cli_options.target.contains("v7"); @@ -51,24 +63,58 @@ impl SupportedArchitectureTest for ArmArchitectureTest { } fn build_c_file(&self) -> bool { - let target = &self.cli_options.target; let c_target = "aarch64"; + let platform_headers = &["arm_neon.h", "arm_acle.h", "arm_fp16.h"]; - let intrinsics_name_list = write_c_testfiles( - &self - .intrinsics - .iter() - .map(|i| i as &dyn IntrinsicDefinition<_>) - .collect::>(), - target, + let (chunk_size, chunk_count) = chunk_info(self.intrinsics.len()); + + let cpp_compiler = compile::build_cpp_compilation(&self.cli_options).unwrap(); + + let notice = &build_notices("// "); + self.intrinsics + .par_chunks(chunk_size) + .enumerate() + .map(|(i, chunk)| { + let c_filename = format!("c_programs/mod_{i}.cpp"); + let mut file = File::create(&c_filename).unwrap(); + write_mod_cpp(&mut file, notice, c_target, platform_headers, chunk).unwrap(); + + // compile this cpp file into a .o file + let output = cpp_compiler + .compile_object_file(&format!("mod_{i}.cpp"), &format!("mod_{i}.o"))?; + assert!(output.status.success(), "{output:?}"); + + Ok(()) + }) + .collect::>() + .unwrap(); + + let mut file = File::create("c_programs/main.cpp").unwrap(); + write_main_cpp( + &mut file, c_target, - &["arm_neon.h", "arm_acle.h", "arm_fp16.h"], - &build_notices("// "), - &[POLY128_OSTREAM_DEF], - ); + POLY128_OSTREAM_DEF, + self.intrinsics.iter().map(|i| i.name.as_str()), + ) + .unwrap(); - let pipeline = compile::build_cpp_compilation(&self.cli_options).unwrap(); - compile_c_programs(&pipeline, &intrinsics_name_list) + // compile this cpp file into a .o file + info!("compiling main.cpp"); + let output = cpp_compiler + .compile_object_file("main.cpp", "intrinsic-test-programs.o") + .unwrap(); + assert!(output.status.success(), "{output:?}"); + + let object_files = (0..chunk_count) + .map(|i| format!("mod_{i}.o")) + .chain(["intrinsic-test-programs.o".to_owned()]); + + let output = cpp_compiler + .link_executable(object_files, "intrinsic-test-programs") + .unwrap(); + assert!(output.status.success(), "{output:?}"); + + true } fn build_rust_file(&self) -> bool { diff --git a/library/stdarch/crates/intrinsic-test/src/common/argument.rs b/library/stdarch/crates/intrinsic-test/src/common/argument.rs index 443ccb919f46..338f0d344a7d 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/argument.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/argument.rs @@ -125,19 +125,23 @@ where /// Creates a line for each argument that initializes an array for C from which `loads` argument /// values can be loaded as a sliding window. /// e.g `const int32x2_t a_vals = {0x3effffff, 0x3effffff, 0x3f7fffff}`, if loads=2. - pub fn gen_arglists_c(&self, indentation: Indentation, loads: u32) -> String { - self.iter() - .filter(|&arg| !arg.has_constraint()) - .map(|arg| { - format!( - "{indentation}const {ty} {name}_vals[] = {values};", - ty = arg.ty.c_scalar_type(), - name = arg.name, - values = arg.ty.populate_random(indentation, loads, &Language::C) - ) - }) - .collect::>() - .join("\n") + pub fn gen_arglists_c( + &self, + w: &mut impl std::io::Write, + indentation: Indentation, + loads: u32, + ) -> std::io::Result<()> { + for arg in self.iter().filter(|&arg| !arg.has_constraint()) { + writeln!( + w, + "{indentation}const {ty} {name}_vals[] = {values};", + ty = arg.ty.c_scalar_type(), + name = arg.name, + values = arg.ty.populate_random(indentation, loads, &Language::C) + )? + } + + Ok(()) } /// Creates a line for each argument that initializes an array for Rust from which `loads` argument diff --git a/library/stdarch/crates/intrinsic-test/src/common/compare.rs b/library/stdarch/crates/intrinsic-test/src/common/compare.rs index f16d83b0264b..cb55922eb199 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/compare.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/compare.rs @@ -15,12 +15,12 @@ pub fn compare_outputs(intrinsic_name_list: &Vec, runner: &str, target: .par_iter() .filter_map(|intrinsic_name| { let c = runner_command(runner) - .arg(format!("./c_programs/{intrinsic_name}")) + .arg("./c_programs/intrinsic-test-programs") + .arg(intrinsic_name) .output(); let rust = runner_command(runner) .arg(format!("target/{target}/release/{intrinsic_name}")) - .env("RUSTFLAGS", "-Cdebuginfo=0") .output(); let (c, rust) = match (c, rust) { diff --git a/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs b/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs index 8e2eb8e0f408..0c905a149e48 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs @@ -112,11 +112,24 @@ impl CppCompilation { &mut self.0 } - pub fn run(&self, inputs: &[String], output: &str) -> std::io::Result { + pub fn compile_object_file( + &self, + input: &str, + output: &str, + ) -> std::io::Result { + let mut cmd = clone_command(&self.0); + cmd.args([input, "-c", "-o", output]); + cmd.output() + } + + pub fn link_executable( + &self, + inputs: impl Iterator, + output: &str, + ) -> std::io::Result { let mut cmd = clone_command(&self.0); cmd.args(inputs); cmd.args(["-o", output]); - cmd.output() } } diff --git a/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs b/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs index 84167f2f4aef..905efb6d8909 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs @@ -1,9 +1,3 @@ -use itertools::Itertools; -use rayon::prelude::*; -use std::collections::BTreeMap; - -use crate::common::compile_c::CppCompilation; - use super::argument::Argument; use super::indentation::Indentation; use super::intrinsic::IntrinsicDefinition; @@ -12,105 +6,16 @@ use super::intrinsic_helpers::IntrinsicTypeDefinition; // The number of times each intrinsic will be called. const PASSES: u32 = 20; -// Formats the main C program template with placeholders -pub fn format_c_main_template( - notices: &str, - header_files: &[&str], - arch_identifier: &str, - arch_specific_definitions: &[&str], - arglists: &str, - passes: &str, -) -> String { - format!( - r#"{notices}{header_files} -#include -#include -#include -#include - -template T1 cast(T2 x) {{ - static_assert(sizeof(T1) == sizeof(T2), "sizeof T1 and T2 must be the same"); - T1 ret{{}}; - memcpy(&ret, &x, sizeof(T1)); - return ret; -}} - -std::ostream& operator<<(std::ostream& os, float16_t value) {{ - uint16_t temp = 0; - memcpy(&temp, &value, sizeof(float16_t)); - std::stringstream ss; - ss << "0x" << std::setfill('0') << std::setw(4) << std::hex << temp; - os << ss.str(); - return os; -}} - -#ifdef __{arch_identifier}__ -{arch_specific_definitions} -#endif - -{arglists} - -int main(int argc, char **argv) {{ -{passes} - return 0; -}}"#, - header_files = header_files - .iter() - .map(|header| format!("#include <{header}>")) - .collect::>() - .join("\n"), - arch_specific_definitions = arch_specific_definitions.join("\n"), - ) -} - -pub fn compile_c_programs(pipeline: &CppCompilation, intrinsics: &[String]) -> bool { - intrinsics - .par_iter() - .map( - |intrinsic| match pipeline.run(&[format!("{intrinsic}.cpp")], intrinsic) { - Ok(output) if output.status.success() => Ok(()), - Ok(output) => { - let msg = format!( - "Failed to compile code for intrinsic `{intrinsic}`: \n\nstdout:\n{}\n\nstderr:\n{}", - std::str::from_utf8(&output.stdout).unwrap_or(""), - std::str::from_utf8(&output.stderr).unwrap_or("") - ); - error!("{msg}"); - - Err(msg) - } - Err(e) => { - error!("command for `{intrinsic}` failed with IO error: {e:?}"); - Err(e.to_string()) - } - }, - ) - .collect::>() - .is_ok() -} - -// Creates directory structure and file path mappings -pub fn setup_c_file_paths(identifiers: &Vec) -> BTreeMap<&String, String> { - let _ = std::fs::create_dir("c_programs"); - identifiers - .par_iter() - .map(|identifier| { - let c_filename = format!(r#"c_programs/{identifier}.cpp"#); - - (identifier, c_filename) - }) - .collect::>() -} - pub fn generate_c_test_loop( + w: &mut impl std::io::Write, intrinsic: &dyn IntrinsicDefinition, indentation: Indentation, additional: &str, passes: u32, - _target: &str, -) -> String { +) -> std::io::Result<()> { let body_indentation = indentation.nested(); - format!( + writeln!( + w, "{indentation}for (int i=0; i<{passes}; i++) {{\n\ {loaded_args}\ {body_indentation}auto __return_value = {intrinsic_call}({args});\n\ @@ -123,78 +28,172 @@ pub fn generate_c_test_loop( ) } -pub fn generate_c_constraint_blocks( +pub fn generate_c_constraint_blocks<'a, T: IntrinsicTypeDefinition + 'a>( + w: &mut impl std::io::Write, intrinsic: &dyn IntrinsicDefinition, indentation: Indentation, - constraints: &[&Argument], + constraints: &mut (impl Iterator> + Clone), name: String, - target: &str, -) -> String { - if let Some((current, constraints)) = constraints.split_last() { - let range = current - .constraint - .iter() - .map(|c| c.to_range()) - .flat_map(|r| r.into_iter()); +) -> std::io::Result<()> { + let Some(current) = constraints.next() else { + return generate_c_test_loop(w, intrinsic, indentation, &name, PASSES); + }; - let body_indentation = indentation.nested(); - range - .map(|i| { - format!( - "{indentation}{{\n\ - {body_indentation}{ty} {name} = {val};\n\ - {pass}\n\ - {indentation}}}", - name = current.name, - ty = current.ty.c_type(), - val = i, - pass = generate_c_constraint_blocks( - intrinsic, - body_indentation, - constraints, - format!("{name}-{i}"), - target, - ) - ) - }) - .join("\n") - } else { - generate_c_test_loop(intrinsic, indentation, &name, PASSES, target) + let body_indentation = indentation.nested(); + for i in current.constraint.iter().flat_map(|c| c.to_range()) { + let ty = current.ty.c_type(); + + writeln!(w, "{indentation}{{")?; + writeln!(w, "{body_indentation}{ty} {} = {i};", current.name)?; + + generate_c_constraint_blocks( + w, + intrinsic, + body_indentation, + &mut constraints.clone(), + format!("{name}-{i}"), + )?; + + writeln!(w, "{indentation}}}")?; } + + Ok(()) } // Compiles C test programs using specified compiler -pub fn create_c_test_program( +pub fn create_c_test_function( + w: &mut impl std::io::Write, intrinsic: &dyn IntrinsicDefinition, - header_files: &[&str], - target: &str, - c_target: &str, - notices: &str, - arch_specific_definitions: &[&str], -) -> String { - let arguments = intrinsic.arguments(); - let constraints = arguments - .iter() - .filter(|&i| i.has_constraint()) - .collect_vec(); - +) -> std::io::Result<()> { let indentation = Indentation::default(); - format_c_main_template( - notices, - header_files, - c_target, - arch_specific_definitions, - intrinsic - .arguments() - .gen_arglists_c(indentation, PASSES) - .as_str(), - generate_c_constraint_blocks( - intrinsic, - indentation.nested(), - constraints.as_slice(), - Default::default(), - target, - ) - .as_str(), - ) + + writeln!(w, "int run_{}() {{", intrinsic.name())?; + + // Define the arrays of arguments. + let arguments = intrinsic.arguments(); + arguments.gen_arglists_c(w, indentation.nested(), PASSES)?; + + generate_c_constraint_blocks( + w, + intrinsic, + indentation.nested(), + &mut arguments.iter().rev().filter(|&i| i.has_constraint()), + Default::default(), + )?; + + writeln!(w, " return 0;")?; + writeln!(w, "}}")?; + + Ok(()) +} + +pub fn write_mod_cpp( + w: &mut impl std::io::Write, + notice: &str, + architecture: &str, + platform_headers: &[&str], + intrinsics: &[impl IntrinsicDefinition], +) -> std::io::Result<()> { + write!(w, "{notice}")?; + + for header in platform_headers { + writeln!(w, "#include <{header}>")?; + } + + writeln!( + w, + r#" +#include +#include +#include +#include + +template T1 cast(T2 x) {{ + static_assert(sizeof(T1) == sizeof(T2), "sizeof T1 and T2 must be the same"); + T1 ret{{}}; + memcpy(&ret, &x, sizeof(T1)); + return ret; +}} + +std::ostream& operator<<(std::ostream& os, float16_t value); + + + +"# + )?; + + writeln!(w, "#ifdef __{architecture}__")?; + writeln!( + w, + "std::ostream& operator<<(std::ostream& os, poly128_t value);" + )?; + writeln!(w, "#endif")?; + + for intrinsic in intrinsics { + create_c_test_function(w, intrinsic)?; + } + + Ok(()) +} + +pub fn write_main_cpp<'a>( + w: &mut impl std::io::Write, + architecture: &str, + arch_specific_definitions: &str, + intrinsics: impl Iterator + Clone, +) -> std::io::Result<()> { + writeln!(w, "#include ")?; + writeln!(w, "#include ")?; + + for header in ["arm_neon.h", "arm_acle.h", "arm_fp16.h"] { + writeln!(w, "#include <{header}>")?; + } + + writeln!( + w, + r#" +#include +#include +#include + +std::ostream& operator<<(std::ostream& os, float16_t value) {{ + uint16_t temp = 0; + memcpy(&temp, &value, sizeof(float16_t)); + std::stringstream ss; + ss << "0x" << std::setfill('0') << std::setw(4) << std::hex << temp; + os << ss.str(); + return os; +}} +"# + )?; + + writeln!(w, "#ifdef __{architecture}__")?; + writeln!(w, "{arch_specific_definitions }")?; + writeln!(w, "#endif")?; + + for intrinsic in intrinsics.clone() { + writeln!(w, "extern int run_{intrinsic}(void);")?; + } + + writeln!(w, "int main(int argc, char **argv) {{")?; + writeln!(w, " std::string intrinsic_name = argv[1];")?; + + writeln!(w, " if (false) {{")?; + + for intrinsic in intrinsics { + writeln!(w, " }} else if (intrinsic_name == \"{intrinsic}\") {{")?; + writeln!(w, " return run_{intrinsic}();")?; + } + + writeln!(w, " }} else {{")?; + writeln!( + w, + " std::cerr << \"Unknown command: \" << intrinsic_name << \"\\n\";" + )?; + writeln!(w, " return -1;")?; + writeln!(w, " }}")?; + + writeln!(w, "}}")?; + + Ok(()) } diff --git a/library/stdarch/crates/intrinsic-test/src/common/write_file.rs b/library/stdarch/crates/intrinsic-test/src/common/write_file.rs index 0ba3e829a6b8..92dd70b7c578 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/write_file.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/write_file.rs @@ -1,5 +1,3 @@ -use super::gen_c::create_c_test_program; -use super::gen_c::setup_c_file_paths; use super::gen_rust::{create_rust_test_program, setup_rust_file_paths}; use super::intrinsic::IntrinsicDefinition; use super::intrinsic_helpers::IntrinsicTypeDefinition; @@ -11,37 +9,6 @@ pub fn write_file(filename: &String, code: String) { file.write_all(code.into_bytes().as_slice()).unwrap(); } -pub fn write_c_testfiles( - intrinsics: &Vec<&dyn IntrinsicDefinition>, - target: &str, - c_target: &str, - headers: &[&str], - notice: &str, - arch_specific_definitions: &[&str], -) -> Vec { - let intrinsics_name_list = intrinsics - .iter() - .map(|i| i.name().clone()) - .collect::>(); - let filename_mapping = setup_c_file_paths(&intrinsics_name_list); - - intrinsics.iter().for_each(|&i| { - let c_code = create_c_test_program( - i, - headers, - target, - c_target, - notice, - arch_specific_definitions, - ); - if let Some(filename) = filename_mapping.get(&i.name()) { - write_file(filename, c_code) - }; - }); - - intrinsics_name_list -} - pub fn write_rust_testfiles( intrinsics: Vec<&dyn IntrinsicDefinition>, rust_target: &str, From a438401d05beb6d4307e4741b38c3a133de00c0d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 18 Jul 2025 13:40:11 +0200 Subject: [PATCH 065/183] move page protection logic inside native_lib and ensure we don't unwind out of the "weird state" during tracing --- src/tools/miri/Cargo.toml | 5 +- src/tools/miri/src/alloc/isolated_alloc.rs | 54 ++--------- src/tools/miri/src/lib.rs | 1 + src/tools/miri/src/shims/native_lib/mod.rs | 13 +-- .../miri/src/shims/native_lib/trace/child.rs | 95 ++++++++++++------- .../src/shims/native_lib/trace/messages.rs | 3 +- 6 files changed, 81 insertions(+), 90 deletions(-) diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index 0aff34e9fbe6..b3503acf0c0e 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -38,13 +38,14 @@ features = ['unprefixed_malloc_on_supported_platforms'] [target.'cfg(unix)'.dependencies] libc = "0.2" +# native-lib dependencies libffi = { version = "4.0.0", optional = true } libloading = { version = "0.8", optional = true } -nix = { version = "0.30.1", features = ["mman", "ptrace", "signal"], optional = true } +serde = { version = "1.0.219", features = ["derive"], optional = true } [target.'cfg(target_os = "linux")'.dependencies] +nix = { version = "0.30.1", features = ["mman", "ptrace", "signal"], optional = true } ipc-channel = { version = "0.19.0", optional = true } -serde = { version = "1.0.219", features = ["derive"], optional = true } capstone = { version = "0.13", optional = true } [dev-dependencies] diff --git a/src/tools/miri/src/alloc/isolated_alloc.rs b/src/tools/miri/src/alloc/isolated_alloc.rs index 7b2f1a3eebf3..1745727b16b4 100644 --- a/src/tools/miri/src/alloc/isolated_alloc.rs +++ b/src/tools/miri/src/alloc/isolated_alloc.rs @@ -1,7 +1,6 @@ use std::alloc::Layout; use std::ptr::NonNull; -use nix::sys::mman; use rustc_index::bit_set::DenseBitSet; /// How many bytes of memory each bit in the bitset represents. @@ -44,6 +43,10 @@ impl IsolatedAlloc { } } + pub fn page_size(&self) -> usize { + self.page_size + } + /// For simplicity, we serve small allocations in multiples of COMPRESSION_FACTOR /// bytes with at least that alignment. #[inline] @@ -302,50 +305,11 @@ impl IsolatedAlloc { } } - /// Returns a list of page addresses managed by the allocator. - pub fn pages(&self) -> impl Iterator { - let pages = self.page_ptrs.iter().map(|p| p.expose_provenance().get()); - pages.chain(self.huge_ptrs.iter().flat_map(|(ptr, size)| { - (0..size / self.page_size) - .map(|i| ptr.expose_provenance().get().strict_add(i * self.page_size)) - })) - } - - /// Protects all owned memory as `PROT_NONE`, preventing accesses. - /// - /// SAFETY: Accessing memory after this point will result in a segfault - /// unless it is first unprotected. - pub unsafe fn start_ffi(&mut self) -> Result<(), nix::errno::Errno> { - let prot = mman::ProtFlags::PROT_NONE; - unsafe { self.mprotect(prot) } - } - - /// Deprotects all owned memory by setting it to RW. Erroring here is very - /// likely unrecoverable, so it may panic if applying those permissions - /// fails. - pub fn end_ffi(&mut self) { - let prot = mman::ProtFlags::PROT_READ | mman::ProtFlags::PROT_WRITE; - unsafe { - self.mprotect(prot).unwrap(); - } - } - - /// Applies `prot` to every page managed by the allocator. - /// - /// SAFETY: Accessing memory in violation of the protection flags will - /// trigger a segfault. - unsafe fn mprotect(&mut self, prot: mman::ProtFlags) -> Result<(), nix::errno::Errno> { - for &pg in &self.page_ptrs { - unsafe { - mman::mprotect(pg.cast(), self.page_size, prot)?; - } - } - for &(hpg, size) in &self.huge_ptrs { - unsafe { - mman::mprotect(hpg.cast(), size.next_multiple_of(self.page_size), prot)?; - } - } - Ok(()) + /// Returns a list of page ranges managed by the allocator, given in terms of pointers + /// and size (in bytes). + pub fn pages(&self) -> impl Iterator, usize)> { + let pages = self.page_ptrs.iter().map(|&p| (p, self.page_size)); + pages.chain(self.huge_ptrs.iter().copied()) } } diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index 0f293c0d8f7c..ae70257653c8 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -1,3 +1,4 @@ +#![feature(abort_unwind)] #![feature(cfg_select)] #![feature(rustc_private)] #![feature(float_gamma)] diff --git a/src/tools/miri/src/shims/native_lib/mod.rs b/src/tools/miri/src/shims/native_lib/mod.rs index fb7b1df41a4c..2827ed997a7c 100644 --- a/src/tools/miri/src/shims/native_lib/mod.rs +++ b/src/tools/miri/src/shims/native_lib/mod.rs @@ -8,6 +8,7 @@ use rustc_abi::{BackendRepr, HasDataLayout, Size}; use rustc_middle::mir::interpret::Pointer; use rustc_middle::ty::{self as ty, IntTy, UintTy}; use rustc_span::Symbol; +use serde::{Deserialize, Serialize}; #[cfg_attr( not(all( @@ -23,18 +24,14 @@ use crate::*; /// The final results of an FFI trace, containing every relevant event detected /// by the tracer. -#[allow(dead_code)] -#[cfg_attr(target_os = "linux", derive(serde::Serialize, serde::Deserialize))] -#[derive(Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct MemEvents { /// An list of memory accesses that occurred, in the order they occurred in. pub acc_events: Vec, } /// A single memory access. -#[allow(dead_code)] -#[cfg_attr(target_os = "linux", derive(serde::Serialize, serde::Deserialize))] -#[derive(Clone, Debug)] +#[derive(Serialize, Deserialize, Clone, Debug)] pub enum AccessEvent { /// A read occurred on this memory range. Read(AccessRange), @@ -56,9 +53,7 @@ impl AccessEvent { } /// The memory touched by a given access. -#[allow(dead_code)] -#[cfg_attr(target_os = "linux", derive(serde::Serialize, serde::Deserialize))] -#[derive(Clone, Debug)] +#[derive(Serialize, Deserialize, Clone, Debug)] pub struct AccessRange { /// The base address in memory where an access occurred. pub addr: usize, diff --git a/src/tools/miri/src/shims/native_lib/trace/child.rs b/src/tools/miri/src/shims/native_lib/trace/child.rs index de26cb0fe557..b998ba822dde 100644 --- a/src/tools/miri/src/shims/native_lib/trace/child.rs +++ b/src/tools/miri/src/shims/native_lib/trace/child.rs @@ -1,8 +1,9 @@ use std::cell::RefCell; +use std::ptr::NonNull; use std::rc::Rc; use ipc_channel::ipc; -use nix::sys::{ptrace, signal}; +use nix::sys::{mman, ptrace, signal}; use nix::unistd; use rustc_const_eval::interpret::InterpResult; @@ -44,6 +45,16 @@ impl Supervisor { SUPERVISOR.lock().unwrap().is_some() } + unsafe fn protect_pages( + pages: impl Iterator, usize)>, + prot: mman::ProtFlags, + ) -> Result<(), nix::errno::Errno> { + for (pg, sz) in pages { + unsafe { mman::mprotect(pg.cast(), sz, prot)? }; + } + Ok(()) + } + /// Performs an arbitrary FFI call, enabling tracing from the supervisor. /// As this locks the supervisor via a mutex, no other threads may enter FFI /// until this function returns. @@ -60,47 +71,67 @@ impl Supervisor { // Get pointers to all the pages the supervisor must allow accesses in // and prepare the callback stack. - let page_ptrs = alloc.borrow().pages().collect(); + let alloc = alloc.borrow(); + let page_size = alloc.page_size(); + let page_ptrs = alloc + .pages() + .flat_map(|(pg, sz)| { + // Convert (page, size) pair into list of pages. + let start = pg.expose_provenance().get(); + (0..sz.strict_div(alloc.page_size())) + .map(move |i| start.strict_add(i.strict_mul(page_size))) + }) + .collect(); let raw_stack_ptr: *mut [u8; CALLBACK_STACK_SIZE] = Box::leak(Box::new([0u8; CALLBACK_STACK_SIZE])).as_mut_ptr().cast(); let stack_ptr = raw_stack_ptr.expose_provenance(); let start_info = StartFfiInfo { page_ptrs, stack_ptr }; - // SAFETY: We do not access machine memory past this point until the - // supervisor is ready to allow it. - unsafe { - if alloc.borrow_mut().start_ffi().is_err() { - // Don't mess up unwinding by maybe leaving the memory partly protected - alloc.borrow_mut().end_ffi(); - panic!("Cannot protect memory for FFI call!"); + // Unwinding might be messed up due to partly protected memory, so let's abort if something + // breaks inside here. + let res = std::panic::abort_unwind(|| { + // SAFETY: We do not access machine memory past this point until the + // supervisor is ready to allow it. + // FIXME: this is sketchy, as technically the memory is still in the Rust Abstract Machine, + // and the compiler would be allowed to reorder accesses below this block... + unsafe { + Self::protect_pages(alloc.pages(), mman::ProtFlags::PROT_NONE).unwrap(); } - } - // Send over the info. - // NB: if we do not wait to receive a blank confirmation response, it is - // possible that the supervisor is alerted of the SIGSTOP *before* it has - // actually received the start_info, thus deadlocking! This way, we can - // enforce an ordering for these events. - sv.message_tx.send(TraceRequest::StartFfi(start_info)).unwrap(); - sv.confirm_rx.recv().unwrap(); - // We need to be stopped for the supervisor to be able to make certain - // modifications to our memory - simply waiting on the recv() doesn't - // count. - signal::raise(signal::SIGSTOP).unwrap(); + // Send over the info. + // NB: if we do not wait to receive a blank confirmation response, it is + // possible that the supervisor is alerted of the SIGSTOP *before* it has + // actually received the start_info, thus deadlocking! This way, we can + // enforce an ordering for these events. + sv.message_tx.send(TraceRequest::StartFfi(start_info)).unwrap(); + sv.confirm_rx.recv().unwrap(); + // We need to be stopped for the supervisor to be able to make certain + // modifications to our memory - simply waiting on the recv() doesn't + // count. + signal::raise(signal::SIGSTOP).unwrap(); - let res = f(); + let res = f(); - // We can't use IPC channels here to signal that FFI mode has ended, - // since they might allocate memory which could get us stuck in a SIGTRAP - // with no easy way out! While this could be worked around, it is much - // simpler and more robust to simply use the signals which are left for - // arbitrary usage. Since this will block until we are continued by the - // supervisor, we can assume past this point that everything is back to - // normal. - signal::raise(signal::SIGUSR1).unwrap(); + // We can't use IPC channels here to signal that FFI mode has ended, + // since they might allocate memory which could get us stuck in a SIGTRAP + // with no easy way out! While this could be worked around, it is much + // simpler and more robust to simply use the signals which are left for + // arbitrary usage. Since this will block until we are continued by the + // supervisor, we can assume past this point that everything is back to + // normal. + signal::raise(signal::SIGUSR1).unwrap(); - // This is safe! It just sets memory to normal expected permissions. - alloc.borrow_mut().end_ffi(); + // SAFETY: We set memory back to normal, so this is safe. + unsafe { + Self::protect_pages( + alloc.pages(), + mman::ProtFlags::PROT_READ | mman::ProtFlags::PROT_WRITE, + ) + .unwrap(); + } + + res + }); // SAFETY: Caller upholds that this pointer was allocated as a box with // this type. diff --git a/src/tools/miri/src/shims/native_lib/trace/messages.rs b/src/tools/miri/src/shims/native_lib/trace/messages.rs index 1f9df556b577..bef6cc1b2f3e 100644 --- a/src/tools/miri/src/shims/native_lib/trace/messages.rs +++ b/src/tools/miri/src/shims/native_lib/trace/messages.rs @@ -45,8 +45,7 @@ pub enum TraceRequest { /// Information needed to begin tracing. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] pub struct StartFfiInfo { - /// A vector of page addresses. These should have been automatically obtained - /// with `IsolatedAlloc::pages` and prepared with `IsolatedAlloc::start_ffi`. + /// A vector of page addresses that store the miri heap which is accessible from C. pub page_ptrs: Vec, /// The address of an allocation that can serve as a temporary stack. /// This should be a leaked `Box<[u8; CALLBACK_STACK_SIZE]>` cast to an int. From da892b54be8ad0998e0003aaf9ae2dbb85ea11b4 Mon Sep 17 00:00:00 2001 From: WANG Rui Date: Sat, 28 Jun 2025 13:37:41 +0800 Subject: [PATCH 066/183] loongarch: Mark SIMD intrinsics without memory access as safe --- .../src/loongarch64/lasx/generated.rs | 2912 ++++++++--------- .../src/loongarch64/lsx/generated.rs | 2832 ++++++++-------- .../crates/stdarch-gen-loongarch/README.md | 2 - .../crates/stdarch-gen-loongarch/src/main.rs | 46 +- 4 files changed, 2901 insertions(+), 2891 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/loongarch64/lasx/generated.rs b/library/stdarch/crates/core_arch/src/loongarch64/lasx/generated.rs index 2e56d8fb9b83..4361acdc1fcc 100644 --- a/library/stdarch/crates/core_arch/src/loongarch64/lasx/generated.rs +++ b/library/stdarch/crates/core_arch/src/loongarch64/lasx/generated.rs @@ -1495,3501 +1495,3501 @@ unsafe extern "unadjusted" { #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsll_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvsll_b(a, b) +pub fn lasx_xvsll_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvsll_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsll_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvsll_h(a, b) +pub fn lasx_xvsll_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvsll_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsll_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvsll_w(a, b) +pub fn lasx_xvsll_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvsll_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsll_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsll_d(a, b) +pub fn lasx_xvsll_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsll_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslli_b(a: v32i8) -> v32i8 { +pub fn lasx_xvslli_b(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvslli_b(a, IMM3) + unsafe { __lasx_xvslli_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslli_h(a: v16i16) -> v16i16 { +pub fn lasx_xvslli_h(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvslli_h(a, IMM4) + unsafe { __lasx_xvslli_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslli_w(a: v8i32) -> v8i32 { +pub fn lasx_xvslli_w(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvslli_w(a, IMM5) + unsafe { __lasx_xvslli_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslli_d(a: v4i64) -> v4i64 { +pub fn lasx_xvslli_d(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvslli_d(a, IMM6) + unsafe { __lasx_xvslli_d(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsra_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvsra_b(a, b) +pub fn lasx_xvsra_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvsra_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsra_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvsra_h(a, b) +pub fn lasx_xvsra_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvsra_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsra_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvsra_w(a, b) +pub fn lasx_xvsra_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvsra_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsra_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsra_d(a, b) +pub fn lasx_xvsra_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsra_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrai_b(a: v32i8) -> v32i8 { +pub fn lasx_xvsrai_b(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvsrai_b(a, IMM3) + unsafe { __lasx_xvsrai_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrai_h(a: v16i16) -> v16i16 { +pub fn lasx_xvsrai_h(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsrai_h(a, IMM4) + unsafe { __lasx_xvsrai_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrai_w(a: v8i32) -> v8i32 { +pub fn lasx_xvsrai_w(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsrai_w(a, IMM5) + unsafe { __lasx_xvsrai_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrai_d(a: v4i64) -> v4i64 { +pub fn lasx_xvsrai_d(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvsrai_d(a, IMM6) + unsafe { __lasx_xvsrai_d(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrar_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvsrar_b(a, b) +pub fn lasx_xvsrar_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvsrar_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrar_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvsrar_h(a, b) +pub fn lasx_xvsrar_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvsrar_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrar_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvsrar_w(a, b) +pub fn lasx_xvsrar_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvsrar_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrar_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsrar_d(a, b) +pub fn lasx_xvsrar_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsrar_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrari_b(a: v32i8) -> v32i8 { +pub fn lasx_xvsrari_b(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvsrari_b(a, IMM3) + unsafe { __lasx_xvsrari_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrari_h(a: v16i16) -> v16i16 { +pub fn lasx_xvsrari_h(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsrari_h(a, IMM4) + unsafe { __lasx_xvsrari_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrari_w(a: v8i32) -> v8i32 { +pub fn lasx_xvsrari_w(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsrari_w(a, IMM5) + unsafe { __lasx_xvsrari_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrari_d(a: v4i64) -> v4i64 { +pub fn lasx_xvsrari_d(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvsrari_d(a, IMM6) + unsafe { __lasx_xvsrari_d(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrl_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvsrl_b(a, b) +pub fn lasx_xvsrl_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvsrl_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrl_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvsrl_h(a, b) +pub fn lasx_xvsrl_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvsrl_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrl_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvsrl_w(a, b) +pub fn lasx_xvsrl_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvsrl_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrl_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsrl_d(a, b) +pub fn lasx_xvsrl_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsrl_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrli_b(a: v32i8) -> v32i8 { +pub fn lasx_xvsrli_b(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvsrli_b(a, IMM3) + unsafe { __lasx_xvsrli_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrli_h(a: v16i16) -> v16i16 { +pub fn lasx_xvsrli_h(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsrli_h(a, IMM4) + unsafe { __lasx_xvsrli_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrli_w(a: v8i32) -> v8i32 { +pub fn lasx_xvsrli_w(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsrli_w(a, IMM5) + unsafe { __lasx_xvsrli_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrli_d(a: v4i64) -> v4i64 { +pub fn lasx_xvsrli_d(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvsrli_d(a, IMM6) + unsafe { __lasx_xvsrli_d(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlr_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvsrlr_b(a, b) +pub fn lasx_xvsrlr_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvsrlr_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlr_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvsrlr_h(a, b) +pub fn lasx_xvsrlr_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvsrlr_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlr_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvsrlr_w(a, b) +pub fn lasx_xvsrlr_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvsrlr_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlr_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsrlr_d(a, b) +pub fn lasx_xvsrlr_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsrlr_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlri_b(a: v32i8) -> v32i8 { +pub fn lasx_xvsrlri_b(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvsrlri_b(a, IMM3) + unsafe { __lasx_xvsrlri_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlri_h(a: v16i16) -> v16i16 { +pub fn lasx_xvsrlri_h(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsrlri_h(a, IMM4) + unsafe { __lasx_xvsrlri_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlri_w(a: v8i32) -> v8i32 { +pub fn lasx_xvsrlri_w(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsrlri_w(a, IMM5) + unsafe { __lasx_xvsrlri_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlri_d(a: v4i64) -> v4i64 { +pub fn lasx_xvsrlri_d(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvsrlri_d(a, IMM6) + unsafe { __lasx_xvsrlri_d(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitclr_b(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvbitclr_b(a, b) +pub fn lasx_xvbitclr_b(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvbitclr_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitclr_h(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvbitclr_h(a, b) +pub fn lasx_xvbitclr_h(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvbitclr_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitclr_w(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvbitclr_w(a, b) +pub fn lasx_xvbitclr_w(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvbitclr_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitclr_d(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvbitclr_d(a, b) +pub fn lasx_xvbitclr_d(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvbitclr_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitclri_b(a: v32u8) -> v32u8 { +pub fn lasx_xvbitclri_b(a: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvbitclri_b(a, IMM3) + unsafe { __lasx_xvbitclri_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitclri_h(a: v16u16) -> v16u16 { +pub fn lasx_xvbitclri_h(a: v16u16) -> v16u16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvbitclri_h(a, IMM4) + unsafe { __lasx_xvbitclri_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitclri_w(a: v8u32) -> v8u32 { +pub fn lasx_xvbitclri_w(a: v8u32) -> v8u32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvbitclri_w(a, IMM5) + unsafe { __lasx_xvbitclri_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitclri_d(a: v4u64) -> v4u64 { +pub fn lasx_xvbitclri_d(a: v4u64) -> v4u64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvbitclri_d(a, IMM6) + unsafe { __lasx_xvbitclri_d(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitset_b(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvbitset_b(a, b) +pub fn lasx_xvbitset_b(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvbitset_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitset_h(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvbitset_h(a, b) +pub fn lasx_xvbitset_h(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvbitset_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitset_w(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvbitset_w(a, b) +pub fn lasx_xvbitset_w(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvbitset_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitset_d(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvbitset_d(a, b) +pub fn lasx_xvbitset_d(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvbitset_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitseti_b(a: v32u8) -> v32u8 { +pub fn lasx_xvbitseti_b(a: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvbitseti_b(a, IMM3) + unsafe { __lasx_xvbitseti_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitseti_h(a: v16u16) -> v16u16 { +pub fn lasx_xvbitseti_h(a: v16u16) -> v16u16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvbitseti_h(a, IMM4) + unsafe { __lasx_xvbitseti_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitseti_w(a: v8u32) -> v8u32 { +pub fn lasx_xvbitseti_w(a: v8u32) -> v8u32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvbitseti_w(a, IMM5) + unsafe { __lasx_xvbitseti_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitseti_d(a: v4u64) -> v4u64 { +pub fn lasx_xvbitseti_d(a: v4u64) -> v4u64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvbitseti_d(a, IMM6) + unsafe { __lasx_xvbitseti_d(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitrev_b(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvbitrev_b(a, b) +pub fn lasx_xvbitrev_b(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvbitrev_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitrev_h(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvbitrev_h(a, b) +pub fn lasx_xvbitrev_h(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvbitrev_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitrev_w(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvbitrev_w(a, b) +pub fn lasx_xvbitrev_w(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvbitrev_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitrev_d(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvbitrev_d(a, b) +pub fn lasx_xvbitrev_d(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvbitrev_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitrevi_b(a: v32u8) -> v32u8 { +pub fn lasx_xvbitrevi_b(a: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvbitrevi_b(a, IMM3) + unsafe { __lasx_xvbitrevi_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitrevi_h(a: v16u16) -> v16u16 { +pub fn lasx_xvbitrevi_h(a: v16u16) -> v16u16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvbitrevi_h(a, IMM4) + unsafe { __lasx_xvbitrevi_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitrevi_w(a: v8u32) -> v8u32 { +pub fn lasx_xvbitrevi_w(a: v8u32) -> v8u32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvbitrevi_w(a, IMM5) + unsafe { __lasx_xvbitrevi_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitrevi_d(a: v4u64) -> v4u64 { +pub fn lasx_xvbitrevi_d(a: v4u64) -> v4u64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvbitrevi_d(a, IMM6) + unsafe { __lasx_xvbitrevi_d(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvadd_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvadd_b(a, b) +pub fn lasx_xvadd_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvadd_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvadd_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvadd_h(a, b) +pub fn lasx_xvadd_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvadd_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvadd_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvadd_w(a, b) +pub fn lasx_xvadd_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvadd_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvadd_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvadd_d(a, b) +pub fn lasx_xvadd_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvadd_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddi_bu(a: v32i8) -> v32i8 { +pub fn lasx_xvaddi_bu(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvaddi_bu(a, IMM5) + unsafe { __lasx_xvaddi_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddi_hu(a: v16i16) -> v16i16 { +pub fn lasx_xvaddi_hu(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvaddi_hu(a, IMM5) + unsafe { __lasx_xvaddi_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddi_wu(a: v8i32) -> v8i32 { +pub fn lasx_xvaddi_wu(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvaddi_wu(a, IMM5) + unsafe { __lasx_xvaddi_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddi_du(a: v4i64) -> v4i64 { +pub fn lasx_xvaddi_du(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvaddi_du(a, IMM5) + unsafe { __lasx_xvaddi_du(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsub_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvsub_b(a, b) +pub fn lasx_xvsub_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvsub_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsub_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvsub_h(a, b) +pub fn lasx_xvsub_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvsub_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsub_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvsub_w(a, b) +pub fn lasx_xvsub_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvsub_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsub_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsub_d(a, b) +pub fn lasx_xvsub_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsub_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubi_bu(a: v32i8) -> v32i8 { +pub fn lasx_xvsubi_bu(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsubi_bu(a, IMM5) + unsafe { __lasx_xvsubi_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubi_hu(a: v16i16) -> v16i16 { +pub fn lasx_xvsubi_hu(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsubi_hu(a, IMM5) + unsafe { __lasx_xvsubi_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubi_wu(a: v8i32) -> v8i32 { +pub fn lasx_xvsubi_wu(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsubi_wu(a, IMM5) + unsafe { __lasx_xvsubi_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubi_du(a: v4i64) -> v4i64 { +pub fn lasx_xvsubi_du(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsubi_du(a, IMM5) + unsafe { __lasx_xvsubi_du(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmax_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvmax_b(a, b) +pub fn lasx_xvmax_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvmax_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmax_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvmax_h(a, b) +pub fn lasx_xvmax_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvmax_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmax_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvmax_w(a, b) +pub fn lasx_xvmax_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvmax_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmax_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvmax_d(a, b) +pub fn lasx_xvmax_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvmax_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaxi_b(a: v32i8) -> v32i8 { +pub fn lasx_xvmaxi_b(a: v32i8) -> v32i8 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvmaxi_b(a, IMM_S5) + unsafe { __lasx_xvmaxi_b(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaxi_h(a: v16i16) -> v16i16 { +pub fn lasx_xvmaxi_h(a: v16i16) -> v16i16 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvmaxi_h(a, IMM_S5) + unsafe { __lasx_xvmaxi_h(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaxi_w(a: v8i32) -> v8i32 { +pub fn lasx_xvmaxi_w(a: v8i32) -> v8i32 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvmaxi_w(a, IMM_S5) + unsafe { __lasx_xvmaxi_w(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaxi_d(a: v4i64) -> v4i64 { +pub fn lasx_xvmaxi_d(a: v4i64) -> v4i64 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvmaxi_d(a, IMM_S5) + unsafe { __lasx_xvmaxi_d(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmax_bu(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvmax_bu(a, b) +pub fn lasx_xvmax_bu(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvmax_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmax_hu(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvmax_hu(a, b) +pub fn lasx_xvmax_hu(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvmax_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmax_wu(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvmax_wu(a, b) +pub fn lasx_xvmax_wu(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvmax_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmax_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvmax_du(a, b) +pub fn lasx_xvmax_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvmax_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaxi_bu(a: v32u8) -> v32u8 { +pub fn lasx_xvmaxi_bu(a: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvmaxi_bu(a, IMM5) + unsafe { __lasx_xvmaxi_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaxi_hu(a: v16u16) -> v16u16 { +pub fn lasx_xvmaxi_hu(a: v16u16) -> v16u16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvmaxi_hu(a, IMM5) + unsafe { __lasx_xvmaxi_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaxi_wu(a: v8u32) -> v8u32 { +pub fn lasx_xvmaxi_wu(a: v8u32) -> v8u32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvmaxi_wu(a, IMM5) + unsafe { __lasx_xvmaxi_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaxi_du(a: v4u64) -> v4u64 { +pub fn lasx_xvmaxi_du(a: v4u64) -> v4u64 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvmaxi_du(a, IMM5) + unsafe { __lasx_xvmaxi_du(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmin_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvmin_b(a, b) +pub fn lasx_xvmin_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvmin_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmin_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvmin_h(a, b) +pub fn lasx_xvmin_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvmin_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmin_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvmin_w(a, b) +pub fn lasx_xvmin_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvmin_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmin_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvmin_d(a, b) +pub fn lasx_xvmin_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvmin_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmini_b(a: v32i8) -> v32i8 { +pub fn lasx_xvmini_b(a: v32i8) -> v32i8 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvmini_b(a, IMM_S5) + unsafe { __lasx_xvmini_b(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmini_h(a: v16i16) -> v16i16 { +pub fn lasx_xvmini_h(a: v16i16) -> v16i16 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvmini_h(a, IMM_S5) + unsafe { __lasx_xvmini_h(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmini_w(a: v8i32) -> v8i32 { +pub fn lasx_xvmini_w(a: v8i32) -> v8i32 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvmini_w(a, IMM_S5) + unsafe { __lasx_xvmini_w(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmini_d(a: v4i64) -> v4i64 { +pub fn lasx_xvmini_d(a: v4i64) -> v4i64 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvmini_d(a, IMM_S5) + unsafe { __lasx_xvmini_d(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmin_bu(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvmin_bu(a, b) +pub fn lasx_xvmin_bu(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvmin_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmin_hu(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvmin_hu(a, b) +pub fn lasx_xvmin_hu(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvmin_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmin_wu(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvmin_wu(a, b) +pub fn lasx_xvmin_wu(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvmin_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmin_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvmin_du(a, b) +pub fn lasx_xvmin_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvmin_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmini_bu(a: v32u8) -> v32u8 { +pub fn lasx_xvmini_bu(a: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvmini_bu(a, IMM5) + unsafe { __lasx_xvmini_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmini_hu(a: v16u16) -> v16u16 { +pub fn lasx_xvmini_hu(a: v16u16) -> v16u16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvmini_hu(a, IMM5) + unsafe { __lasx_xvmini_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmini_wu(a: v8u32) -> v8u32 { +pub fn lasx_xvmini_wu(a: v8u32) -> v8u32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvmini_wu(a, IMM5) + unsafe { __lasx_xvmini_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmini_du(a: v4u64) -> v4u64 { +pub fn lasx_xvmini_du(a: v4u64) -> v4u64 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvmini_du(a, IMM5) + unsafe { __lasx_xvmini_du(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvseq_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvseq_b(a, b) +pub fn lasx_xvseq_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvseq_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvseq_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvseq_h(a, b) +pub fn lasx_xvseq_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvseq_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvseq_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvseq_w(a, b) +pub fn lasx_xvseq_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvseq_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvseq_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvseq_d(a, b) +pub fn lasx_xvseq_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvseq_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvseqi_b(a: v32i8) -> v32i8 { +pub fn lasx_xvseqi_b(a: v32i8) -> v32i8 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvseqi_b(a, IMM_S5) + unsafe { __lasx_xvseqi_b(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvseqi_h(a: v16i16) -> v16i16 { +pub fn lasx_xvseqi_h(a: v16i16) -> v16i16 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvseqi_h(a, IMM_S5) + unsafe { __lasx_xvseqi_h(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvseqi_w(a: v8i32) -> v8i32 { +pub fn lasx_xvseqi_w(a: v8i32) -> v8i32 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvseqi_w(a, IMM_S5) + unsafe { __lasx_xvseqi_w(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvseqi_d(a: v4i64) -> v4i64 { +pub fn lasx_xvseqi_d(a: v4i64) -> v4i64 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvseqi_d(a, IMM_S5) + unsafe { __lasx_xvseqi_d(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslt_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvslt_b(a, b) +pub fn lasx_xvslt_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvslt_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslt_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvslt_h(a, b) +pub fn lasx_xvslt_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvslt_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslt_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvslt_w(a, b) +pub fn lasx_xvslt_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvslt_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslt_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvslt_d(a, b) +pub fn lasx_xvslt_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvslt_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslti_b(a: v32i8) -> v32i8 { +pub fn lasx_xvslti_b(a: v32i8) -> v32i8 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvslti_b(a, IMM_S5) + unsafe { __lasx_xvslti_b(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslti_h(a: v16i16) -> v16i16 { +pub fn lasx_xvslti_h(a: v16i16) -> v16i16 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvslti_h(a, IMM_S5) + unsafe { __lasx_xvslti_h(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslti_w(a: v8i32) -> v8i32 { +pub fn lasx_xvslti_w(a: v8i32) -> v8i32 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvslti_w(a, IMM_S5) + unsafe { __lasx_xvslti_w(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslti_d(a: v4i64) -> v4i64 { +pub fn lasx_xvslti_d(a: v4i64) -> v4i64 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvslti_d(a, IMM_S5) + unsafe { __lasx_xvslti_d(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslt_bu(a: v32u8, b: v32u8) -> v32i8 { - __lasx_xvslt_bu(a, b) +pub fn lasx_xvslt_bu(a: v32u8, b: v32u8) -> v32i8 { + unsafe { __lasx_xvslt_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslt_hu(a: v16u16, b: v16u16) -> v16i16 { - __lasx_xvslt_hu(a, b) +pub fn lasx_xvslt_hu(a: v16u16, b: v16u16) -> v16i16 { + unsafe { __lasx_xvslt_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslt_wu(a: v8u32, b: v8u32) -> v8i32 { - __lasx_xvslt_wu(a, b) +pub fn lasx_xvslt_wu(a: v8u32, b: v8u32) -> v8i32 { + unsafe { __lasx_xvslt_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslt_du(a: v4u64, b: v4u64) -> v4i64 { - __lasx_xvslt_du(a, b) +pub fn lasx_xvslt_du(a: v4u64, b: v4u64) -> v4i64 { + unsafe { __lasx_xvslt_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslti_bu(a: v32u8) -> v32i8 { +pub fn lasx_xvslti_bu(a: v32u8) -> v32i8 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvslti_bu(a, IMM5) + unsafe { __lasx_xvslti_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslti_hu(a: v16u16) -> v16i16 { +pub fn lasx_xvslti_hu(a: v16u16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvslti_hu(a, IMM5) + unsafe { __lasx_xvslti_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslti_wu(a: v8u32) -> v8i32 { +pub fn lasx_xvslti_wu(a: v8u32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvslti_wu(a, IMM5) + unsafe { __lasx_xvslti_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslti_du(a: v4u64) -> v4i64 { +pub fn lasx_xvslti_du(a: v4u64) -> v4i64 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvslti_du(a, IMM5) + unsafe { __lasx_xvslti_du(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsle_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvsle_b(a, b) +pub fn lasx_xvsle_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvsle_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsle_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvsle_h(a, b) +pub fn lasx_xvsle_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvsle_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsle_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvsle_w(a, b) +pub fn lasx_xvsle_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvsle_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsle_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsle_d(a, b) +pub fn lasx_xvsle_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsle_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslei_b(a: v32i8) -> v32i8 { +pub fn lasx_xvslei_b(a: v32i8) -> v32i8 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvslei_b(a, IMM_S5) + unsafe { __lasx_xvslei_b(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslei_h(a: v16i16) -> v16i16 { +pub fn lasx_xvslei_h(a: v16i16) -> v16i16 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvslei_h(a, IMM_S5) + unsafe { __lasx_xvslei_h(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslei_w(a: v8i32) -> v8i32 { +pub fn lasx_xvslei_w(a: v8i32) -> v8i32 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvslei_w(a, IMM_S5) + unsafe { __lasx_xvslei_w(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslei_d(a: v4i64) -> v4i64 { +pub fn lasx_xvslei_d(a: v4i64) -> v4i64 { static_assert_simm_bits!(IMM_S5, 5); - __lasx_xvslei_d(a, IMM_S5) + unsafe { __lasx_xvslei_d(a, IMM_S5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsle_bu(a: v32u8, b: v32u8) -> v32i8 { - __lasx_xvsle_bu(a, b) +pub fn lasx_xvsle_bu(a: v32u8, b: v32u8) -> v32i8 { + unsafe { __lasx_xvsle_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsle_hu(a: v16u16, b: v16u16) -> v16i16 { - __lasx_xvsle_hu(a, b) +pub fn lasx_xvsle_hu(a: v16u16, b: v16u16) -> v16i16 { + unsafe { __lasx_xvsle_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsle_wu(a: v8u32, b: v8u32) -> v8i32 { - __lasx_xvsle_wu(a, b) +pub fn lasx_xvsle_wu(a: v8u32, b: v8u32) -> v8i32 { + unsafe { __lasx_xvsle_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsle_du(a: v4u64, b: v4u64) -> v4i64 { - __lasx_xvsle_du(a, b) +pub fn lasx_xvsle_du(a: v4u64, b: v4u64) -> v4i64 { + unsafe { __lasx_xvsle_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslei_bu(a: v32u8) -> v32i8 { +pub fn lasx_xvslei_bu(a: v32u8) -> v32i8 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvslei_bu(a, IMM5) + unsafe { __lasx_xvslei_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslei_hu(a: v16u16) -> v16i16 { +pub fn lasx_xvslei_hu(a: v16u16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvslei_hu(a, IMM5) + unsafe { __lasx_xvslei_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslei_wu(a: v8u32) -> v8i32 { +pub fn lasx_xvslei_wu(a: v8u32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvslei_wu(a, IMM5) + unsafe { __lasx_xvslei_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvslei_du(a: v4u64) -> v4i64 { +pub fn lasx_xvslei_du(a: v4u64) -> v4i64 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvslei_du(a, IMM5) + unsafe { __lasx_xvslei_du(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsat_b(a: v32i8) -> v32i8 { +pub fn lasx_xvsat_b(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvsat_b(a, IMM3) + unsafe { __lasx_xvsat_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsat_h(a: v16i16) -> v16i16 { +pub fn lasx_xvsat_h(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsat_h(a, IMM4) + unsafe { __lasx_xvsat_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsat_w(a: v8i32) -> v8i32 { +pub fn lasx_xvsat_w(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsat_w(a, IMM5) + unsafe { __lasx_xvsat_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsat_d(a: v4i64) -> v4i64 { +pub fn lasx_xvsat_d(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvsat_d(a, IMM6) + unsafe { __lasx_xvsat_d(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsat_bu(a: v32u8) -> v32u8 { +pub fn lasx_xvsat_bu(a: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvsat_bu(a, IMM3) + unsafe { __lasx_xvsat_bu(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsat_hu(a: v16u16) -> v16u16 { +pub fn lasx_xvsat_hu(a: v16u16) -> v16u16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsat_hu(a, IMM4) + unsafe { __lasx_xvsat_hu(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsat_wu(a: v8u32) -> v8u32 { +pub fn lasx_xvsat_wu(a: v8u32) -> v8u32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsat_wu(a, IMM5) + unsafe { __lasx_xvsat_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsat_du(a: v4u64) -> v4u64 { +pub fn lasx_xvsat_du(a: v4u64) -> v4u64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvsat_du(a, IMM6) + unsafe { __lasx_xvsat_du(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvadda_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvadda_b(a, b) +pub fn lasx_xvadda_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvadda_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvadda_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvadda_h(a, b) +pub fn lasx_xvadda_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvadda_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvadda_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvadda_w(a, b) +pub fn lasx_xvadda_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvadda_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvadda_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvadda_d(a, b) +pub fn lasx_xvadda_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvadda_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsadd_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvsadd_b(a, b) +pub fn lasx_xvsadd_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvsadd_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsadd_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvsadd_h(a, b) +pub fn lasx_xvsadd_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvsadd_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsadd_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvsadd_w(a, b) +pub fn lasx_xvsadd_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvsadd_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsadd_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsadd_d(a, b) +pub fn lasx_xvsadd_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsadd_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsadd_bu(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvsadd_bu(a, b) +pub fn lasx_xvsadd_bu(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvsadd_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsadd_hu(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvsadd_hu(a, b) +pub fn lasx_xvsadd_hu(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvsadd_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsadd_wu(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvsadd_wu(a, b) +pub fn lasx_xvsadd_wu(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvsadd_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsadd_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvsadd_du(a, b) +pub fn lasx_xvsadd_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvsadd_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavg_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvavg_b(a, b) +pub fn lasx_xvavg_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvavg_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavg_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvavg_h(a, b) +pub fn lasx_xvavg_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvavg_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavg_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvavg_w(a, b) +pub fn lasx_xvavg_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvavg_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavg_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvavg_d(a, b) +pub fn lasx_xvavg_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvavg_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavg_bu(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvavg_bu(a, b) +pub fn lasx_xvavg_bu(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvavg_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavg_hu(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvavg_hu(a, b) +pub fn lasx_xvavg_hu(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvavg_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavg_wu(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvavg_wu(a, b) +pub fn lasx_xvavg_wu(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvavg_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavg_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvavg_du(a, b) +pub fn lasx_xvavg_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvavg_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavgr_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvavgr_b(a, b) +pub fn lasx_xvavgr_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvavgr_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavgr_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvavgr_h(a, b) +pub fn lasx_xvavgr_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvavgr_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavgr_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvavgr_w(a, b) +pub fn lasx_xvavgr_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvavgr_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavgr_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvavgr_d(a, b) +pub fn lasx_xvavgr_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvavgr_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavgr_bu(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvavgr_bu(a, b) +pub fn lasx_xvavgr_bu(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvavgr_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavgr_hu(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvavgr_hu(a, b) +pub fn lasx_xvavgr_hu(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvavgr_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavgr_wu(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvavgr_wu(a, b) +pub fn lasx_xvavgr_wu(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvavgr_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvavgr_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvavgr_du(a, b) +pub fn lasx_xvavgr_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvavgr_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssub_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvssub_b(a, b) +pub fn lasx_xvssub_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvssub_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssub_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvssub_h(a, b) +pub fn lasx_xvssub_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvssub_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssub_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvssub_w(a, b) +pub fn lasx_xvssub_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvssub_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssub_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvssub_d(a, b) +pub fn lasx_xvssub_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvssub_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssub_bu(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvssub_bu(a, b) +pub fn lasx_xvssub_bu(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvssub_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssub_hu(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvssub_hu(a, b) +pub fn lasx_xvssub_hu(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvssub_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssub_wu(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvssub_wu(a, b) +pub fn lasx_xvssub_wu(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvssub_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssub_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvssub_du(a, b) +pub fn lasx_xvssub_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvssub_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvabsd_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvabsd_b(a, b) +pub fn lasx_xvabsd_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvabsd_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvabsd_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvabsd_h(a, b) +pub fn lasx_xvabsd_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvabsd_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvabsd_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvabsd_w(a, b) +pub fn lasx_xvabsd_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvabsd_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvabsd_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvabsd_d(a, b) +pub fn lasx_xvabsd_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvabsd_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvabsd_bu(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvabsd_bu(a, b) +pub fn lasx_xvabsd_bu(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvabsd_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvabsd_hu(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvabsd_hu(a, b) +pub fn lasx_xvabsd_hu(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvabsd_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvabsd_wu(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvabsd_wu(a, b) +pub fn lasx_xvabsd_wu(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvabsd_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvabsd_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvabsd_du(a, b) +pub fn lasx_xvabsd_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvabsd_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmul_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvmul_b(a, b) +pub fn lasx_xvmul_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvmul_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmul_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvmul_h(a, b) +pub fn lasx_xvmul_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvmul_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmul_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvmul_w(a, b) +pub fn lasx_xvmul_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvmul_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmul_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvmul_d(a, b) +pub fn lasx_xvmul_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvmul_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmadd_b(a: v32i8, b: v32i8, c: v32i8) -> v32i8 { - __lasx_xvmadd_b(a, b, c) +pub fn lasx_xvmadd_b(a: v32i8, b: v32i8, c: v32i8) -> v32i8 { + unsafe { __lasx_xvmadd_b(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmadd_h(a: v16i16, b: v16i16, c: v16i16) -> v16i16 { - __lasx_xvmadd_h(a, b, c) +pub fn lasx_xvmadd_h(a: v16i16, b: v16i16, c: v16i16) -> v16i16 { + unsafe { __lasx_xvmadd_h(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmadd_w(a: v8i32, b: v8i32, c: v8i32) -> v8i32 { - __lasx_xvmadd_w(a, b, c) +pub fn lasx_xvmadd_w(a: v8i32, b: v8i32, c: v8i32) -> v8i32 { + unsafe { __lasx_xvmadd_w(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmadd_d(a: v4i64, b: v4i64, c: v4i64) -> v4i64 { - __lasx_xvmadd_d(a, b, c) +pub fn lasx_xvmadd_d(a: v4i64, b: v4i64, c: v4i64) -> v4i64 { + unsafe { __lasx_xvmadd_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmsub_b(a: v32i8, b: v32i8, c: v32i8) -> v32i8 { - __lasx_xvmsub_b(a, b, c) +pub fn lasx_xvmsub_b(a: v32i8, b: v32i8, c: v32i8) -> v32i8 { + unsafe { __lasx_xvmsub_b(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmsub_h(a: v16i16, b: v16i16, c: v16i16) -> v16i16 { - __lasx_xvmsub_h(a, b, c) +pub fn lasx_xvmsub_h(a: v16i16, b: v16i16, c: v16i16) -> v16i16 { + unsafe { __lasx_xvmsub_h(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmsub_w(a: v8i32, b: v8i32, c: v8i32) -> v8i32 { - __lasx_xvmsub_w(a, b, c) +pub fn lasx_xvmsub_w(a: v8i32, b: v8i32, c: v8i32) -> v8i32 { + unsafe { __lasx_xvmsub_w(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmsub_d(a: v4i64, b: v4i64, c: v4i64) -> v4i64 { - __lasx_xvmsub_d(a, b, c) +pub fn lasx_xvmsub_d(a: v4i64, b: v4i64, c: v4i64) -> v4i64 { + unsafe { __lasx_xvmsub_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvdiv_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvdiv_b(a, b) +pub fn lasx_xvdiv_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvdiv_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvdiv_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvdiv_h(a, b) +pub fn lasx_xvdiv_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvdiv_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvdiv_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvdiv_w(a, b) +pub fn lasx_xvdiv_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvdiv_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvdiv_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvdiv_d(a, b) +pub fn lasx_xvdiv_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvdiv_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvdiv_bu(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvdiv_bu(a, b) +pub fn lasx_xvdiv_bu(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvdiv_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvdiv_hu(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvdiv_hu(a, b) +pub fn lasx_xvdiv_hu(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvdiv_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvdiv_wu(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvdiv_wu(a, b) +pub fn lasx_xvdiv_wu(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvdiv_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvdiv_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvdiv_du(a, b) +pub fn lasx_xvdiv_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvdiv_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhaddw_h_b(a: v32i8, b: v32i8) -> v16i16 { - __lasx_xvhaddw_h_b(a, b) +pub fn lasx_xvhaddw_h_b(a: v32i8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvhaddw_h_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhaddw_w_h(a: v16i16, b: v16i16) -> v8i32 { - __lasx_xvhaddw_w_h(a, b) +pub fn lasx_xvhaddw_w_h(a: v16i16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvhaddw_w_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhaddw_d_w(a: v8i32, b: v8i32) -> v4i64 { - __lasx_xvhaddw_d_w(a, b) +pub fn lasx_xvhaddw_d_w(a: v8i32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvhaddw_d_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhaddw_hu_bu(a: v32u8, b: v32u8) -> v16u16 { - __lasx_xvhaddw_hu_bu(a, b) +pub fn lasx_xvhaddw_hu_bu(a: v32u8, b: v32u8) -> v16u16 { + unsafe { __lasx_xvhaddw_hu_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhaddw_wu_hu(a: v16u16, b: v16u16) -> v8u32 { - __lasx_xvhaddw_wu_hu(a, b) +pub fn lasx_xvhaddw_wu_hu(a: v16u16, b: v16u16) -> v8u32 { + unsafe { __lasx_xvhaddw_wu_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhaddw_du_wu(a: v8u32, b: v8u32) -> v4u64 { - __lasx_xvhaddw_du_wu(a, b) +pub fn lasx_xvhaddw_du_wu(a: v8u32, b: v8u32) -> v4u64 { + unsafe { __lasx_xvhaddw_du_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhsubw_h_b(a: v32i8, b: v32i8) -> v16i16 { - __lasx_xvhsubw_h_b(a, b) +pub fn lasx_xvhsubw_h_b(a: v32i8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvhsubw_h_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhsubw_w_h(a: v16i16, b: v16i16) -> v8i32 { - __lasx_xvhsubw_w_h(a, b) +pub fn lasx_xvhsubw_w_h(a: v16i16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvhsubw_w_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhsubw_d_w(a: v8i32, b: v8i32) -> v4i64 { - __lasx_xvhsubw_d_w(a, b) +pub fn lasx_xvhsubw_d_w(a: v8i32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvhsubw_d_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhsubw_hu_bu(a: v32u8, b: v32u8) -> v16i16 { - __lasx_xvhsubw_hu_bu(a, b) +pub fn lasx_xvhsubw_hu_bu(a: v32u8, b: v32u8) -> v16i16 { + unsafe { __lasx_xvhsubw_hu_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhsubw_wu_hu(a: v16u16, b: v16u16) -> v8i32 { - __lasx_xvhsubw_wu_hu(a, b) +pub fn lasx_xvhsubw_wu_hu(a: v16u16, b: v16u16) -> v8i32 { + unsafe { __lasx_xvhsubw_wu_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhsubw_du_wu(a: v8u32, b: v8u32) -> v4i64 { - __lasx_xvhsubw_du_wu(a, b) +pub fn lasx_xvhsubw_du_wu(a: v8u32, b: v8u32) -> v4i64 { + unsafe { __lasx_xvhsubw_du_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmod_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvmod_b(a, b) +pub fn lasx_xvmod_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvmod_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmod_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvmod_h(a, b) +pub fn lasx_xvmod_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvmod_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmod_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvmod_w(a, b) +pub fn lasx_xvmod_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvmod_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmod_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvmod_d(a, b) +pub fn lasx_xvmod_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvmod_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmod_bu(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvmod_bu(a, b) +pub fn lasx_xvmod_bu(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvmod_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmod_hu(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvmod_hu(a, b) +pub fn lasx_xvmod_hu(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvmod_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmod_wu(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvmod_wu(a, b) +pub fn lasx_xvmod_wu(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvmod_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmod_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvmod_du(a, b) +pub fn lasx_xvmod_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvmod_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrepl128vei_b(a: v32i8) -> v32i8 { +pub fn lasx_xvrepl128vei_b(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvrepl128vei_b(a, IMM4) + unsafe { __lasx_xvrepl128vei_b(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrepl128vei_h(a: v16i16) -> v16i16 { +pub fn lasx_xvrepl128vei_h(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvrepl128vei_h(a, IMM3) + unsafe { __lasx_xvrepl128vei_h(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrepl128vei_w(a: v8i32) -> v8i32 { +pub fn lasx_xvrepl128vei_w(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM2, 2); - __lasx_xvrepl128vei_w(a, IMM2) + unsafe { __lasx_xvrepl128vei_w(a, IMM2) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrepl128vei_d(a: v4i64) -> v4i64 { +pub fn lasx_xvrepl128vei_d(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM1, 1); - __lasx_xvrepl128vei_d(a, IMM1) + unsafe { __lasx_xvrepl128vei_d(a, IMM1) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickev_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvpickev_b(a, b) +pub fn lasx_xvpickev_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvpickev_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickev_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvpickev_h(a, b) +pub fn lasx_xvpickev_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvpickev_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickev_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvpickev_w(a, b) +pub fn lasx_xvpickev_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvpickev_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickev_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvpickev_d(a, b) +pub fn lasx_xvpickev_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvpickev_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickod_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvpickod_b(a, b) +pub fn lasx_xvpickod_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvpickod_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickod_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvpickod_h(a, b) +pub fn lasx_xvpickod_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvpickod_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickod_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvpickod_w(a, b) +pub fn lasx_xvpickod_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvpickod_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickod_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvpickod_d(a, b) +pub fn lasx_xvpickod_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvpickod_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvilvh_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvilvh_b(a, b) +pub fn lasx_xvilvh_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvilvh_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvilvh_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvilvh_h(a, b) +pub fn lasx_xvilvh_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvilvh_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvilvh_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvilvh_w(a, b) +pub fn lasx_xvilvh_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvilvh_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvilvh_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvilvh_d(a, b) +pub fn lasx_xvilvh_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvilvh_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvilvl_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvilvl_b(a, b) +pub fn lasx_xvilvl_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvilvl_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvilvl_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvilvl_h(a, b) +pub fn lasx_xvilvl_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvilvl_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvilvl_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvilvl_w(a, b) +pub fn lasx_xvilvl_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvilvl_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvilvl_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvilvl_d(a, b) +pub fn lasx_xvilvl_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvilvl_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpackev_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvpackev_b(a, b) +pub fn lasx_xvpackev_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvpackev_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpackev_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvpackev_h(a, b) +pub fn lasx_xvpackev_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvpackev_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpackev_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvpackev_w(a, b) +pub fn lasx_xvpackev_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvpackev_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpackev_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvpackev_d(a, b) +pub fn lasx_xvpackev_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvpackev_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpackod_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvpackod_b(a, b) +pub fn lasx_xvpackod_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvpackod_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpackod_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvpackod_h(a, b) +pub fn lasx_xvpackod_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvpackod_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpackod_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvpackod_w(a, b) +pub fn lasx_xvpackod_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvpackod_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpackod_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvpackod_d(a, b) +pub fn lasx_xvpackod_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvpackod_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvshuf_b(a: v32i8, b: v32i8, c: v32i8) -> v32i8 { - __lasx_xvshuf_b(a, b, c) +pub fn lasx_xvshuf_b(a: v32i8, b: v32i8, c: v32i8) -> v32i8 { + unsafe { __lasx_xvshuf_b(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvshuf_h(a: v16i16, b: v16i16, c: v16i16) -> v16i16 { - __lasx_xvshuf_h(a, b, c) +pub fn lasx_xvshuf_h(a: v16i16, b: v16i16, c: v16i16) -> v16i16 { + unsafe { __lasx_xvshuf_h(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvshuf_w(a: v8i32, b: v8i32, c: v8i32) -> v8i32 { - __lasx_xvshuf_w(a, b, c) +pub fn lasx_xvshuf_w(a: v8i32, b: v8i32, c: v8i32) -> v8i32 { + unsafe { __lasx_xvshuf_w(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvshuf_d(a: v4i64, b: v4i64, c: v4i64) -> v4i64 { - __lasx_xvshuf_d(a, b, c) +pub fn lasx_xvshuf_d(a: v4i64, b: v4i64, c: v4i64) -> v4i64 { + unsafe { __lasx_xvshuf_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvand_v(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvand_v(a, b) +pub fn lasx_xvand_v(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvand_v(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvandi_b(a: v32u8) -> v32u8 { +pub fn lasx_xvandi_b(a: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvandi_b(a, IMM8) + unsafe { __lasx_xvandi_b(a, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvor_v(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvor_v(a, b) +pub fn lasx_xvor_v(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvor_v(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvori_b(a: v32u8) -> v32u8 { +pub fn lasx_xvori_b(a: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvori_b(a, IMM8) + unsafe { __lasx_xvori_b(a, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvnor_v(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvnor_v(a, b) +pub fn lasx_xvnor_v(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvnor_v(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvnori_b(a: v32u8) -> v32u8 { +pub fn lasx_xvnori_b(a: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvnori_b(a, IMM8) + unsafe { __lasx_xvnori_b(a, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvxor_v(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvxor_v(a, b) +pub fn lasx_xvxor_v(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvxor_v(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvxori_b(a: v32u8) -> v32u8 { +pub fn lasx_xvxori_b(a: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvxori_b(a, IMM8) + unsafe { __lasx_xvxori_b(a, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitsel_v(a: v32u8, b: v32u8, c: v32u8) -> v32u8 { - __lasx_xvbitsel_v(a, b, c) +pub fn lasx_xvbitsel_v(a: v32u8, b: v32u8, c: v32u8) -> v32u8 { + unsafe { __lasx_xvbitsel_v(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbitseli_b(a: v32u8, b: v32u8) -> v32u8 { +pub fn lasx_xvbitseli_b(a: v32u8, b: v32u8) -> v32u8 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvbitseli_b(a, b, IMM8) + unsafe { __lasx_xvbitseli_b(a, b, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvshuf4i_b(a: v32i8) -> v32i8 { +pub fn lasx_xvshuf4i_b(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvshuf4i_b(a, IMM8) + unsafe { __lasx_xvshuf4i_b(a, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvshuf4i_h(a: v16i16) -> v16i16 { +pub fn lasx_xvshuf4i_h(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvshuf4i_h(a, IMM8) + unsafe { __lasx_xvshuf4i_h(a, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvshuf4i_w(a: v8i32) -> v8i32 { +pub fn lasx_xvshuf4i_w(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvshuf4i_w(a, IMM8) + unsafe { __lasx_xvshuf4i_w(a, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplgr2vr_b(a: i32) -> v32i8 { - __lasx_xvreplgr2vr_b(a) +pub fn lasx_xvreplgr2vr_b(a: i32) -> v32i8 { + unsafe { __lasx_xvreplgr2vr_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplgr2vr_h(a: i32) -> v16i16 { - __lasx_xvreplgr2vr_h(a) +pub fn lasx_xvreplgr2vr_h(a: i32) -> v16i16 { + unsafe { __lasx_xvreplgr2vr_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplgr2vr_w(a: i32) -> v8i32 { - __lasx_xvreplgr2vr_w(a) +pub fn lasx_xvreplgr2vr_w(a: i32) -> v8i32 { + unsafe { __lasx_xvreplgr2vr_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplgr2vr_d(a: i64) -> v4i64 { - __lasx_xvreplgr2vr_d(a) +pub fn lasx_xvreplgr2vr_d(a: i64) -> v4i64 { + unsafe { __lasx_xvreplgr2vr_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpcnt_b(a: v32i8) -> v32i8 { - __lasx_xvpcnt_b(a) +pub fn lasx_xvpcnt_b(a: v32i8) -> v32i8 { + unsafe { __lasx_xvpcnt_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpcnt_h(a: v16i16) -> v16i16 { - __lasx_xvpcnt_h(a) +pub fn lasx_xvpcnt_h(a: v16i16) -> v16i16 { + unsafe { __lasx_xvpcnt_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpcnt_w(a: v8i32) -> v8i32 { - __lasx_xvpcnt_w(a) +pub fn lasx_xvpcnt_w(a: v8i32) -> v8i32 { + unsafe { __lasx_xvpcnt_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpcnt_d(a: v4i64) -> v4i64 { - __lasx_xvpcnt_d(a) +pub fn lasx_xvpcnt_d(a: v4i64) -> v4i64 { + unsafe { __lasx_xvpcnt_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvclo_b(a: v32i8) -> v32i8 { - __lasx_xvclo_b(a) +pub fn lasx_xvclo_b(a: v32i8) -> v32i8 { + unsafe { __lasx_xvclo_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvclo_h(a: v16i16) -> v16i16 { - __lasx_xvclo_h(a) +pub fn lasx_xvclo_h(a: v16i16) -> v16i16 { + unsafe { __lasx_xvclo_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvclo_w(a: v8i32) -> v8i32 { - __lasx_xvclo_w(a) +pub fn lasx_xvclo_w(a: v8i32) -> v8i32 { + unsafe { __lasx_xvclo_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvclo_d(a: v4i64) -> v4i64 { - __lasx_xvclo_d(a) +pub fn lasx_xvclo_d(a: v4i64) -> v4i64 { + unsafe { __lasx_xvclo_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvclz_b(a: v32i8) -> v32i8 { - __lasx_xvclz_b(a) +pub fn lasx_xvclz_b(a: v32i8) -> v32i8 { + unsafe { __lasx_xvclz_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvclz_h(a: v16i16) -> v16i16 { - __lasx_xvclz_h(a) +pub fn lasx_xvclz_h(a: v16i16) -> v16i16 { + unsafe { __lasx_xvclz_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvclz_w(a: v8i32) -> v8i32 { - __lasx_xvclz_w(a) +pub fn lasx_xvclz_w(a: v8i32) -> v8i32 { + unsafe { __lasx_xvclz_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvclz_d(a: v4i64) -> v4i64 { - __lasx_xvclz_d(a) +pub fn lasx_xvclz_d(a: v4i64) -> v4i64 { + unsafe { __lasx_xvclz_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfadd_s(a: v8f32, b: v8f32) -> v8f32 { - __lasx_xvfadd_s(a, b) +pub fn lasx_xvfadd_s(a: v8f32, b: v8f32) -> v8f32 { + unsafe { __lasx_xvfadd_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfadd_d(a: v4f64, b: v4f64) -> v4f64 { - __lasx_xvfadd_d(a, b) +pub fn lasx_xvfadd_d(a: v4f64, b: v4f64) -> v4f64 { + unsafe { __lasx_xvfadd_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfsub_s(a: v8f32, b: v8f32) -> v8f32 { - __lasx_xvfsub_s(a, b) +pub fn lasx_xvfsub_s(a: v8f32, b: v8f32) -> v8f32 { + unsafe { __lasx_xvfsub_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfsub_d(a: v4f64, b: v4f64) -> v4f64 { - __lasx_xvfsub_d(a, b) +pub fn lasx_xvfsub_d(a: v4f64, b: v4f64) -> v4f64 { + unsafe { __lasx_xvfsub_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmul_s(a: v8f32, b: v8f32) -> v8f32 { - __lasx_xvfmul_s(a, b) +pub fn lasx_xvfmul_s(a: v8f32, b: v8f32) -> v8f32 { + unsafe { __lasx_xvfmul_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmul_d(a: v4f64, b: v4f64) -> v4f64 { - __lasx_xvfmul_d(a, b) +pub fn lasx_xvfmul_d(a: v4f64, b: v4f64) -> v4f64 { + unsafe { __lasx_xvfmul_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfdiv_s(a: v8f32, b: v8f32) -> v8f32 { - __lasx_xvfdiv_s(a, b) +pub fn lasx_xvfdiv_s(a: v8f32, b: v8f32) -> v8f32 { + unsafe { __lasx_xvfdiv_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfdiv_d(a: v4f64, b: v4f64) -> v4f64 { - __lasx_xvfdiv_d(a, b) +pub fn lasx_xvfdiv_d(a: v4f64, b: v4f64) -> v4f64 { + unsafe { __lasx_xvfdiv_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcvt_h_s(a: v8f32, b: v8f32) -> v16i16 { - __lasx_xvfcvt_h_s(a, b) +pub fn lasx_xvfcvt_h_s(a: v8f32, b: v8f32) -> v16i16 { + unsafe { __lasx_xvfcvt_h_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcvt_s_d(a: v4f64, b: v4f64) -> v8f32 { - __lasx_xvfcvt_s_d(a, b) +pub fn lasx_xvfcvt_s_d(a: v4f64, b: v4f64) -> v8f32 { + unsafe { __lasx_xvfcvt_s_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmin_s(a: v8f32, b: v8f32) -> v8f32 { - __lasx_xvfmin_s(a, b) +pub fn lasx_xvfmin_s(a: v8f32, b: v8f32) -> v8f32 { + unsafe { __lasx_xvfmin_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmin_d(a: v4f64, b: v4f64) -> v4f64 { - __lasx_xvfmin_d(a, b) +pub fn lasx_xvfmin_d(a: v4f64, b: v4f64) -> v4f64 { + unsafe { __lasx_xvfmin_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmina_s(a: v8f32, b: v8f32) -> v8f32 { - __lasx_xvfmina_s(a, b) +pub fn lasx_xvfmina_s(a: v8f32, b: v8f32) -> v8f32 { + unsafe { __lasx_xvfmina_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmina_d(a: v4f64, b: v4f64) -> v4f64 { - __lasx_xvfmina_d(a, b) +pub fn lasx_xvfmina_d(a: v4f64, b: v4f64) -> v4f64 { + unsafe { __lasx_xvfmina_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmax_s(a: v8f32, b: v8f32) -> v8f32 { - __lasx_xvfmax_s(a, b) +pub fn lasx_xvfmax_s(a: v8f32, b: v8f32) -> v8f32 { + unsafe { __lasx_xvfmax_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmax_d(a: v4f64, b: v4f64) -> v4f64 { - __lasx_xvfmax_d(a, b) +pub fn lasx_xvfmax_d(a: v4f64, b: v4f64) -> v4f64 { + unsafe { __lasx_xvfmax_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmaxa_s(a: v8f32, b: v8f32) -> v8f32 { - __lasx_xvfmaxa_s(a, b) +pub fn lasx_xvfmaxa_s(a: v8f32, b: v8f32) -> v8f32 { + unsafe { __lasx_xvfmaxa_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmaxa_d(a: v4f64, b: v4f64) -> v4f64 { - __lasx_xvfmaxa_d(a, b) +pub fn lasx_xvfmaxa_d(a: v4f64, b: v4f64) -> v4f64 { + unsafe { __lasx_xvfmaxa_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfclass_s(a: v8f32) -> v8i32 { - __lasx_xvfclass_s(a) +pub fn lasx_xvfclass_s(a: v8f32) -> v8i32 { + unsafe { __lasx_xvfclass_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfclass_d(a: v4f64) -> v4i64 { - __lasx_xvfclass_d(a) +pub fn lasx_xvfclass_d(a: v4f64) -> v4i64 { + unsafe { __lasx_xvfclass_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfsqrt_s(a: v8f32) -> v8f32 { - __lasx_xvfsqrt_s(a) +pub fn lasx_xvfsqrt_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvfsqrt_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfsqrt_d(a: v4f64) -> v4f64 { - __lasx_xvfsqrt_d(a) +pub fn lasx_xvfsqrt_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvfsqrt_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrecip_s(a: v8f32) -> v8f32 { - __lasx_xvfrecip_s(a) +pub fn lasx_xvfrecip_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvfrecip_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrecip_d(a: v4f64) -> v4f64 { - __lasx_xvfrecip_d(a) +pub fn lasx_xvfrecip_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvfrecip_d(a) } } #[inline] #[target_feature(enable = "lasx,frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrecipe_s(a: v8f32) -> v8f32 { - __lasx_xvfrecipe_s(a) +pub fn lasx_xvfrecipe_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvfrecipe_s(a) } } #[inline] #[target_feature(enable = "lasx,frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrecipe_d(a: v4f64) -> v4f64 { - __lasx_xvfrecipe_d(a) +pub fn lasx_xvfrecipe_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvfrecipe_d(a) } } #[inline] #[target_feature(enable = "lasx,frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrsqrte_s(a: v8f32) -> v8f32 { - __lasx_xvfrsqrte_s(a) +pub fn lasx_xvfrsqrte_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvfrsqrte_s(a) } } #[inline] #[target_feature(enable = "lasx,frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrsqrte_d(a: v4f64) -> v4f64 { - __lasx_xvfrsqrte_d(a) +pub fn lasx_xvfrsqrte_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvfrsqrte_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrint_s(a: v8f32) -> v8f32 { - __lasx_xvfrint_s(a) +pub fn lasx_xvfrint_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvfrint_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrint_d(a: v4f64) -> v4f64 { - __lasx_xvfrint_d(a) +pub fn lasx_xvfrint_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvfrint_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrsqrt_s(a: v8f32) -> v8f32 { - __lasx_xvfrsqrt_s(a) +pub fn lasx_xvfrsqrt_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvfrsqrt_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrsqrt_d(a: v4f64) -> v4f64 { - __lasx_xvfrsqrt_d(a) +pub fn lasx_xvfrsqrt_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvfrsqrt_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvflogb_s(a: v8f32) -> v8f32 { - __lasx_xvflogb_s(a) +pub fn lasx_xvflogb_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvflogb_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvflogb_d(a: v4f64) -> v4f64 { - __lasx_xvflogb_d(a) +pub fn lasx_xvflogb_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvflogb_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcvth_s_h(a: v16i16) -> v8f32 { - __lasx_xvfcvth_s_h(a) +pub fn lasx_xvfcvth_s_h(a: v16i16) -> v8f32 { + unsafe { __lasx_xvfcvth_s_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcvth_d_s(a: v8f32) -> v4f64 { - __lasx_xvfcvth_d_s(a) +pub fn lasx_xvfcvth_d_s(a: v8f32) -> v4f64 { + unsafe { __lasx_xvfcvth_d_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcvtl_s_h(a: v16i16) -> v8f32 { - __lasx_xvfcvtl_s_h(a) +pub fn lasx_xvfcvtl_s_h(a: v16i16) -> v8f32 { + unsafe { __lasx_xvfcvtl_s_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcvtl_d_s(a: v8f32) -> v4f64 { - __lasx_xvfcvtl_d_s(a) +pub fn lasx_xvfcvtl_d_s(a: v8f32) -> v4f64 { + unsafe { __lasx_xvfcvtl_d_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftint_w_s(a: v8f32) -> v8i32 { - __lasx_xvftint_w_s(a) +pub fn lasx_xvftint_w_s(a: v8f32) -> v8i32 { + unsafe { __lasx_xvftint_w_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftint_l_d(a: v4f64) -> v4i64 { - __lasx_xvftint_l_d(a) +pub fn lasx_xvftint_l_d(a: v4f64) -> v4i64 { + unsafe { __lasx_xvftint_l_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftint_wu_s(a: v8f32) -> v8u32 { - __lasx_xvftint_wu_s(a) +pub fn lasx_xvftint_wu_s(a: v8f32) -> v8u32 { + unsafe { __lasx_xvftint_wu_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftint_lu_d(a: v4f64) -> v4u64 { - __lasx_xvftint_lu_d(a) +pub fn lasx_xvftint_lu_d(a: v4f64) -> v4u64 { + unsafe { __lasx_xvftint_lu_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrz_w_s(a: v8f32) -> v8i32 { - __lasx_xvftintrz_w_s(a) +pub fn lasx_xvftintrz_w_s(a: v8f32) -> v8i32 { + unsafe { __lasx_xvftintrz_w_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrz_l_d(a: v4f64) -> v4i64 { - __lasx_xvftintrz_l_d(a) +pub fn lasx_xvftintrz_l_d(a: v4f64) -> v4i64 { + unsafe { __lasx_xvftintrz_l_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrz_wu_s(a: v8f32) -> v8u32 { - __lasx_xvftintrz_wu_s(a) +pub fn lasx_xvftintrz_wu_s(a: v8f32) -> v8u32 { + unsafe { __lasx_xvftintrz_wu_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrz_lu_d(a: v4f64) -> v4u64 { - __lasx_xvftintrz_lu_d(a) +pub fn lasx_xvftintrz_lu_d(a: v4f64) -> v4u64 { + unsafe { __lasx_xvftintrz_lu_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvffint_s_w(a: v8i32) -> v8f32 { - __lasx_xvffint_s_w(a) +pub fn lasx_xvffint_s_w(a: v8i32) -> v8f32 { + unsafe { __lasx_xvffint_s_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvffint_d_l(a: v4i64) -> v4f64 { - __lasx_xvffint_d_l(a) +pub fn lasx_xvffint_d_l(a: v4i64) -> v4f64 { + unsafe { __lasx_xvffint_d_l(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvffint_s_wu(a: v8u32) -> v8f32 { - __lasx_xvffint_s_wu(a) +pub fn lasx_xvffint_s_wu(a: v8u32) -> v8f32 { + unsafe { __lasx_xvffint_s_wu(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvffint_d_lu(a: v4u64) -> v4f64 { - __lasx_xvffint_d_lu(a) +pub fn lasx_xvffint_d_lu(a: v4u64) -> v4f64 { + unsafe { __lasx_xvffint_d_lu(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplve_b(a: v32i8, b: i32) -> v32i8 { - __lasx_xvreplve_b(a, b) +pub fn lasx_xvreplve_b(a: v32i8, b: i32) -> v32i8 { + unsafe { __lasx_xvreplve_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplve_h(a: v16i16, b: i32) -> v16i16 { - __lasx_xvreplve_h(a, b) +pub fn lasx_xvreplve_h(a: v16i16, b: i32) -> v16i16 { + unsafe { __lasx_xvreplve_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplve_w(a: v8i32, b: i32) -> v8i32 { - __lasx_xvreplve_w(a, b) +pub fn lasx_xvreplve_w(a: v8i32, b: i32) -> v8i32 { + unsafe { __lasx_xvreplve_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplve_d(a: v4i64, b: i32) -> v4i64 { - __lasx_xvreplve_d(a, b) +pub fn lasx_xvreplve_d(a: v4i64, b: i32) -> v4i64 { + unsafe { __lasx_xvreplve_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpermi_w(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvpermi_w(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvpermi_w(a, b, IMM8) + unsafe { __lasx_xvpermi_w(a, b, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvandn_v(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvandn_v(a, b) +pub fn lasx_xvandn_v(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvandn_v(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvneg_b(a: v32i8) -> v32i8 { - __lasx_xvneg_b(a) +pub fn lasx_xvneg_b(a: v32i8) -> v32i8 { + unsafe { __lasx_xvneg_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvneg_h(a: v16i16) -> v16i16 { - __lasx_xvneg_h(a) +pub fn lasx_xvneg_h(a: v16i16) -> v16i16 { + unsafe { __lasx_xvneg_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvneg_w(a: v8i32) -> v8i32 { - __lasx_xvneg_w(a) +pub fn lasx_xvneg_w(a: v8i32) -> v8i32 { + unsafe { __lasx_xvneg_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvneg_d(a: v4i64) -> v4i64 { - __lasx_xvneg_d(a) +pub fn lasx_xvneg_d(a: v4i64) -> v4i64 { + unsafe { __lasx_xvneg_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmuh_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvmuh_b(a, b) +pub fn lasx_xvmuh_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvmuh_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmuh_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvmuh_h(a, b) +pub fn lasx_xvmuh_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvmuh_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmuh_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvmuh_w(a, b) +pub fn lasx_xvmuh_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvmuh_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmuh_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvmuh_d(a, b) +pub fn lasx_xvmuh_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvmuh_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmuh_bu(a: v32u8, b: v32u8) -> v32u8 { - __lasx_xvmuh_bu(a, b) +pub fn lasx_xvmuh_bu(a: v32u8, b: v32u8) -> v32u8 { + unsafe { __lasx_xvmuh_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmuh_hu(a: v16u16, b: v16u16) -> v16u16 { - __lasx_xvmuh_hu(a, b) +pub fn lasx_xvmuh_hu(a: v16u16, b: v16u16) -> v16u16 { + unsafe { __lasx_xvmuh_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmuh_wu(a: v8u32, b: v8u32) -> v8u32 { - __lasx_xvmuh_wu(a, b) +pub fn lasx_xvmuh_wu(a: v8u32, b: v8u32) -> v8u32 { + unsafe { __lasx_xvmuh_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmuh_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvmuh_du(a, b) +pub fn lasx_xvmuh_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvmuh_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsllwil_h_b(a: v32i8) -> v16i16 { +pub fn lasx_xvsllwil_h_b(a: v32i8) -> v16i16 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvsllwil_h_b(a, IMM3) + unsafe { __lasx_xvsllwil_h_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsllwil_w_h(a: v16i16) -> v8i32 { +pub fn lasx_xvsllwil_w_h(a: v16i16) -> v8i32 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsllwil_w_h(a, IMM4) + unsafe { __lasx_xvsllwil_w_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsllwil_d_w(a: v8i32) -> v4i64 { +pub fn lasx_xvsllwil_d_w(a: v8i32) -> v4i64 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsllwil_d_w(a, IMM5) + unsafe { __lasx_xvsllwil_d_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsllwil_hu_bu(a: v32u8) -> v16u16 { +pub fn lasx_xvsllwil_hu_bu(a: v32u8) -> v16u16 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvsllwil_hu_bu(a, IMM3) + unsafe { __lasx_xvsllwil_hu_bu(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsllwil_wu_hu(a: v16u16) -> v8u32 { +pub fn lasx_xvsllwil_wu_hu(a: v16u16) -> v8u32 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsllwil_wu_hu(a, IMM4) + unsafe { __lasx_xvsllwil_wu_hu(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsllwil_du_wu(a: v8u32) -> v4u64 { +pub fn lasx_xvsllwil_du_wu(a: v8u32) -> v4u64 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsllwil_du_wu(a, IMM5) + unsafe { __lasx_xvsllwil_du_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsran_b_h(a: v16i16, b: v16i16) -> v32i8 { - __lasx_xvsran_b_h(a, b) +pub fn lasx_xvsran_b_h(a: v16i16, b: v16i16) -> v32i8 { + unsafe { __lasx_xvsran_b_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsran_h_w(a: v8i32, b: v8i32) -> v16i16 { - __lasx_xvsran_h_w(a, b) +pub fn lasx_xvsran_h_w(a: v8i32, b: v8i32) -> v16i16 { + unsafe { __lasx_xvsran_h_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsran_w_d(a: v4i64, b: v4i64) -> v8i32 { - __lasx_xvsran_w_d(a, b) +pub fn lasx_xvsran_w_d(a: v4i64, b: v4i64) -> v8i32 { + unsafe { __lasx_xvsran_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssran_b_h(a: v16i16, b: v16i16) -> v32i8 { - __lasx_xvssran_b_h(a, b) +pub fn lasx_xvssran_b_h(a: v16i16, b: v16i16) -> v32i8 { + unsafe { __lasx_xvssran_b_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssran_h_w(a: v8i32, b: v8i32) -> v16i16 { - __lasx_xvssran_h_w(a, b) +pub fn lasx_xvssran_h_w(a: v8i32, b: v8i32) -> v16i16 { + unsafe { __lasx_xvssran_h_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssran_w_d(a: v4i64, b: v4i64) -> v8i32 { - __lasx_xvssran_w_d(a, b) +pub fn lasx_xvssran_w_d(a: v4i64, b: v4i64) -> v8i32 { + unsafe { __lasx_xvssran_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssran_bu_h(a: v16u16, b: v16u16) -> v32u8 { - __lasx_xvssran_bu_h(a, b) +pub fn lasx_xvssran_bu_h(a: v16u16, b: v16u16) -> v32u8 { + unsafe { __lasx_xvssran_bu_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssran_hu_w(a: v8u32, b: v8u32) -> v16u16 { - __lasx_xvssran_hu_w(a, b) +pub fn lasx_xvssran_hu_w(a: v8u32, b: v8u32) -> v16u16 { + unsafe { __lasx_xvssran_hu_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssran_wu_d(a: v4u64, b: v4u64) -> v8u32 { - __lasx_xvssran_wu_d(a, b) +pub fn lasx_xvssran_wu_d(a: v4u64, b: v4u64) -> v8u32 { + unsafe { __lasx_xvssran_wu_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrarn_b_h(a: v16i16, b: v16i16) -> v32i8 { - __lasx_xvsrarn_b_h(a, b) +pub fn lasx_xvsrarn_b_h(a: v16i16, b: v16i16) -> v32i8 { + unsafe { __lasx_xvsrarn_b_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrarn_h_w(a: v8i32, b: v8i32) -> v16i16 { - __lasx_xvsrarn_h_w(a, b) +pub fn lasx_xvsrarn_h_w(a: v8i32, b: v8i32) -> v16i16 { + unsafe { __lasx_xvsrarn_h_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrarn_w_d(a: v4i64, b: v4i64) -> v8i32 { - __lasx_xvsrarn_w_d(a, b) +pub fn lasx_xvsrarn_w_d(a: v4i64, b: v4i64) -> v8i32 { + unsafe { __lasx_xvsrarn_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarn_b_h(a: v16i16, b: v16i16) -> v32i8 { - __lasx_xvssrarn_b_h(a, b) +pub fn lasx_xvssrarn_b_h(a: v16i16, b: v16i16) -> v32i8 { + unsafe { __lasx_xvssrarn_b_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarn_h_w(a: v8i32, b: v8i32) -> v16i16 { - __lasx_xvssrarn_h_w(a, b) +pub fn lasx_xvssrarn_h_w(a: v8i32, b: v8i32) -> v16i16 { + unsafe { __lasx_xvssrarn_h_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarn_w_d(a: v4i64, b: v4i64) -> v8i32 { - __lasx_xvssrarn_w_d(a, b) +pub fn lasx_xvssrarn_w_d(a: v4i64, b: v4i64) -> v8i32 { + unsafe { __lasx_xvssrarn_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarn_bu_h(a: v16u16, b: v16u16) -> v32u8 { - __lasx_xvssrarn_bu_h(a, b) +pub fn lasx_xvssrarn_bu_h(a: v16u16, b: v16u16) -> v32u8 { + unsafe { __lasx_xvssrarn_bu_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarn_hu_w(a: v8u32, b: v8u32) -> v16u16 { - __lasx_xvssrarn_hu_w(a, b) +pub fn lasx_xvssrarn_hu_w(a: v8u32, b: v8u32) -> v16u16 { + unsafe { __lasx_xvssrarn_hu_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarn_wu_d(a: v4u64, b: v4u64) -> v8u32 { - __lasx_xvssrarn_wu_d(a, b) +pub fn lasx_xvssrarn_wu_d(a: v4u64, b: v4u64) -> v8u32 { + unsafe { __lasx_xvssrarn_wu_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrln_b_h(a: v16i16, b: v16i16) -> v32i8 { - __lasx_xvsrln_b_h(a, b) +pub fn lasx_xvsrln_b_h(a: v16i16, b: v16i16) -> v32i8 { + unsafe { __lasx_xvsrln_b_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrln_h_w(a: v8i32, b: v8i32) -> v16i16 { - __lasx_xvsrln_h_w(a, b) +pub fn lasx_xvsrln_h_w(a: v8i32, b: v8i32) -> v16i16 { + unsafe { __lasx_xvsrln_h_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrln_w_d(a: v4i64, b: v4i64) -> v8i32 { - __lasx_xvsrln_w_d(a, b) +pub fn lasx_xvsrln_w_d(a: v4i64, b: v4i64) -> v8i32 { + unsafe { __lasx_xvsrln_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrln_bu_h(a: v16u16, b: v16u16) -> v32u8 { - __lasx_xvssrln_bu_h(a, b) +pub fn lasx_xvssrln_bu_h(a: v16u16, b: v16u16) -> v32u8 { + unsafe { __lasx_xvssrln_bu_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrln_hu_w(a: v8u32, b: v8u32) -> v16u16 { - __lasx_xvssrln_hu_w(a, b) +pub fn lasx_xvssrln_hu_w(a: v8u32, b: v8u32) -> v16u16 { + unsafe { __lasx_xvssrln_hu_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrln_wu_d(a: v4u64, b: v4u64) -> v8u32 { - __lasx_xvssrln_wu_d(a, b) +pub fn lasx_xvssrln_wu_d(a: v4u64, b: v4u64) -> v8u32 { + unsafe { __lasx_xvssrln_wu_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlrn_b_h(a: v16i16, b: v16i16) -> v32i8 { - __lasx_xvsrlrn_b_h(a, b) +pub fn lasx_xvsrlrn_b_h(a: v16i16, b: v16i16) -> v32i8 { + unsafe { __lasx_xvsrlrn_b_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlrn_h_w(a: v8i32, b: v8i32) -> v16i16 { - __lasx_xvsrlrn_h_w(a, b) +pub fn lasx_xvsrlrn_h_w(a: v8i32, b: v8i32) -> v16i16 { + unsafe { __lasx_xvsrlrn_h_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlrn_w_d(a: v4i64, b: v4i64) -> v8i32 { - __lasx_xvsrlrn_w_d(a, b) +pub fn lasx_xvsrlrn_w_d(a: v4i64, b: v4i64) -> v8i32 { + unsafe { __lasx_xvsrlrn_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrn_bu_h(a: v16u16, b: v16u16) -> v32u8 { - __lasx_xvssrlrn_bu_h(a, b) +pub fn lasx_xvssrlrn_bu_h(a: v16u16, b: v16u16) -> v32u8 { + unsafe { __lasx_xvssrlrn_bu_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrn_hu_w(a: v8u32, b: v8u32) -> v16u16 { - __lasx_xvssrlrn_hu_w(a, b) +pub fn lasx_xvssrlrn_hu_w(a: v8u32, b: v8u32) -> v16u16 { + unsafe { __lasx_xvssrlrn_hu_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrn_wu_d(a: v4u64, b: v4u64) -> v8u32 { - __lasx_xvssrlrn_wu_d(a, b) +pub fn lasx_xvssrlrn_wu_d(a: v4u64, b: v4u64) -> v8u32 { + unsafe { __lasx_xvssrlrn_wu_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrstpi_b(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvfrstpi_b(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvfrstpi_b(a, b, IMM5) + unsafe { __lasx_xvfrstpi_b(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrstpi_h(a: v16i16, b: v16i16) -> v16i16 { +pub fn lasx_xvfrstpi_h(a: v16i16, b: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvfrstpi_h(a, b, IMM5) + unsafe { __lasx_xvfrstpi_h(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrstp_b(a: v32i8, b: v32i8, c: v32i8) -> v32i8 { - __lasx_xvfrstp_b(a, b, c) +pub fn lasx_xvfrstp_b(a: v32i8, b: v32i8, c: v32i8) -> v32i8 { + unsafe { __lasx_xvfrstp_b(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrstp_h(a: v16i16, b: v16i16, c: v16i16) -> v16i16 { - __lasx_xvfrstp_h(a, b, c) +pub fn lasx_xvfrstp_h(a: v16i16, b: v16i16, c: v16i16) -> v16i16 { + unsafe { __lasx_xvfrstp_h(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvshuf4i_d(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvshuf4i_d(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvshuf4i_d(a, b, IMM8) + unsafe { __lasx_xvshuf4i_d(a, b, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbsrl_v(a: v32i8) -> v32i8 { +pub fn lasx_xvbsrl_v(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvbsrl_v(a, IMM5) + unsafe { __lasx_xvbsrl_v(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvbsll_v(a: v32i8) -> v32i8 { +pub fn lasx_xvbsll_v(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvbsll_v(a, IMM5) + unsafe { __lasx_xvbsll_v(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvextrins_b(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvextrins_b(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvextrins_b(a, b, IMM8) + unsafe { __lasx_xvextrins_b(a, b, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvextrins_h(a: v16i16, b: v16i16) -> v16i16 { +pub fn lasx_xvextrins_h(a: v16i16, b: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvextrins_h(a, b, IMM8) + unsafe { __lasx_xvextrins_h(a, b, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvextrins_w(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvextrins_w(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvextrins_w(a, b, IMM8) + unsafe { __lasx_xvextrins_w(a, b, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvextrins_d(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvextrins_d(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvextrins_d(a, b, IMM8) + unsafe { __lasx_xvextrins_d(a, b, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmskltz_b(a: v32i8) -> v32i8 { - __lasx_xvmskltz_b(a) +pub fn lasx_xvmskltz_b(a: v32i8) -> v32i8 { + unsafe { __lasx_xvmskltz_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmskltz_h(a: v16i16) -> v16i16 { - __lasx_xvmskltz_h(a) +pub fn lasx_xvmskltz_h(a: v16i16) -> v16i16 { + unsafe { __lasx_xvmskltz_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmskltz_w(a: v8i32) -> v8i32 { - __lasx_xvmskltz_w(a) +pub fn lasx_xvmskltz_w(a: v8i32) -> v8i32 { + unsafe { __lasx_xvmskltz_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmskltz_d(a: v4i64) -> v4i64 { - __lasx_xvmskltz_d(a) +pub fn lasx_xvmskltz_d(a: v4i64) -> v4i64 { + unsafe { __lasx_xvmskltz_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsigncov_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvsigncov_b(a, b) +pub fn lasx_xvsigncov_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvsigncov_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsigncov_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvsigncov_h(a, b) +pub fn lasx_xvsigncov_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvsigncov_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsigncov_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvsigncov_w(a, b) +pub fn lasx_xvsigncov_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvsigncov_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsigncov_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsigncov_d(a, b) +pub fn lasx_xvsigncov_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsigncov_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmadd_s(a: v8f32, b: v8f32, c: v8f32) -> v8f32 { - __lasx_xvfmadd_s(a, b, c) +pub fn lasx_xvfmadd_s(a: v8f32, b: v8f32, c: v8f32) -> v8f32 { + unsafe { __lasx_xvfmadd_s(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmadd_d(a: v4f64, b: v4f64, c: v4f64) -> v4f64 { - __lasx_xvfmadd_d(a, b, c) +pub fn lasx_xvfmadd_d(a: v4f64, b: v4f64, c: v4f64) -> v4f64 { + unsafe { __lasx_xvfmadd_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmsub_s(a: v8f32, b: v8f32, c: v8f32) -> v8f32 { - __lasx_xvfmsub_s(a, b, c) +pub fn lasx_xvfmsub_s(a: v8f32, b: v8f32, c: v8f32) -> v8f32 { + unsafe { __lasx_xvfmsub_s(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfmsub_d(a: v4f64, b: v4f64, c: v4f64) -> v4f64 { - __lasx_xvfmsub_d(a, b, c) +pub fn lasx_xvfmsub_d(a: v4f64, b: v4f64, c: v4f64) -> v4f64 { + unsafe { __lasx_xvfmsub_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfnmadd_s(a: v8f32, b: v8f32, c: v8f32) -> v8f32 { - __lasx_xvfnmadd_s(a, b, c) +pub fn lasx_xvfnmadd_s(a: v8f32, b: v8f32, c: v8f32) -> v8f32 { + unsafe { __lasx_xvfnmadd_s(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfnmadd_d(a: v4f64, b: v4f64, c: v4f64) -> v4f64 { - __lasx_xvfnmadd_d(a, b, c) +pub fn lasx_xvfnmadd_d(a: v4f64, b: v4f64, c: v4f64) -> v4f64 { + unsafe { __lasx_xvfnmadd_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfnmsub_s(a: v8f32, b: v8f32, c: v8f32) -> v8f32 { - __lasx_xvfnmsub_s(a, b, c) +pub fn lasx_xvfnmsub_s(a: v8f32, b: v8f32, c: v8f32) -> v8f32 { + unsafe { __lasx_xvfnmsub_s(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfnmsub_d(a: v4f64, b: v4f64, c: v4f64) -> v4f64 { - __lasx_xvfnmsub_d(a, b, c) +pub fn lasx_xvfnmsub_d(a: v4f64, b: v4f64, c: v4f64) -> v4f64 { + unsafe { __lasx_xvfnmsub_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrne_w_s(a: v8f32) -> v8i32 { - __lasx_xvftintrne_w_s(a) +pub fn lasx_xvftintrne_w_s(a: v8f32) -> v8i32 { + unsafe { __lasx_xvftintrne_w_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrne_l_d(a: v4f64) -> v4i64 { - __lasx_xvftintrne_l_d(a) +pub fn lasx_xvftintrne_l_d(a: v4f64) -> v4i64 { + unsafe { __lasx_xvftintrne_l_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrp_w_s(a: v8f32) -> v8i32 { - __lasx_xvftintrp_w_s(a) +pub fn lasx_xvftintrp_w_s(a: v8f32) -> v8i32 { + unsafe { __lasx_xvftintrp_w_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrp_l_d(a: v4f64) -> v4i64 { - __lasx_xvftintrp_l_d(a) +pub fn lasx_xvftintrp_l_d(a: v4f64) -> v4i64 { + unsafe { __lasx_xvftintrp_l_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrm_w_s(a: v8f32) -> v8i32 { - __lasx_xvftintrm_w_s(a) +pub fn lasx_xvftintrm_w_s(a: v8f32) -> v8i32 { + unsafe { __lasx_xvftintrm_w_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrm_l_d(a: v4f64) -> v4i64 { - __lasx_xvftintrm_l_d(a) +pub fn lasx_xvftintrm_l_d(a: v4f64) -> v4i64 { + unsafe { __lasx_xvftintrm_l_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftint_w_d(a: v4f64, b: v4f64) -> v8i32 { - __lasx_xvftint_w_d(a, b) +pub fn lasx_xvftint_w_d(a: v4f64, b: v4f64) -> v8i32 { + unsafe { __lasx_xvftint_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvffint_s_l(a: v4i64, b: v4i64) -> v8f32 { - __lasx_xvffint_s_l(a, b) +pub fn lasx_xvffint_s_l(a: v4i64, b: v4i64) -> v8f32 { + unsafe { __lasx_xvffint_s_l(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrz_w_d(a: v4f64, b: v4f64) -> v8i32 { - __lasx_xvftintrz_w_d(a, b) +pub fn lasx_xvftintrz_w_d(a: v4f64, b: v4f64) -> v8i32 { + unsafe { __lasx_xvftintrz_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrp_w_d(a: v4f64, b: v4f64) -> v8i32 { - __lasx_xvftintrp_w_d(a, b) +pub fn lasx_xvftintrp_w_d(a: v4f64, b: v4f64) -> v8i32 { + unsafe { __lasx_xvftintrp_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrm_w_d(a: v4f64, b: v4f64) -> v8i32 { - __lasx_xvftintrm_w_d(a, b) +pub fn lasx_xvftintrm_w_d(a: v4f64, b: v4f64) -> v8i32 { + unsafe { __lasx_xvftintrm_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrne_w_d(a: v4f64, b: v4f64) -> v8i32 { - __lasx_xvftintrne_w_d(a, b) +pub fn lasx_xvftintrne_w_d(a: v4f64, b: v4f64) -> v8i32 { + unsafe { __lasx_xvftintrne_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftinth_l_s(a: v8f32) -> v4i64 { - __lasx_xvftinth_l_s(a) +pub fn lasx_xvftinth_l_s(a: v8f32) -> v4i64 { + unsafe { __lasx_xvftinth_l_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintl_l_s(a: v8f32) -> v4i64 { - __lasx_xvftintl_l_s(a) +pub fn lasx_xvftintl_l_s(a: v8f32) -> v4i64 { + unsafe { __lasx_xvftintl_l_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvffinth_d_w(a: v8i32) -> v4f64 { - __lasx_xvffinth_d_w(a) +pub fn lasx_xvffinth_d_w(a: v8i32) -> v4f64 { + unsafe { __lasx_xvffinth_d_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvffintl_d_w(a: v8i32) -> v4f64 { - __lasx_xvffintl_d_w(a) +pub fn lasx_xvffintl_d_w(a: v8i32) -> v4f64 { + unsafe { __lasx_xvffintl_d_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrzh_l_s(a: v8f32) -> v4i64 { - __lasx_xvftintrzh_l_s(a) +pub fn lasx_xvftintrzh_l_s(a: v8f32) -> v4i64 { + unsafe { __lasx_xvftintrzh_l_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrzl_l_s(a: v8f32) -> v4i64 { - __lasx_xvftintrzl_l_s(a) +pub fn lasx_xvftintrzl_l_s(a: v8f32) -> v4i64 { + unsafe { __lasx_xvftintrzl_l_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrph_l_s(a: v8f32) -> v4i64 { - __lasx_xvftintrph_l_s(a) +pub fn lasx_xvftintrph_l_s(a: v8f32) -> v4i64 { + unsafe { __lasx_xvftintrph_l_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrpl_l_s(a: v8f32) -> v4i64 { - __lasx_xvftintrpl_l_s(a) +pub fn lasx_xvftintrpl_l_s(a: v8f32) -> v4i64 { + unsafe { __lasx_xvftintrpl_l_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrmh_l_s(a: v8f32) -> v4i64 { - __lasx_xvftintrmh_l_s(a) +pub fn lasx_xvftintrmh_l_s(a: v8f32) -> v4i64 { + unsafe { __lasx_xvftintrmh_l_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrml_l_s(a: v8f32) -> v4i64 { - __lasx_xvftintrml_l_s(a) +pub fn lasx_xvftintrml_l_s(a: v8f32) -> v4i64 { + unsafe { __lasx_xvftintrml_l_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrneh_l_s(a: v8f32) -> v4i64 { - __lasx_xvftintrneh_l_s(a) +pub fn lasx_xvftintrneh_l_s(a: v8f32) -> v4i64 { + unsafe { __lasx_xvftintrneh_l_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvftintrnel_l_s(a: v8f32) -> v4i64 { - __lasx_xvftintrnel_l_s(a) +pub fn lasx_xvftintrnel_l_s(a: v8f32) -> v4i64 { + unsafe { __lasx_xvftintrnel_l_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrintrne_s(a: v8f32) -> v8f32 { - __lasx_xvfrintrne_s(a) +pub fn lasx_xvfrintrne_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvfrintrne_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrintrne_d(a: v4f64) -> v4f64 { - __lasx_xvfrintrne_d(a) +pub fn lasx_xvfrintrne_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvfrintrne_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrintrz_s(a: v8f32) -> v8f32 { - __lasx_xvfrintrz_s(a) +pub fn lasx_xvfrintrz_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvfrintrz_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrintrz_d(a: v4f64) -> v4f64 { - __lasx_xvfrintrz_d(a) +pub fn lasx_xvfrintrz_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvfrintrz_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrintrp_s(a: v8f32) -> v8f32 { - __lasx_xvfrintrp_s(a) +pub fn lasx_xvfrintrp_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvfrintrp_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrintrp_d(a: v4f64) -> v4f64 { - __lasx_xvfrintrp_d(a) +pub fn lasx_xvfrintrp_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvfrintrp_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrintrm_s(a: v8f32) -> v8f32 { - __lasx_xvfrintrm_s(a) +pub fn lasx_xvfrintrm_s(a: v8f32) -> v8f32 { + unsafe { __lasx_xvfrintrm_s(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfrintrm_d(a: v4f64) -> v4f64 { - __lasx_xvfrintrm_d(a) +pub fn lasx_xvfrintrm_d(a: v4f64) -> v4f64 { + unsafe { __lasx_xvfrintrm_d(a) } } #[inline] @@ -5054,94 +5054,94 @@ pub unsafe fn lasx_xvstelm_d(a: v4i64, mem_a #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvinsve0_w(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvinsve0_w(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvinsve0_w(a, b, IMM3) + unsafe { __lasx_xvinsve0_w(a, b, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvinsve0_d(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvinsve0_d(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM2, 2); - __lasx_xvinsve0_d(a, b, IMM2) + unsafe { __lasx_xvinsve0_d(a, b, IMM2) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickve_w(a: v8i32) -> v8i32 { +pub fn lasx_xvpickve_w(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvpickve_w(a, IMM3) + unsafe { __lasx_xvpickve_w(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickve_d(a: v4i64) -> v4i64 { +pub fn lasx_xvpickve_d(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM2, 2); - __lasx_xvpickve_d(a, IMM2) + unsafe { __lasx_xvpickve_d(a, IMM2) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrn_b_h(a: v16i16, b: v16i16) -> v32i8 { - __lasx_xvssrlrn_b_h(a, b) +pub fn lasx_xvssrlrn_b_h(a: v16i16, b: v16i16) -> v32i8 { + unsafe { __lasx_xvssrlrn_b_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrn_h_w(a: v8i32, b: v8i32) -> v16i16 { - __lasx_xvssrlrn_h_w(a, b) +pub fn lasx_xvssrlrn_h_w(a: v8i32, b: v8i32) -> v16i16 { + unsafe { __lasx_xvssrlrn_h_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrn_w_d(a: v4i64, b: v4i64) -> v8i32 { - __lasx_xvssrlrn_w_d(a, b) +pub fn lasx_xvssrlrn_w_d(a: v4i64, b: v4i64) -> v8i32 { + unsafe { __lasx_xvssrlrn_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrln_b_h(a: v16i16, b: v16i16) -> v32i8 { - __lasx_xvssrln_b_h(a, b) +pub fn lasx_xvssrln_b_h(a: v16i16, b: v16i16) -> v32i8 { + unsafe { __lasx_xvssrln_b_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrln_h_w(a: v8i32, b: v8i32) -> v16i16 { - __lasx_xvssrln_h_w(a, b) +pub fn lasx_xvssrln_h_w(a: v8i32, b: v8i32) -> v16i16 { + unsafe { __lasx_xvssrln_h_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrln_w_d(a: v4i64, b: v4i64) -> v8i32 { - __lasx_xvssrln_w_d(a, b) +pub fn lasx_xvssrln_w_d(a: v4i64, b: v4i64) -> v8i32 { + unsafe { __lasx_xvssrln_w_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvorn_v(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvorn_v(a, b) +pub fn lasx_xvorn_v(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvorn_v(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(0)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvldi() -> v4i64 { +pub fn lasx_xvldi() -> v4i64 { static_assert_simm_bits!(IMM_S13, 13); - __lasx_xvldi(IMM_S13) + unsafe { __lasx_xvldi(IMM_S13) } } #[inline] @@ -5161,170 +5161,170 @@ pub unsafe fn lasx_xvstx(a: v32i8, mem_addr: *mut i8, b: i64) { #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvextl_qu_du(a: v4u64) -> v4u64 { - __lasx_xvextl_qu_du(a) +pub fn lasx_xvextl_qu_du(a: v4u64) -> v4u64 { + unsafe { __lasx_xvextl_qu_du(a) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvinsgr2vr_w(a: v8i32, b: i32) -> v8i32 { +pub fn lasx_xvinsgr2vr_w(a: v8i32, b: i32) -> v8i32 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvinsgr2vr_w(a, b, IMM3) + unsafe { __lasx_xvinsgr2vr_w(a, b, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvinsgr2vr_d(a: v4i64, b: i64) -> v4i64 { +pub fn lasx_xvinsgr2vr_d(a: v4i64, b: i64) -> v4i64 { static_assert_uimm_bits!(IMM2, 2); - __lasx_xvinsgr2vr_d(a, b, IMM2) + unsafe { __lasx_xvinsgr2vr_d(a, b, IMM2) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplve0_b(a: v32i8) -> v32i8 { - __lasx_xvreplve0_b(a) +pub fn lasx_xvreplve0_b(a: v32i8) -> v32i8 { + unsafe { __lasx_xvreplve0_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplve0_h(a: v16i16) -> v16i16 { - __lasx_xvreplve0_h(a) +pub fn lasx_xvreplve0_h(a: v16i16) -> v16i16 { + unsafe { __lasx_xvreplve0_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplve0_w(a: v8i32) -> v8i32 { - __lasx_xvreplve0_w(a) +pub fn lasx_xvreplve0_w(a: v8i32) -> v8i32 { + unsafe { __lasx_xvreplve0_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplve0_d(a: v4i64) -> v4i64 { - __lasx_xvreplve0_d(a) +pub fn lasx_xvreplve0_d(a: v4i64) -> v4i64 { + unsafe { __lasx_xvreplve0_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvreplve0_q(a: v32i8) -> v32i8 { - __lasx_xvreplve0_q(a) +pub fn lasx_xvreplve0_q(a: v32i8) -> v32i8 { + unsafe { __lasx_xvreplve0_q(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_h_b(a: v32i8) -> v16i16 { - __lasx_vext2xv_h_b(a) +pub fn lasx_vext2xv_h_b(a: v32i8) -> v16i16 { + unsafe { __lasx_vext2xv_h_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_w_h(a: v16i16) -> v8i32 { - __lasx_vext2xv_w_h(a) +pub fn lasx_vext2xv_w_h(a: v16i16) -> v8i32 { + unsafe { __lasx_vext2xv_w_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_d_w(a: v8i32) -> v4i64 { - __lasx_vext2xv_d_w(a) +pub fn lasx_vext2xv_d_w(a: v8i32) -> v4i64 { + unsafe { __lasx_vext2xv_d_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_w_b(a: v32i8) -> v8i32 { - __lasx_vext2xv_w_b(a) +pub fn lasx_vext2xv_w_b(a: v32i8) -> v8i32 { + unsafe { __lasx_vext2xv_w_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_d_h(a: v16i16) -> v4i64 { - __lasx_vext2xv_d_h(a) +pub fn lasx_vext2xv_d_h(a: v16i16) -> v4i64 { + unsafe { __lasx_vext2xv_d_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_d_b(a: v32i8) -> v4i64 { - __lasx_vext2xv_d_b(a) +pub fn lasx_vext2xv_d_b(a: v32i8) -> v4i64 { + unsafe { __lasx_vext2xv_d_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_hu_bu(a: v32i8) -> v16i16 { - __lasx_vext2xv_hu_bu(a) +pub fn lasx_vext2xv_hu_bu(a: v32i8) -> v16i16 { + unsafe { __lasx_vext2xv_hu_bu(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_wu_hu(a: v16i16) -> v8i32 { - __lasx_vext2xv_wu_hu(a) +pub fn lasx_vext2xv_wu_hu(a: v16i16) -> v8i32 { + unsafe { __lasx_vext2xv_wu_hu(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_du_wu(a: v8i32) -> v4i64 { - __lasx_vext2xv_du_wu(a) +pub fn lasx_vext2xv_du_wu(a: v8i32) -> v4i64 { + unsafe { __lasx_vext2xv_du_wu(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_wu_bu(a: v32i8) -> v8i32 { - __lasx_vext2xv_wu_bu(a) +pub fn lasx_vext2xv_wu_bu(a: v32i8) -> v8i32 { + unsafe { __lasx_vext2xv_wu_bu(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_du_hu(a: v16i16) -> v4i64 { - __lasx_vext2xv_du_hu(a) +pub fn lasx_vext2xv_du_hu(a: v16i16) -> v4i64 { + unsafe { __lasx_vext2xv_du_hu(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_vext2xv_du_bu(a: v32i8) -> v4i64 { - __lasx_vext2xv_du_bu(a) +pub fn lasx_vext2xv_du_bu(a: v32i8) -> v4i64 { + unsafe { __lasx_vext2xv_du_bu(a) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpermi_q(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvpermi_q(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvpermi_q(a, b, IMM8) + unsafe { __lasx_xvpermi_q(a, b, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpermi_d(a: v4i64) -> v4i64 { +pub fn lasx_xvpermi_d(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM8, 8); - __lasx_xvpermi_d(a, IMM8) + unsafe { __lasx_xvpermi_d(a, IMM8) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvperm_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvperm_w(a, b) +pub fn lasx_xvperm_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvperm_w(a, b) } } #[inline] @@ -5367,1697 +5367,1697 @@ pub unsafe fn lasx_xvldrepl_d(mem_addr: *const i8) -> v4i64 { #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickve2gr_w(a: v8i32) -> i32 { +pub fn lasx_xvpickve2gr_w(a: v8i32) -> i32 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvpickve2gr_w(a, IMM3) + unsafe { __lasx_xvpickve2gr_w(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickve2gr_wu(a: v8i32) -> u32 { +pub fn lasx_xvpickve2gr_wu(a: v8i32) -> u32 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvpickve2gr_wu(a, IMM3) + unsafe { __lasx_xvpickve2gr_wu(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickve2gr_d(a: v4i64) -> i64 { +pub fn lasx_xvpickve2gr_d(a: v4i64) -> i64 { static_assert_uimm_bits!(IMM2, 2); - __lasx_xvpickve2gr_d(a, IMM2) + unsafe { __lasx_xvpickve2gr_d(a, IMM2) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickve2gr_du(a: v4i64) -> u64 { +pub fn lasx_xvpickve2gr_du(a: v4i64) -> u64 { static_assert_uimm_bits!(IMM2, 2); - __lasx_xvpickve2gr_du(a, IMM2) + unsafe { __lasx_xvpickve2gr_du(a, IMM2) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_q_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvaddwev_q_d(a, b) +pub fn lasx_xvaddwev_q_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvaddwev_q_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_d_w(a: v8i32, b: v8i32) -> v4i64 { - __lasx_xvaddwev_d_w(a, b) +pub fn lasx_xvaddwev_d_w(a: v8i32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvaddwev_d_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_w_h(a: v16i16, b: v16i16) -> v8i32 { - __lasx_xvaddwev_w_h(a, b) +pub fn lasx_xvaddwev_w_h(a: v16i16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvaddwev_w_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_h_b(a: v32i8, b: v32i8) -> v16i16 { - __lasx_xvaddwev_h_b(a, b) +pub fn lasx_xvaddwev_h_b(a: v32i8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvaddwev_h_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_q_du(a: v4u64, b: v4u64) -> v4i64 { - __lasx_xvaddwev_q_du(a, b) +pub fn lasx_xvaddwev_q_du(a: v4u64, b: v4u64) -> v4i64 { + unsafe { __lasx_xvaddwev_q_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_d_wu(a: v8u32, b: v8u32) -> v4i64 { - __lasx_xvaddwev_d_wu(a, b) +pub fn lasx_xvaddwev_d_wu(a: v8u32, b: v8u32) -> v4i64 { + unsafe { __lasx_xvaddwev_d_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_w_hu(a: v16u16, b: v16u16) -> v8i32 { - __lasx_xvaddwev_w_hu(a, b) +pub fn lasx_xvaddwev_w_hu(a: v16u16, b: v16u16) -> v8i32 { + unsafe { __lasx_xvaddwev_w_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_h_bu(a: v32u8, b: v32u8) -> v16i16 { - __lasx_xvaddwev_h_bu(a, b) +pub fn lasx_xvaddwev_h_bu(a: v32u8, b: v32u8) -> v16i16 { + unsafe { __lasx_xvaddwev_h_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwev_q_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsubwev_q_d(a, b) +pub fn lasx_xvsubwev_q_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsubwev_q_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwev_d_w(a: v8i32, b: v8i32) -> v4i64 { - __lasx_xvsubwev_d_w(a, b) +pub fn lasx_xvsubwev_d_w(a: v8i32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvsubwev_d_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwev_w_h(a: v16i16, b: v16i16) -> v8i32 { - __lasx_xvsubwev_w_h(a, b) +pub fn lasx_xvsubwev_w_h(a: v16i16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvsubwev_w_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwev_h_b(a: v32i8, b: v32i8) -> v16i16 { - __lasx_xvsubwev_h_b(a, b) +pub fn lasx_xvsubwev_h_b(a: v32i8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvsubwev_h_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwev_q_du(a: v4u64, b: v4u64) -> v4i64 { - __lasx_xvsubwev_q_du(a, b) +pub fn lasx_xvsubwev_q_du(a: v4u64, b: v4u64) -> v4i64 { + unsafe { __lasx_xvsubwev_q_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwev_d_wu(a: v8u32, b: v8u32) -> v4i64 { - __lasx_xvsubwev_d_wu(a, b) +pub fn lasx_xvsubwev_d_wu(a: v8u32, b: v8u32) -> v4i64 { + unsafe { __lasx_xvsubwev_d_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwev_w_hu(a: v16u16, b: v16u16) -> v8i32 { - __lasx_xvsubwev_w_hu(a, b) +pub fn lasx_xvsubwev_w_hu(a: v16u16, b: v16u16) -> v8i32 { + unsafe { __lasx_xvsubwev_w_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwev_h_bu(a: v32u8, b: v32u8) -> v16i16 { - __lasx_xvsubwev_h_bu(a, b) +pub fn lasx_xvsubwev_h_bu(a: v32u8, b: v32u8) -> v16i16 { + unsafe { __lasx_xvsubwev_h_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_q_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvmulwev_q_d(a, b) +pub fn lasx_xvmulwev_q_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvmulwev_q_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_d_w(a: v8i32, b: v8i32) -> v4i64 { - __lasx_xvmulwev_d_w(a, b) +pub fn lasx_xvmulwev_d_w(a: v8i32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvmulwev_d_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_w_h(a: v16i16, b: v16i16) -> v8i32 { - __lasx_xvmulwev_w_h(a, b) +pub fn lasx_xvmulwev_w_h(a: v16i16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvmulwev_w_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_h_b(a: v32i8, b: v32i8) -> v16i16 { - __lasx_xvmulwev_h_b(a, b) +pub fn lasx_xvmulwev_h_b(a: v32i8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvmulwev_h_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_q_du(a: v4u64, b: v4u64) -> v4i64 { - __lasx_xvmulwev_q_du(a, b) +pub fn lasx_xvmulwev_q_du(a: v4u64, b: v4u64) -> v4i64 { + unsafe { __lasx_xvmulwev_q_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_d_wu(a: v8u32, b: v8u32) -> v4i64 { - __lasx_xvmulwev_d_wu(a, b) +pub fn lasx_xvmulwev_d_wu(a: v8u32, b: v8u32) -> v4i64 { + unsafe { __lasx_xvmulwev_d_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_w_hu(a: v16u16, b: v16u16) -> v8i32 { - __lasx_xvmulwev_w_hu(a, b) +pub fn lasx_xvmulwev_w_hu(a: v16u16, b: v16u16) -> v8i32 { + unsafe { __lasx_xvmulwev_w_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_h_bu(a: v32u8, b: v32u8) -> v16i16 { - __lasx_xvmulwev_h_bu(a, b) +pub fn lasx_xvmulwev_h_bu(a: v32u8, b: v32u8) -> v16i16 { + unsafe { __lasx_xvmulwev_h_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_q_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvaddwod_q_d(a, b) +pub fn lasx_xvaddwod_q_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvaddwod_q_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_d_w(a: v8i32, b: v8i32) -> v4i64 { - __lasx_xvaddwod_d_w(a, b) +pub fn lasx_xvaddwod_d_w(a: v8i32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvaddwod_d_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_w_h(a: v16i16, b: v16i16) -> v8i32 { - __lasx_xvaddwod_w_h(a, b) +pub fn lasx_xvaddwod_w_h(a: v16i16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvaddwod_w_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_h_b(a: v32i8, b: v32i8) -> v16i16 { - __lasx_xvaddwod_h_b(a, b) +pub fn lasx_xvaddwod_h_b(a: v32i8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvaddwod_h_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_q_du(a: v4u64, b: v4u64) -> v4i64 { - __lasx_xvaddwod_q_du(a, b) +pub fn lasx_xvaddwod_q_du(a: v4u64, b: v4u64) -> v4i64 { + unsafe { __lasx_xvaddwod_q_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_d_wu(a: v8u32, b: v8u32) -> v4i64 { - __lasx_xvaddwod_d_wu(a, b) +pub fn lasx_xvaddwod_d_wu(a: v8u32, b: v8u32) -> v4i64 { + unsafe { __lasx_xvaddwod_d_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_w_hu(a: v16u16, b: v16u16) -> v8i32 { - __lasx_xvaddwod_w_hu(a, b) +pub fn lasx_xvaddwod_w_hu(a: v16u16, b: v16u16) -> v8i32 { + unsafe { __lasx_xvaddwod_w_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_h_bu(a: v32u8, b: v32u8) -> v16i16 { - __lasx_xvaddwod_h_bu(a, b) +pub fn lasx_xvaddwod_h_bu(a: v32u8, b: v32u8) -> v16i16 { + unsafe { __lasx_xvaddwod_h_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwod_q_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsubwod_q_d(a, b) +pub fn lasx_xvsubwod_q_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsubwod_q_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwod_d_w(a: v8i32, b: v8i32) -> v4i64 { - __lasx_xvsubwod_d_w(a, b) +pub fn lasx_xvsubwod_d_w(a: v8i32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvsubwod_d_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwod_w_h(a: v16i16, b: v16i16) -> v8i32 { - __lasx_xvsubwod_w_h(a, b) +pub fn lasx_xvsubwod_w_h(a: v16i16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvsubwod_w_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwod_h_b(a: v32i8, b: v32i8) -> v16i16 { - __lasx_xvsubwod_h_b(a, b) +pub fn lasx_xvsubwod_h_b(a: v32i8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvsubwod_h_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwod_q_du(a: v4u64, b: v4u64) -> v4i64 { - __lasx_xvsubwod_q_du(a, b) +pub fn lasx_xvsubwod_q_du(a: v4u64, b: v4u64) -> v4i64 { + unsafe { __lasx_xvsubwod_q_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwod_d_wu(a: v8u32, b: v8u32) -> v4i64 { - __lasx_xvsubwod_d_wu(a, b) +pub fn lasx_xvsubwod_d_wu(a: v8u32, b: v8u32) -> v4i64 { + unsafe { __lasx_xvsubwod_d_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwod_w_hu(a: v16u16, b: v16u16) -> v8i32 { - __lasx_xvsubwod_w_hu(a, b) +pub fn lasx_xvsubwod_w_hu(a: v16u16, b: v16u16) -> v8i32 { + unsafe { __lasx_xvsubwod_w_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsubwod_h_bu(a: v32u8, b: v32u8) -> v16i16 { - __lasx_xvsubwod_h_bu(a, b) +pub fn lasx_xvsubwod_h_bu(a: v32u8, b: v32u8) -> v16i16 { + unsafe { __lasx_xvsubwod_h_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_q_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvmulwod_q_d(a, b) +pub fn lasx_xvmulwod_q_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvmulwod_q_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_d_w(a: v8i32, b: v8i32) -> v4i64 { - __lasx_xvmulwod_d_w(a, b) +pub fn lasx_xvmulwod_d_w(a: v8i32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvmulwod_d_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_w_h(a: v16i16, b: v16i16) -> v8i32 { - __lasx_xvmulwod_w_h(a, b) +pub fn lasx_xvmulwod_w_h(a: v16i16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvmulwod_w_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_h_b(a: v32i8, b: v32i8) -> v16i16 { - __lasx_xvmulwod_h_b(a, b) +pub fn lasx_xvmulwod_h_b(a: v32i8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvmulwod_h_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_q_du(a: v4u64, b: v4u64) -> v4i64 { - __lasx_xvmulwod_q_du(a, b) +pub fn lasx_xvmulwod_q_du(a: v4u64, b: v4u64) -> v4i64 { + unsafe { __lasx_xvmulwod_q_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_d_wu(a: v8u32, b: v8u32) -> v4i64 { - __lasx_xvmulwod_d_wu(a, b) +pub fn lasx_xvmulwod_d_wu(a: v8u32, b: v8u32) -> v4i64 { + unsafe { __lasx_xvmulwod_d_wu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_w_hu(a: v16u16, b: v16u16) -> v8i32 { - __lasx_xvmulwod_w_hu(a, b) +pub fn lasx_xvmulwod_w_hu(a: v16u16, b: v16u16) -> v8i32 { + unsafe { __lasx_xvmulwod_w_hu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_h_bu(a: v32u8, b: v32u8) -> v16i16 { - __lasx_xvmulwod_h_bu(a, b) +pub fn lasx_xvmulwod_h_bu(a: v32u8, b: v32u8) -> v16i16 { + unsafe { __lasx_xvmulwod_h_bu(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_d_wu_w(a: v8u32, b: v8i32) -> v4i64 { - __lasx_xvaddwev_d_wu_w(a, b) +pub fn lasx_xvaddwev_d_wu_w(a: v8u32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvaddwev_d_wu_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_w_hu_h(a: v16u16, b: v16i16) -> v8i32 { - __lasx_xvaddwev_w_hu_h(a, b) +pub fn lasx_xvaddwev_w_hu_h(a: v16u16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvaddwev_w_hu_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_h_bu_b(a: v32u8, b: v32i8) -> v16i16 { - __lasx_xvaddwev_h_bu_b(a, b) +pub fn lasx_xvaddwev_h_bu_b(a: v32u8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvaddwev_h_bu_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_d_wu_w(a: v8u32, b: v8i32) -> v4i64 { - __lasx_xvmulwev_d_wu_w(a, b) +pub fn lasx_xvmulwev_d_wu_w(a: v8u32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvmulwev_d_wu_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_w_hu_h(a: v16u16, b: v16i16) -> v8i32 { - __lasx_xvmulwev_w_hu_h(a, b) +pub fn lasx_xvmulwev_w_hu_h(a: v16u16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvmulwev_w_hu_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_h_bu_b(a: v32u8, b: v32i8) -> v16i16 { - __lasx_xvmulwev_h_bu_b(a, b) +pub fn lasx_xvmulwev_h_bu_b(a: v32u8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvmulwev_h_bu_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_d_wu_w(a: v8u32, b: v8i32) -> v4i64 { - __lasx_xvaddwod_d_wu_w(a, b) +pub fn lasx_xvaddwod_d_wu_w(a: v8u32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvaddwod_d_wu_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_w_hu_h(a: v16u16, b: v16i16) -> v8i32 { - __lasx_xvaddwod_w_hu_h(a, b) +pub fn lasx_xvaddwod_w_hu_h(a: v16u16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvaddwod_w_hu_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_h_bu_b(a: v32u8, b: v32i8) -> v16i16 { - __lasx_xvaddwod_h_bu_b(a, b) +pub fn lasx_xvaddwod_h_bu_b(a: v32u8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvaddwod_h_bu_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_d_wu_w(a: v8u32, b: v8i32) -> v4i64 { - __lasx_xvmulwod_d_wu_w(a, b) +pub fn lasx_xvmulwod_d_wu_w(a: v8u32, b: v8i32) -> v4i64 { + unsafe { __lasx_xvmulwod_d_wu_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_w_hu_h(a: v16u16, b: v16i16) -> v8i32 { - __lasx_xvmulwod_w_hu_h(a, b) +pub fn lasx_xvmulwod_w_hu_h(a: v16u16, b: v16i16) -> v8i32 { + unsafe { __lasx_xvmulwod_w_hu_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_h_bu_b(a: v32u8, b: v32i8) -> v16i16 { - __lasx_xvmulwod_h_bu_b(a, b) +pub fn lasx_xvmulwod_h_bu_b(a: v32u8, b: v32i8) -> v16i16 { + unsafe { __lasx_xvmulwod_h_bu_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhaddw_q_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvhaddw_q_d(a, b) +pub fn lasx_xvhaddw_q_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvhaddw_q_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhaddw_qu_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvhaddw_qu_du(a, b) +pub fn lasx_xvhaddw_qu_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvhaddw_qu_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhsubw_q_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvhsubw_q_d(a, b) +pub fn lasx_xvhsubw_q_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvhsubw_q_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvhsubw_qu_du(a: v4u64, b: v4u64) -> v4u64 { - __lasx_xvhsubw_qu_du(a, b) +pub fn lasx_xvhsubw_qu_du(a: v4u64, b: v4u64) -> v4u64 { + unsafe { __lasx_xvhsubw_qu_du(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_q_d(a: v4i64, b: v4i64, c: v4i64) -> v4i64 { - __lasx_xvmaddwev_q_d(a, b, c) +pub fn lasx_xvmaddwev_q_d(a: v4i64, b: v4i64, c: v4i64) -> v4i64 { + unsafe { __lasx_xvmaddwev_q_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_d_w(a: v4i64, b: v8i32, c: v8i32) -> v4i64 { - __lasx_xvmaddwev_d_w(a, b, c) +pub fn lasx_xvmaddwev_d_w(a: v4i64, b: v8i32, c: v8i32) -> v4i64 { + unsafe { __lasx_xvmaddwev_d_w(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_w_h(a: v8i32, b: v16i16, c: v16i16) -> v8i32 { - __lasx_xvmaddwev_w_h(a, b, c) +pub fn lasx_xvmaddwev_w_h(a: v8i32, b: v16i16, c: v16i16) -> v8i32 { + unsafe { __lasx_xvmaddwev_w_h(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_h_b(a: v16i16, b: v32i8, c: v32i8) -> v16i16 { - __lasx_xvmaddwev_h_b(a, b, c) +pub fn lasx_xvmaddwev_h_b(a: v16i16, b: v32i8, c: v32i8) -> v16i16 { + unsafe { __lasx_xvmaddwev_h_b(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_q_du(a: v4u64, b: v4u64, c: v4u64) -> v4u64 { - __lasx_xvmaddwev_q_du(a, b, c) +pub fn lasx_xvmaddwev_q_du(a: v4u64, b: v4u64, c: v4u64) -> v4u64 { + unsafe { __lasx_xvmaddwev_q_du(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_d_wu(a: v4u64, b: v8u32, c: v8u32) -> v4u64 { - __lasx_xvmaddwev_d_wu(a, b, c) +pub fn lasx_xvmaddwev_d_wu(a: v4u64, b: v8u32, c: v8u32) -> v4u64 { + unsafe { __lasx_xvmaddwev_d_wu(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_w_hu(a: v8u32, b: v16u16, c: v16u16) -> v8u32 { - __lasx_xvmaddwev_w_hu(a, b, c) +pub fn lasx_xvmaddwev_w_hu(a: v8u32, b: v16u16, c: v16u16) -> v8u32 { + unsafe { __lasx_xvmaddwev_w_hu(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_h_bu(a: v16u16, b: v32u8, c: v32u8) -> v16u16 { - __lasx_xvmaddwev_h_bu(a, b, c) +pub fn lasx_xvmaddwev_h_bu(a: v16u16, b: v32u8, c: v32u8) -> v16u16 { + unsafe { __lasx_xvmaddwev_h_bu(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_q_d(a: v4i64, b: v4i64, c: v4i64) -> v4i64 { - __lasx_xvmaddwod_q_d(a, b, c) +pub fn lasx_xvmaddwod_q_d(a: v4i64, b: v4i64, c: v4i64) -> v4i64 { + unsafe { __lasx_xvmaddwod_q_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_d_w(a: v4i64, b: v8i32, c: v8i32) -> v4i64 { - __lasx_xvmaddwod_d_w(a, b, c) +pub fn lasx_xvmaddwod_d_w(a: v4i64, b: v8i32, c: v8i32) -> v4i64 { + unsafe { __lasx_xvmaddwod_d_w(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_w_h(a: v8i32, b: v16i16, c: v16i16) -> v8i32 { - __lasx_xvmaddwod_w_h(a, b, c) +pub fn lasx_xvmaddwod_w_h(a: v8i32, b: v16i16, c: v16i16) -> v8i32 { + unsafe { __lasx_xvmaddwod_w_h(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_h_b(a: v16i16, b: v32i8, c: v32i8) -> v16i16 { - __lasx_xvmaddwod_h_b(a, b, c) +pub fn lasx_xvmaddwod_h_b(a: v16i16, b: v32i8, c: v32i8) -> v16i16 { + unsafe { __lasx_xvmaddwod_h_b(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_q_du(a: v4u64, b: v4u64, c: v4u64) -> v4u64 { - __lasx_xvmaddwod_q_du(a, b, c) +pub fn lasx_xvmaddwod_q_du(a: v4u64, b: v4u64, c: v4u64) -> v4u64 { + unsafe { __lasx_xvmaddwod_q_du(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_d_wu(a: v4u64, b: v8u32, c: v8u32) -> v4u64 { - __lasx_xvmaddwod_d_wu(a, b, c) +pub fn lasx_xvmaddwod_d_wu(a: v4u64, b: v8u32, c: v8u32) -> v4u64 { + unsafe { __lasx_xvmaddwod_d_wu(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_w_hu(a: v8u32, b: v16u16, c: v16u16) -> v8u32 { - __lasx_xvmaddwod_w_hu(a, b, c) +pub fn lasx_xvmaddwod_w_hu(a: v8u32, b: v16u16, c: v16u16) -> v8u32 { + unsafe { __lasx_xvmaddwod_w_hu(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_h_bu(a: v16u16, b: v32u8, c: v32u8) -> v16u16 { - __lasx_xvmaddwod_h_bu(a, b, c) +pub fn lasx_xvmaddwod_h_bu(a: v16u16, b: v32u8, c: v32u8) -> v16u16 { + unsafe { __lasx_xvmaddwod_h_bu(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_q_du_d(a: v4i64, b: v4u64, c: v4i64) -> v4i64 { - __lasx_xvmaddwev_q_du_d(a, b, c) +pub fn lasx_xvmaddwev_q_du_d(a: v4i64, b: v4u64, c: v4i64) -> v4i64 { + unsafe { __lasx_xvmaddwev_q_du_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_d_wu_w(a: v4i64, b: v8u32, c: v8i32) -> v4i64 { - __lasx_xvmaddwev_d_wu_w(a, b, c) +pub fn lasx_xvmaddwev_d_wu_w(a: v4i64, b: v8u32, c: v8i32) -> v4i64 { + unsafe { __lasx_xvmaddwev_d_wu_w(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_w_hu_h(a: v8i32, b: v16u16, c: v16i16) -> v8i32 { - __lasx_xvmaddwev_w_hu_h(a, b, c) +pub fn lasx_xvmaddwev_w_hu_h(a: v8i32, b: v16u16, c: v16i16) -> v8i32 { + unsafe { __lasx_xvmaddwev_w_hu_h(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwev_h_bu_b(a: v16i16, b: v32u8, c: v32i8) -> v16i16 { - __lasx_xvmaddwev_h_bu_b(a, b, c) +pub fn lasx_xvmaddwev_h_bu_b(a: v16i16, b: v32u8, c: v32i8) -> v16i16 { + unsafe { __lasx_xvmaddwev_h_bu_b(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_q_du_d(a: v4i64, b: v4u64, c: v4i64) -> v4i64 { - __lasx_xvmaddwod_q_du_d(a, b, c) +pub fn lasx_xvmaddwod_q_du_d(a: v4i64, b: v4u64, c: v4i64) -> v4i64 { + unsafe { __lasx_xvmaddwod_q_du_d(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_d_wu_w(a: v4i64, b: v8u32, c: v8i32) -> v4i64 { - __lasx_xvmaddwod_d_wu_w(a, b, c) +pub fn lasx_xvmaddwod_d_wu_w(a: v4i64, b: v8u32, c: v8i32) -> v4i64 { + unsafe { __lasx_xvmaddwod_d_wu_w(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_w_hu_h(a: v8i32, b: v16u16, c: v16i16) -> v8i32 { - __lasx_xvmaddwod_w_hu_h(a, b, c) +pub fn lasx_xvmaddwod_w_hu_h(a: v8i32, b: v16u16, c: v16i16) -> v8i32 { + unsafe { __lasx_xvmaddwod_w_hu_h(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmaddwod_h_bu_b(a: v16i16, b: v32u8, c: v32i8) -> v16i16 { - __lasx_xvmaddwod_h_bu_b(a, b, c) +pub fn lasx_xvmaddwod_h_bu_b(a: v16i16, b: v32u8, c: v32i8) -> v16i16 { + unsafe { __lasx_xvmaddwod_h_bu_b(a, b, c) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrotr_b(a: v32i8, b: v32i8) -> v32i8 { - __lasx_xvrotr_b(a, b) +pub fn lasx_xvrotr_b(a: v32i8, b: v32i8) -> v32i8 { + unsafe { __lasx_xvrotr_b(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrotr_h(a: v16i16, b: v16i16) -> v16i16 { - __lasx_xvrotr_h(a, b) +pub fn lasx_xvrotr_h(a: v16i16, b: v16i16) -> v16i16 { + unsafe { __lasx_xvrotr_h(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrotr_w(a: v8i32, b: v8i32) -> v8i32 { - __lasx_xvrotr_w(a, b) +pub fn lasx_xvrotr_w(a: v8i32, b: v8i32) -> v8i32 { + unsafe { __lasx_xvrotr_w(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrotr_d(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvrotr_d(a, b) +pub fn lasx_xvrotr_d(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvrotr_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvadd_q(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvadd_q(a, b) +pub fn lasx_xvadd_q(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvadd_q(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsub_q(a: v4i64, b: v4i64) -> v4i64 { - __lasx_xvsub_q(a, b) +pub fn lasx_xvsub_q(a: v4i64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvsub_q(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwev_q_du_d(a: v4u64, b: v4i64) -> v4i64 { - __lasx_xvaddwev_q_du_d(a, b) +pub fn lasx_xvaddwev_q_du_d(a: v4u64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvaddwev_q_du_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvaddwod_q_du_d(a: v4u64, b: v4i64) -> v4i64 { - __lasx_xvaddwod_q_du_d(a, b) +pub fn lasx_xvaddwod_q_du_d(a: v4u64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvaddwod_q_du_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwev_q_du_d(a: v4u64, b: v4i64) -> v4i64 { - __lasx_xvmulwev_q_du_d(a, b) +pub fn lasx_xvmulwev_q_du_d(a: v4u64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvmulwev_q_du_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmulwod_q_du_d(a: v4u64, b: v4i64) -> v4i64 { - __lasx_xvmulwod_q_du_d(a, b) +pub fn lasx_xvmulwod_q_du_d(a: v4u64, b: v4i64) -> v4i64 { + unsafe { __lasx_xvmulwod_q_du_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmskgez_b(a: v32i8) -> v32i8 { - __lasx_xvmskgez_b(a) +pub fn lasx_xvmskgez_b(a: v32i8) -> v32i8 { + unsafe { __lasx_xvmskgez_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvmsknz_b(a: v32i8) -> v32i8 { - __lasx_xvmsknz_b(a) +pub fn lasx_xvmsknz_b(a: v32i8) -> v32i8 { + unsafe { __lasx_xvmsknz_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvexth_h_b(a: v32i8) -> v16i16 { - __lasx_xvexth_h_b(a) +pub fn lasx_xvexth_h_b(a: v32i8) -> v16i16 { + unsafe { __lasx_xvexth_h_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvexth_w_h(a: v16i16) -> v8i32 { - __lasx_xvexth_w_h(a) +pub fn lasx_xvexth_w_h(a: v16i16) -> v8i32 { + unsafe { __lasx_xvexth_w_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvexth_d_w(a: v8i32) -> v4i64 { - __lasx_xvexth_d_w(a) +pub fn lasx_xvexth_d_w(a: v8i32) -> v4i64 { + unsafe { __lasx_xvexth_d_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvexth_q_d(a: v4i64) -> v4i64 { - __lasx_xvexth_q_d(a) +pub fn lasx_xvexth_q_d(a: v4i64) -> v4i64 { + unsafe { __lasx_xvexth_q_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvexth_hu_bu(a: v32u8) -> v16u16 { - __lasx_xvexth_hu_bu(a) +pub fn lasx_xvexth_hu_bu(a: v32u8) -> v16u16 { + unsafe { __lasx_xvexth_hu_bu(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvexth_wu_hu(a: v16u16) -> v8u32 { - __lasx_xvexth_wu_hu(a) +pub fn lasx_xvexth_wu_hu(a: v16u16) -> v8u32 { + unsafe { __lasx_xvexth_wu_hu(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvexth_du_wu(a: v8u32) -> v4u64 { - __lasx_xvexth_du_wu(a) +pub fn lasx_xvexth_du_wu(a: v8u32) -> v4u64 { + unsafe { __lasx_xvexth_du_wu(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvexth_qu_du(a: v4u64) -> v4u64 { - __lasx_xvexth_qu_du(a) +pub fn lasx_xvexth_qu_du(a: v4u64) -> v4u64 { + unsafe { __lasx_xvexth_qu_du(a) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrotri_b(a: v32i8) -> v32i8 { +pub fn lasx_xvrotri_b(a: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvrotri_b(a, IMM3) + unsafe { __lasx_xvrotri_b(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrotri_h(a: v16i16) -> v16i16 { +pub fn lasx_xvrotri_h(a: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvrotri_h(a, IMM4) + unsafe { __lasx_xvrotri_h(a, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrotri_w(a: v8i32) -> v8i32 { +pub fn lasx_xvrotri_w(a: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvrotri_w(a, IMM5) + unsafe { __lasx_xvrotri_w(a, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrotri_d(a: v4i64) -> v4i64 { +pub fn lasx_xvrotri_d(a: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvrotri_d(a, IMM6) + unsafe { __lasx_xvrotri_d(a, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvextl_q_d(a: v4i64) -> v4i64 { - __lasx_xvextl_q_d(a) +pub fn lasx_xvextl_q_d(a: v4i64) -> v4i64 { + unsafe { __lasx_xvextl_q_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlni_b_h(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvsrlni_b_h(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsrlni_b_h(a, b, IMM4) + unsafe { __lasx_xvsrlni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlni_h_w(a: v16i16, b: v16i16) -> v16i16 { +pub fn lasx_xvsrlni_h_w(a: v16i16, b: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsrlni_h_w(a, b, IMM5) + unsafe { __lasx_xvsrlni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlni_w_d(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvsrlni_w_d(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvsrlni_w_d(a, b, IMM6) + unsafe { __lasx_xvsrlni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlni_d_q(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvsrlni_d_q(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvsrlni_d_q(a, b, IMM7) + unsafe { __lasx_xvsrlni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlrni_b_h(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvsrlrni_b_h(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsrlrni_b_h(a, b, IMM4) + unsafe { __lasx_xvsrlrni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlrni_h_w(a: v16i16, b: v16i16) -> v16i16 { +pub fn lasx_xvsrlrni_h_w(a: v16i16, b: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsrlrni_h_w(a, b, IMM5) + unsafe { __lasx_xvsrlrni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlrni_w_d(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvsrlrni_w_d(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvsrlrni_w_d(a, b, IMM6) + unsafe { __lasx_xvsrlrni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrlrni_d_q(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvsrlrni_d_q(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvsrlrni_d_q(a, b, IMM7) + unsafe { __lasx_xvsrlrni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlni_b_h(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvssrlni_b_h(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvssrlni_b_h(a, b, IMM4) + unsafe { __lasx_xvssrlni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlni_h_w(a: v16i16, b: v16i16) -> v16i16 { +pub fn lasx_xvssrlni_h_w(a: v16i16, b: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvssrlni_h_w(a, b, IMM5) + unsafe { __lasx_xvssrlni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlni_w_d(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvssrlni_w_d(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvssrlni_w_d(a, b, IMM6) + unsafe { __lasx_xvssrlni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlni_d_q(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvssrlni_d_q(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvssrlni_d_q(a, b, IMM7) + unsafe { __lasx_xvssrlni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlni_bu_h(a: v32u8, b: v32i8) -> v32u8 { +pub fn lasx_xvssrlni_bu_h(a: v32u8, b: v32i8) -> v32u8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvssrlni_bu_h(a, b, IMM4) + unsafe { __lasx_xvssrlni_bu_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlni_hu_w(a: v16u16, b: v16i16) -> v16u16 { +pub fn lasx_xvssrlni_hu_w(a: v16u16, b: v16i16) -> v16u16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvssrlni_hu_w(a, b, IMM5) + unsafe { __lasx_xvssrlni_hu_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlni_wu_d(a: v8u32, b: v8i32) -> v8u32 { +pub fn lasx_xvssrlni_wu_d(a: v8u32, b: v8i32) -> v8u32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvssrlni_wu_d(a, b, IMM6) + unsafe { __lasx_xvssrlni_wu_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlni_du_q(a: v4u64, b: v4i64) -> v4u64 { +pub fn lasx_xvssrlni_du_q(a: v4u64, b: v4i64) -> v4u64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvssrlni_du_q(a, b, IMM7) + unsafe { __lasx_xvssrlni_du_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrni_b_h(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvssrlrni_b_h(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvssrlrni_b_h(a, b, IMM4) + unsafe { __lasx_xvssrlrni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrni_h_w(a: v16i16, b: v16i16) -> v16i16 { +pub fn lasx_xvssrlrni_h_w(a: v16i16, b: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvssrlrni_h_w(a, b, IMM5) + unsafe { __lasx_xvssrlrni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrni_w_d(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvssrlrni_w_d(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvssrlrni_w_d(a, b, IMM6) + unsafe { __lasx_xvssrlrni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrni_d_q(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvssrlrni_d_q(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvssrlrni_d_q(a, b, IMM7) + unsafe { __lasx_xvssrlrni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrni_bu_h(a: v32u8, b: v32i8) -> v32u8 { +pub fn lasx_xvssrlrni_bu_h(a: v32u8, b: v32i8) -> v32u8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvssrlrni_bu_h(a, b, IMM4) + unsafe { __lasx_xvssrlrni_bu_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrni_hu_w(a: v16u16, b: v16i16) -> v16u16 { +pub fn lasx_xvssrlrni_hu_w(a: v16u16, b: v16i16) -> v16u16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvssrlrni_hu_w(a, b, IMM5) + unsafe { __lasx_xvssrlrni_hu_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrni_wu_d(a: v8u32, b: v8i32) -> v8u32 { +pub fn lasx_xvssrlrni_wu_d(a: v8u32, b: v8i32) -> v8u32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvssrlrni_wu_d(a, b, IMM6) + unsafe { __lasx_xvssrlrni_wu_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrlrni_du_q(a: v4u64, b: v4i64) -> v4u64 { +pub fn lasx_xvssrlrni_du_q(a: v4u64, b: v4i64) -> v4u64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvssrlrni_du_q(a, b, IMM7) + unsafe { __lasx_xvssrlrni_du_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrani_b_h(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvsrani_b_h(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsrani_b_h(a, b, IMM4) + unsafe { __lasx_xvsrani_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrani_h_w(a: v16i16, b: v16i16) -> v16i16 { +pub fn lasx_xvsrani_h_w(a: v16i16, b: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsrani_h_w(a, b, IMM5) + unsafe { __lasx_xvsrani_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrani_w_d(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvsrani_w_d(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvsrani_w_d(a, b, IMM6) + unsafe { __lasx_xvsrani_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrani_d_q(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvsrani_d_q(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvsrani_d_q(a, b, IMM7) + unsafe { __lasx_xvsrani_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrarni_b_h(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvsrarni_b_h(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvsrarni_b_h(a, b, IMM4) + unsafe { __lasx_xvsrarni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrarni_h_w(a: v16i16, b: v16i16) -> v16i16 { +pub fn lasx_xvsrarni_h_w(a: v16i16, b: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvsrarni_h_w(a, b, IMM5) + unsafe { __lasx_xvsrarni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrarni_w_d(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvsrarni_w_d(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvsrarni_w_d(a, b, IMM6) + unsafe { __lasx_xvsrarni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvsrarni_d_q(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvsrarni_d_q(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvsrarni_d_q(a, b, IMM7) + unsafe { __lasx_xvsrarni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrani_b_h(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvssrani_b_h(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvssrani_b_h(a, b, IMM4) + unsafe { __lasx_xvssrani_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrani_h_w(a: v16i16, b: v16i16) -> v16i16 { +pub fn lasx_xvssrani_h_w(a: v16i16, b: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvssrani_h_w(a, b, IMM5) + unsafe { __lasx_xvssrani_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrani_w_d(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvssrani_w_d(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvssrani_w_d(a, b, IMM6) + unsafe { __lasx_xvssrani_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrani_d_q(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvssrani_d_q(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvssrani_d_q(a, b, IMM7) + unsafe { __lasx_xvssrani_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrani_bu_h(a: v32u8, b: v32i8) -> v32u8 { +pub fn lasx_xvssrani_bu_h(a: v32u8, b: v32i8) -> v32u8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvssrani_bu_h(a, b, IMM4) + unsafe { __lasx_xvssrani_bu_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrani_hu_w(a: v16u16, b: v16i16) -> v16u16 { +pub fn lasx_xvssrani_hu_w(a: v16u16, b: v16i16) -> v16u16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvssrani_hu_w(a, b, IMM5) + unsafe { __lasx_xvssrani_hu_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrani_wu_d(a: v8u32, b: v8i32) -> v8u32 { +pub fn lasx_xvssrani_wu_d(a: v8u32, b: v8i32) -> v8u32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvssrani_wu_d(a, b, IMM6) + unsafe { __lasx_xvssrani_wu_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrani_du_q(a: v4u64, b: v4i64) -> v4u64 { +pub fn lasx_xvssrani_du_q(a: v4u64, b: v4i64) -> v4u64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvssrani_du_q(a, b, IMM7) + unsafe { __lasx_xvssrani_du_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarni_b_h(a: v32i8, b: v32i8) -> v32i8 { +pub fn lasx_xvssrarni_b_h(a: v32i8, b: v32i8) -> v32i8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvssrarni_b_h(a, b, IMM4) + unsafe { __lasx_xvssrarni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarni_h_w(a: v16i16, b: v16i16) -> v16i16 { +pub fn lasx_xvssrarni_h_w(a: v16i16, b: v16i16) -> v16i16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvssrarni_h_w(a, b, IMM5) + unsafe { __lasx_xvssrarni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarni_w_d(a: v8i32, b: v8i32) -> v8i32 { +pub fn lasx_xvssrarni_w_d(a: v8i32, b: v8i32) -> v8i32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvssrarni_w_d(a, b, IMM6) + unsafe { __lasx_xvssrarni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarni_d_q(a: v4i64, b: v4i64) -> v4i64 { +pub fn lasx_xvssrarni_d_q(a: v4i64, b: v4i64) -> v4i64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvssrarni_d_q(a, b, IMM7) + unsafe { __lasx_xvssrarni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarni_bu_h(a: v32u8, b: v32i8) -> v32u8 { +pub fn lasx_xvssrarni_bu_h(a: v32u8, b: v32i8) -> v32u8 { static_assert_uimm_bits!(IMM4, 4); - __lasx_xvssrarni_bu_h(a, b, IMM4) + unsafe { __lasx_xvssrarni_bu_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarni_hu_w(a: v16u16, b: v16i16) -> v16u16 { +pub fn lasx_xvssrarni_hu_w(a: v16u16, b: v16i16) -> v16u16 { static_assert_uimm_bits!(IMM5, 5); - __lasx_xvssrarni_hu_w(a, b, IMM5) + unsafe { __lasx_xvssrarni_hu_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarni_wu_d(a: v8u32, b: v8i32) -> v8u32 { +pub fn lasx_xvssrarni_wu_d(a: v8u32, b: v8i32) -> v8u32 { static_assert_uimm_bits!(IMM6, 6); - __lasx_xvssrarni_wu_d(a, b, IMM6) + unsafe { __lasx_xvssrarni_wu_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvssrarni_du_q(a: v4u64, b: v4i64) -> v4u64 { +pub fn lasx_xvssrarni_du_q(a: v4u64, b: v4i64) -> v4u64 { static_assert_uimm_bits!(IMM7, 7); - __lasx_xvssrarni_du_q(a, b, IMM7) + unsafe { __lasx_xvssrarni_du_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xbnz_b(a: v32u8) -> i32 { - __lasx_xbnz_b(a) +pub fn lasx_xbnz_b(a: v32u8) -> i32 { + unsafe { __lasx_xbnz_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xbnz_d(a: v4u64) -> i32 { - __lasx_xbnz_d(a) +pub fn lasx_xbnz_d(a: v4u64) -> i32 { + unsafe { __lasx_xbnz_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xbnz_h(a: v16u16) -> i32 { - __lasx_xbnz_h(a) +pub fn lasx_xbnz_h(a: v16u16) -> i32 { + unsafe { __lasx_xbnz_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xbnz_v(a: v32u8) -> i32 { - __lasx_xbnz_v(a) +pub fn lasx_xbnz_v(a: v32u8) -> i32 { + unsafe { __lasx_xbnz_v(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xbnz_w(a: v8u32) -> i32 { - __lasx_xbnz_w(a) +pub fn lasx_xbnz_w(a: v8u32) -> i32 { + unsafe { __lasx_xbnz_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xbz_b(a: v32u8) -> i32 { - __lasx_xbz_b(a) +pub fn lasx_xbz_b(a: v32u8) -> i32 { + unsafe { __lasx_xbz_b(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xbz_d(a: v4u64) -> i32 { - __lasx_xbz_d(a) +pub fn lasx_xbz_d(a: v4u64) -> i32 { + unsafe { __lasx_xbz_d(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xbz_h(a: v16u16) -> i32 { - __lasx_xbz_h(a) +pub fn lasx_xbz_h(a: v16u16) -> i32 { + unsafe { __lasx_xbz_h(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xbz_v(a: v32u8) -> i32 { - __lasx_xbz_v(a) +pub fn lasx_xbz_v(a: v32u8) -> i32 { + unsafe { __lasx_xbz_v(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xbz_w(a: v8u32) -> i32 { - __lasx_xbz_w(a) +pub fn lasx_xbz_w(a: v8u32) -> i32 { + unsafe { __lasx_xbz_w(a) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_caf_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_caf_d(a, b) +pub fn lasx_xvfcmp_caf_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_caf_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_caf_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_caf_s(a, b) +pub fn lasx_xvfcmp_caf_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_caf_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_ceq_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_ceq_d(a, b) +pub fn lasx_xvfcmp_ceq_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_ceq_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_ceq_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_ceq_s(a, b) +pub fn lasx_xvfcmp_ceq_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_ceq_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cle_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_cle_d(a, b) +pub fn lasx_xvfcmp_cle_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_cle_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cle_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_cle_s(a, b) +pub fn lasx_xvfcmp_cle_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_cle_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_clt_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_clt_d(a, b) +pub fn lasx_xvfcmp_clt_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_clt_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_clt_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_clt_s(a, b) +pub fn lasx_xvfcmp_clt_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_clt_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cne_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_cne_d(a, b) +pub fn lasx_xvfcmp_cne_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_cne_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cne_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_cne_s(a, b) +pub fn lasx_xvfcmp_cne_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_cne_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cor_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_cor_d(a, b) +pub fn lasx_xvfcmp_cor_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_cor_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cor_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_cor_s(a, b) +pub fn lasx_xvfcmp_cor_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_cor_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cueq_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_cueq_d(a, b) +pub fn lasx_xvfcmp_cueq_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_cueq_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cueq_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_cueq_s(a, b) +pub fn lasx_xvfcmp_cueq_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_cueq_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cule_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_cule_d(a, b) +pub fn lasx_xvfcmp_cule_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_cule_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cule_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_cule_s(a, b) +pub fn lasx_xvfcmp_cule_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_cule_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cult_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_cult_d(a, b) +pub fn lasx_xvfcmp_cult_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_cult_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cult_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_cult_s(a, b) +pub fn lasx_xvfcmp_cult_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_cult_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cun_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_cun_d(a, b) +pub fn lasx_xvfcmp_cun_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_cun_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cune_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_cune_d(a, b) +pub fn lasx_xvfcmp_cune_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_cune_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cune_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_cune_s(a, b) +pub fn lasx_xvfcmp_cune_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_cune_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_cun_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_cun_s(a, b) +pub fn lasx_xvfcmp_cun_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_cun_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_saf_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_saf_d(a, b) +pub fn lasx_xvfcmp_saf_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_saf_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_saf_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_saf_s(a, b) +pub fn lasx_xvfcmp_saf_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_saf_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_seq_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_seq_d(a, b) +pub fn lasx_xvfcmp_seq_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_seq_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_seq_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_seq_s(a, b) +pub fn lasx_xvfcmp_seq_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_seq_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sle_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_sle_d(a, b) +pub fn lasx_xvfcmp_sle_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_sle_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sle_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_sle_s(a, b) +pub fn lasx_xvfcmp_sle_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_sle_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_slt_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_slt_d(a, b) +pub fn lasx_xvfcmp_slt_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_slt_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_slt_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_slt_s(a, b) +pub fn lasx_xvfcmp_slt_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_slt_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sne_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_sne_d(a, b) +pub fn lasx_xvfcmp_sne_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_sne_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sne_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_sne_s(a, b) +pub fn lasx_xvfcmp_sne_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_sne_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sor_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_sor_d(a, b) +pub fn lasx_xvfcmp_sor_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_sor_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sor_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_sor_s(a, b) +pub fn lasx_xvfcmp_sor_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_sor_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sueq_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_sueq_d(a, b) +pub fn lasx_xvfcmp_sueq_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_sueq_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sueq_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_sueq_s(a, b) +pub fn lasx_xvfcmp_sueq_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_sueq_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sule_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_sule_d(a, b) +pub fn lasx_xvfcmp_sule_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_sule_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sule_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_sule_s(a, b) +pub fn lasx_xvfcmp_sule_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_sule_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sult_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_sult_d(a, b) +pub fn lasx_xvfcmp_sult_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_sult_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sult_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_sult_s(a, b) +pub fn lasx_xvfcmp_sult_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_sult_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sun_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_sun_d(a, b) +pub fn lasx_xvfcmp_sun_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_sun_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sune_d(a: v4f64, b: v4f64) -> v4i64 { - __lasx_xvfcmp_sune_d(a, b) +pub fn lasx_xvfcmp_sune_d(a: v4f64, b: v4f64) -> v4i64 { + unsafe { __lasx_xvfcmp_sune_d(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sune_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_sune_s(a, b) +pub fn lasx_xvfcmp_sune_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_sune_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvfcmp_sun_s(a: v8f32, b: v8f32) -> v8i32 { - __lasx_xvfcmp_sun_s(a, b) +pub fn lasx_xvfcmp_sun_s(a: v8f32, b: v8f32) -> v8i32 { + unsafe { __lasx_xvfcmp_sun_s(a, b) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickve_d_f(a: v4f64) -> v4f64 { +pub fn lasx_xvpickve_d_f(a: v4f64) -> v4f64 { static_assert_uimm_bits!(IMM2, 2); - __lasx_xvpickve_d_f(a, IMM2) + unsafe { __lasx_xvpickve_d_f(a, IMM2) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvpickve_w_f(a: v8f32) -> v8f32 { +pub fn lasx_xvpickve_w_f(a: v8f32) -> v8f32 { static_assert_uimm_bits!(IMM3, 3); - __lasx_xvpickve_w_f(a, IMM3) + unsafe { __lasx_xvpickve_w_f(a, IMM3) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(0)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrepli_b() -> v32i8 { +pub fn lasx_xvrepli_b() -> v32i8 { static_assert_simm_bits!(IMM_S10, 10); - __lasx_xvrepli_b(IMM_S10) + unsafe { __lasx_xvrepli_b(IMM_S10) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(0)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrepli_d() -> v4i64 { +pub fn lasx_xvrepli_d() -> v4i64 { static_assert_simm_bits!(IMM_S10, 10); - __lasx_xvrepli_d(IMM_S10) + unsafe { __lasx_xvrepli_d(IMM_S10) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(0)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrepli_h() -> v16i16 { +pub fn lasx_xvrepli_h() -> v16i16 { static_assert_simm_bits!(IMM_S10, 10); - __lasx_xvrepli_h(IMM_S10) + unsafe { __lasx_xvrepli_h(IMM_S10) } } #[inline] #[target_feature(enable = "lasx")] #[rustc_legacy_const_generics(0)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lasx_xvrepli_w() -> v8i32 { +pub fn lasx_xvrepli_w() -> v8i32 { static_assert_simm_bits!(IMM_S10, 10); - __lasx_xvrepli_w(IMM_S10) + unsafe { __lasx_xvrepli_w(IMM_S10) } } diff --git a/library/stdarch/crates/core_arch/src/loongarch64/lsx/generated.rs b/library/stdarch/crates/core_arch/src/loongarch64/lsx/generated.rs index 2bc364f3e069..ba821a3e3dc6 100644 --- a/library/stdarch/crates/core_arch/src/loongarch64/lsx/generated.rs +++ b/library/stdarch/crates/core_arch/src/loongarch64/lsx/generated.rs @@ -1455,3593 +1455,3593 @@ unsafe extern "unadjusted" { #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsll_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vsll_b(a, b) +pub fn lsx_vsll_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vsll_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsll_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vsll_h(a, b) +pub fn lsx_vsll_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vsll_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsll_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vsll_w(a, b) +pub fn lsx_vsll_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vsll_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsll_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsll_d(a, b) +pub fn lsx_vsll_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsll_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslli_b(a: v16i8) -> v16i8 { +pub fn lsx_vslli_b(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vslli_b(a, IMM3) + unsafe { __lsx_vslli_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslli_h(a: v8i16) -> v8i16 { +pub fn lsx_vslli_h(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vslli_h(a, IMM4) + unsafe { __lsx_vslli_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslli_w(a: v4i32) -> v4i32 { +pub fn lsx_vslli_w(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vslli_w(a, IMM5) + unsafe { __lsx_vslli_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslli_d(a: v2i64) -> v2i64 { +pub fn lsx_vslli_d(a: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vslli_d(a, IMM6) + unsafe { __lsx_vslli_d(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsra_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vsra_b(a, b) +pub fn lsx_vsra_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vsra_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsra_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vsra_h(a, b) +pub fn lsx_vsra_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vsra_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsra_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vsra_w(a, b) +pub fn lsx_vsra_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vsra_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsra_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsra_d(a, b) +pub fn lsx_vsra_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsra_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrai_b(a: v16i8) -> v16i8 { +pub fn lsx_vsrai_b(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vsrai_b(a, IMM3) + unsafe { __lsx_vsrai_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrai_h(a: v8i16) -> v8i16 { +pub fn lsx_vsrai_h(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsrai_h(a, IMM4) + unsafe { __lsx_vsrai_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrai_w(a: v4i32) -> v4i32 { +pub fn lsx_vsrai_w(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsrai_w(a, IMM5) + unsafe { __lsx_vsrai_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrai_d(a: v2i64) -> v2i64 { +pub fn lsx_vsrai_d(a: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vsrai_d(a, IMM6) + unsafe { __lsx_vsrai_d(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrar_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vsrar_b(a, b) +pub fn lsx_vsrar_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vsrar_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrar_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vsrar_h(a, b) +pub fn lsx_vsrar_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vsrar_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrar_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vsrar_w(a, b) +pub fn lsx_vsrar_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vsrar_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrar_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsrar_d(a, b) +pub fn lsx_vsrar_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsrar_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrari_b(a: v16i8) -> v16i8 { +pub fn lsx_vsrari_b(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vsrari_b(a, IMM3) + unsafe { __lsx_vsrari_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrari_h(a: v8i16) -> v8i16 { +pub fn lsx_vsrari_h(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsrari_h(a, IMM4) + unsafe { __lsx_vsrari_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrari_w(a: v4i32) -> v4i32 { +pub fn lsx_vsrari_w(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsrari_w(a, IMM5) + unsafe { __lsx_vsrari_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrari_d(a: v2i64) -> v2i64 { +pub fn lsx_vsrari_d(a: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vsrari_d(a, IMM6) + unsafe { __lsx_vsrari_d(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrl_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vsrl_b(a, b) +pub fn lsx_vsrl_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vsrl_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrl_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vsrl_h(a, b) +pub fn lsx_vsrl_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vsrl_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrl_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vsrl_w(a, b) +pub fn lsx_vsrl_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vsrl_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrl_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsrl_d(a, b) +pub fn lsx_vsrl_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsrl_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrli_b(a: v16i8) -> v16i8 { +pub fn lsx_vsrli_b(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vsrli_b(a, IMM3) + unsafe { __lsx_vsrli_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrli_h(a: v8i16) -> v8i16 { +pub fn lsx_vsrli_h(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsrli_h(a, IMM4) + unsafe { __lsx_vsrli_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrli_w(a: v4i32) -> v4i32 { +pub fn lsx_vsrli_w(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsrli_w(a, IMM5) + unsafe { __lsx_vsrli_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrli_d(a: v2i64) -> v2i64 { +pub fn lsx_vsrli_d(a: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vsrli_d(a, IMM6) + unsafe { __lsx_vsrli_d(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlr_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vsrlr_b(a, b) +pub fn lsx_vsrlr_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vsrlr_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlr_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vsrlr_h(a, b) +pub fn lsx_vsrlr_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vsrlr_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlr_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vsrlr_w(a, b) +pub fn lsx_vsrlr_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vsrlr_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlr_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsrlr_d(a, b) +pub fn lsx_vsrlr_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsrlr_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlri_b(a: v16i8) -> v16i8 { +pub fn lsx_vsrlri_b(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vsrlri_b(a, IMM3) + unsafe { __lsx_vsrlri_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlri_h(a: v8i16) -> v8i16 { +pub fn lsx_vsrlri_h(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsrlri_h(a, IMM4) + unsafe { __lsx_vsrlri_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlri_w(a: v4i32) -> v4i32 { +pub fn lsx_vsrlri_w(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsrlri_w(a, IMM5) + unsafe { __lsx_vsrlri_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlri_d(a: v2i64) -> v2i64 { +pub fn lsx_vsrlri_d(a: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vsrlri_d(a, IMM6) + unsafe { __lsx_vsrlri_d(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitclr_b(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vbitclr_b(a, b) +pub fn lsx_vbitclr_b(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vbitclr_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitclr_h(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vbitclr_h(a, b) +pub fn lsx_vbitclr_h(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vbitclr_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitclr_w(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vbitclr_w(a, b) +pub fn lsx_vbitclr_w(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vbitclr_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitclr_d(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vbitclr_d(a, b) +pub fn lsx_vbitclr_d(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vbitclr_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitclri_b(a: v16u8) -> v16u8 { +pub fn lsx_vbitclri_b(a: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vbitclri_b(a, IMM3) + unsafe { __lsx_vbitclri_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitclri_h(a: v8u16) -> v8u16 { +pub fn lsx_vbitclri_h(a: v8u16) -> v8u16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vbitclri_h(a, IMM4) + unsafe { __lsx_vbitclri_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitclri_w(a: v4u32) -> v4u32 { +pub fn lsx_vbitclri_w(a: v4u32) -> v4u32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vbitclri_w(a, IMM5) + unsafe { __lsx_vbitclri_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitclri_d(a: v2u64) -> v2u64 { +pub fn lsx_vbitclri_d(a: v2u64) -> v2u64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vbitclri_d(a, IMM6) + unsafe { __lsx_vbitclri_d(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitset_b(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vbitset_b(a, b) +pub fn lsx_vbitset_b(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vbitset_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitset_h(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vbitset_h(a, b) +pub fn lsx_vbitset_h(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vbitset_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitset_w(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vbitset_w(a, b) +pub fn lsx_vbitset_w(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vbitset_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitset_d(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vbitset_d(a, b) +pub fn lsx_vbitset_d(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vbitset_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitseti_b(a: v16u8) -> v16u8 { +pub fn lsx_vbitseti_b(a: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vbitseti_b(a, IMM3) + unsafe { __lsx_vbitseti_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitseti_h(a: v8u16) -> v8u16 { +pub fn lsx_vbitseti_h(a: v8u16) -> v8u16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vbitseti_h(a, IMM4) + unsafe { __lsx_vbitseti_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitseti_w(a: v4u32) -> v4u32 { +pub fn lsx_vbitseti_w(a: v4u32) -> v4u32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vbitseti_w(a, IMM5) + unsafe { __lsx_vbitseti_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitseti_d(a: v2u64) -> v2u64 { +pub fn lsx_vbitseti_d(a: v2u64) -> v2u64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vbitseti_d(a, IMM6) + unsafe { __lsx_vbitseti_d(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitrev_b(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vbitrev_b(a, b) +pub fn lsx_vbitrev_b(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vbitrev_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitrev_h(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vbitrev_h(a, b) +pub fn lsx_vbitrev_h(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vbitrev_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitrev_w(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vbitrev_w(a, b) +pub fn lsx_vbitrev_w(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vbitrev_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitrev_d(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vbitrev_d(a, b) +pub fn lsx_vbitrev_d(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vbitrev_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitrevi_b(a: v16u8) -> v16u8 { +pub fn lsx_vbitrevi_b(a: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vbitrevi_b(a, IMM3) + unsafe { __lsx_vbitrevi_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitrevi_h(a: v8u16) -> v8u16 { +pub fn lsx_vbitrevi_h(a: v8u16) -> v8u16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vbitrevi_h(a, IMM4) + unsafe { __lsx_vbitrevi_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitrevi_w(a: v4u32) -> v4u32 { +pub fn lsx_vbitrevi_w(a: v4u32) -> v4u32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vbitrevi_w(a, IMM5) + unsafe { __lsx_vbitrevi_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitrevi_d(a: v2u64) -> v2u64 { +pub fn lsx_vbitrevi_d(a: v2u64) -> v2u64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vbitrevi_d(a, IMM6) + unsafe { __lsx_vbitrevi_d(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vadd_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vadd_b(a, b) +pub fn lsx_vadd_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vadd_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vadd_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vadd_h(a, b) +pub fn lsx_vadd_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vadd_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vadd_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vadd_w(a, b) +pub fn lsx_vadd_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vadd_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vadd_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vadd_d(a, b) +pub fn lsx_vadd_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vadd_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddi_bu(a: v16i8) -> v16i8 { +pub fn lsx_vaddi_bu(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vaddi_bu(a, IMM5) + unsafe { __lsx_vaddi_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddi_hu(a: v8i16) -> v8i16 { +pub fn lsx_vaddi_hu(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vaddi_hu(a, IMM5) + unsafe { __lsx_vaddi_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddi_wu(a: v4i32) -> v4i32 { +pub fn lsx_vaddi_wu(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vaddi_wu(a, IMM5) + unsafe { __lsx_vaddi_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddi_du(a: v2i64) -> v2i64 { +pub fn lsx_vaddi_du(a: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vaddi_du(a, IMM5) + unsafe { __lsx_vaddi_du(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsub_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vsub_b(a, b) +pub fn lsx_vsub_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vsub_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsub_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vsub_h(a, b) +pub fn lsx_vsub_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vsub_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsub_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vsub_w(a, b) +pub fn lsx_vsub_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vsub_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsub_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsub_d(a, b) +pub fn lsx_vsub_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsub_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubi_bu(a: v16i8) -> v16i8 { +pub fn lsx_vsubi_bu(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsubi_bu(a, IMM5) + unsafe { __lsx_vsubi_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubi_hu(a: v8i16) -> v8i16 { +pub fn lsx_vsubi_hu(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsubi_hu(a, IMM5) + unsafe { __lsx_vsubi_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubi_wu(a: v4i32) -> v4i32 { +pub fn lsx_vsubi_wu(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsubi_wu(a, IMM5) + unsafe { __lsx_vsubi_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubi_du(a: v2i64) -> v2i64 { +pub fn lsx_vsubi_du(a: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsubi_du(a, IMM5) + unsafe { __lsx_vsubi_du(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmax_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vmax_b(a, b) +pub fn lsx_vmax_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vmax_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmax_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vmax_h(a, b) +pub fn lsx_vmax_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vmax_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmax_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vmax_w(a, b) +pub fn lsx_vmax_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vmax_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmax_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vmax_d(a, b) +pub fn lsx_vmax_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vmax_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaxi_b(a: v16i8) -> v16i8 { +pub fn lsx_vmaxi_b(a: v16i8) -> v16i8 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vmaxi_b(a, IMM_S5) + unsafe { __lsx_vmaxi_b(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaxi_h(a: v8i16) -> v8i16 { +pub fn lsx_vmaxi_h(a: v8i16) -> v8i16 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vmaxi_h(a, IMM_S5) + unsafe { __lsx_vmaxi_h(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaxi_w(a: v4i32) -> v4i32 { +pub fn lsx_vmaxi_w(a: v4i32) -> v4i32 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vmaxi_w(a, IMM_S5) + unsafe { __lsx_vmaxi_w(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaxi_d(a: v2i64) -> v2i64 { +pub fn lsx_vmaxi_d(a: v2i64) -> v2i64 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vmaxi_d(a, IMM_S5) + unsafe { __lsx_vmaxi_d(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmax_bu(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vmax_bu(a, b) +pub fn lsx_vmax_bu(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vmax_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmax_hu(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vmax_hu(a, b) +pub fn lsx_vmax_hu(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vmax_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmax_wu(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vmax_wu(a, b) +pub fn lsx_vmax_wu(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vmax_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmax_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vmax_du(a, b) +pub fn lsx_vmax_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vmax_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaxi_bu(a: v16u8) -> v16u8 { +pub fn lsx_vmaxi_bu(a: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vmaxi_bu(a, IMM5) + unsafe { __lsx_vmaxi_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaxi_hu(a: v8u16) -> v8u16 { +pub fn lsx_vmaxi_hu(a: v8u16) -> v8u16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vmaxi_hu(a, IMM5) + unsafe { __lsx_vmaxi_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaxi_wu(a: v4u32) -> v4u32 { +pub fn lsx_vmaxi_wu(a: v4u32) -> v4u32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vmaxi_wu(a, IMM5) + unsafe { __lsx_vmaxi_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaxi_du(a: v2u64) -> v2u64 { +pub fn lsx_vmaxi_du(a: v2u64) -> v2u64 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vmaxi_du(a, IMM5) + unsafe { __lsx_vmaxi_du(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmin_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vmin_b(a, b) +pub fn lsx_vmin_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vmin_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmin_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vmin_h(a, b) +pub fn lsx_vmin_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vmin_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmin_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vmin_w(a, b) +pub fn lsx_vmin_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vmin_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmin_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vmin_d(a, b) +pub fn lsx_vmin_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vmin_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmini_b(a: v16i8) -> v16i8 { +pub fn lsx_vmini_b(a: v16i8) -> v16i8 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vmini_b(a, IMM_S5) + unsafe { __lsx_vmini_b(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmini_h(a: v8i16) -> v8i16 { +pub fn lsx_vmini_h(a: v8i16) -> v8i16 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vmini_h(a, IMM_S5) + unsafe { __lsx_vmini_h(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmini_w(a: v4i32) -> v4i32 { +pub fn lsx_vmini_w(a: v4i32) -> v4i32 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vmini_w(a, IMM_S5) + unsafe { __lsx_vmini_w(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmini_d(a: v2i64) -> v2i64 { +pub fn lsx_vmini_d(a: v2i64) -> v2i64 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vmini_d(a, IMM_S5) + unsafe { __lsx_vmini_d(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmin_bu(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vmin_bu(a, b) +pub fn lsx_vmin_bu(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vmin_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmin_hu(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vmin_hu(a, b) +pub fn lsx_vmin_hu(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vmin_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmin_wu(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vmin_wu(a, b) +pub fn lsx_vmin_wu(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vmin_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmin_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vmin_du(a, b) +pub fn lsx_vmin_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vmin_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmini_bu(a: v16u8) -> v16u8 { +pub fn lsx_vmini_bu(a: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vmini_bu(a, IMM5) + unsafe { __lsx_vmini_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmini_hu(a: v8u16) -> v8u16 { +pub fn lsx_vmini_hu(a: v8u16) -> v8u16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vmini_hu(a, IMM5) + unsafe { __lsx_vmini_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmini_wu(a: v4u32) -> v4u32 { +pub fn lsx_vmini_wu(a: v4u32) -> v4u32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vmini_wu(a, IMM5) + unsafe { __lsx_vmini_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmini_du(a: v2u64) -> v2u64 { +pub fn lsx_vmini_du(a: v2u64) -> v2u64 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vmini_du(a, IMM5) + unsafe { __lsx_vmini_du(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vseq_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vseq_b(a, b) +pub fn lsx_vseq_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vseq_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vseq_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vseq_h(a, b) +pub fn lsx_vseq_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vseq_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vseq_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vseq_w(a, b) +pub fn lsx_vseq_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vseq_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vseq_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vseq_d(a, b) +pub fn lsx_vseq_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vseq_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vseqi_b(a: v16i8) -> v16i8 { +pub fn lsx_vseqi_b(a: v16i8) -> v16i8 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vseqi_b(a, IMM_S5) + unsafe { __lsx_vseqi_b(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vseqi_h(a: v8i16) -> v8i16 { +pub fn lsx_vseqi_h(a: v8i16) -> v8i16 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vseqi_h(a, IMM_S5) + unsafe { __lsx_vseqi_h(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vseqi_w(a: v4i32) -> v4i32 { +pub fn lsx_vseqi_w(a: v4i32) -> v4i32 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vseqi_w(a, IMM_S5) + unsafe { __lsx_vseqi_w(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vseqi_d(a: v2i64) -> v2i64 { +pub fn lsx_vseqi_d(a: v2i64) -> v2i64 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vseqi_d(a, IMM_S5) + unsafe { __lsx_vseqi_d(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslti_b(a: v16i8) -> v16i8 { +pub fn lsx_vslti_b(a: v16i8) -> v16i8 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vslti_b(a, IMM_S5) + unsafe { __lsx_vslti_b(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslt_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vslt_b(a, b) +pub fn lsx_vslt_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vslt_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslt_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vslt_h(a, b) +pub fn lsx_vslt_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vslt_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslt_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vslt_w(a, b) +pub fn lsx_vslt_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vslt_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslt_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vslt_d(a, b) +pub fn lsx_vslt_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vslt_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslti_h(a: v8i16) -> v8i16 { +pub fn lsx_vslti_h(a: v8i16) -> v8i16 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vslti_h(a, IMM_S5) + unsafe { __lsx_vslti_h(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslti_w(a: v4i32) -> v4i32 { +pub fn lsx_vslti_w(a: v4i32) -> v4i32 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vslti_w(a, IMM_S5) + unsafe { __lsx_vslti_w(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslti_d(a: v2i64) -> v2i64 { +pub fn lsx_vslti_d(a: v2i64) -> v2i64 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vslti_d(a, IMM_S5) + unsafe { __lsx_vslti_d(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslt_bu(a: v16u8, b: v16u8) -> v16i8 { - __lsx_vslt_bu(a, b) +pub fn lsx_vslt_bu(a: v16u8, b: v16u8) -> v16i8 { + unsafe { __lsx_vslt_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslt_hu(a: v8u16, b: v8u16) -> v8i16 { - __lsx_vslt_hu(a, b) +pub fn lsx_vslt_hu(a: v8u16, b: v8u16) -> v8i16 { + unsafe { __lsx_vslt_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslt_wu(a: v4u32, b: v4u32) -> v4i32 { - __lsx_vslt_wu(a, b) +pub fn lsx_vslt_wu(a: v4u32, b: v4u32) -> v4i32 { + unsafe { __lsx_vslt_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslt_du(a: v2u64, b: v2u64) -> v2i64 { - __lsx_vslt_du(a, b) +pub fn lsx_vslt_du(a: v2u64, b: v2u64) -> v2i64 { + unsafe { __lsx_vslt_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslti_bu(a: v16u8) -> v16i8 { +pub fn lsx_vslti_bu(a: v16u8) -> v16i8 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vslti_bu(a, IMM5) + unsafe { __lsx_vslti_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslti_hu(a: v8u16) -> v8i16 { +pub fn lsx_vslti_hu(a: v8u16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vslti_hu(a, IMM5) + unsafe { __lsx_vslti_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslti_wu(a: v4u32) -> v4i32 { +pub fn lsx_vslti_wu(a: v4u32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vslti_wu(a, IMM5) + unsafe { __lsx_vslti_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslti_du(a: v2u64) -> v2i64 { +pub fn lsx_vslti_du(a: v2u64) -> v2i64 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vslti_du(a, IMM5) + unsafe { __lsx_vslti_du(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsle_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vsle_b(a, b) +pub fn lsx_vsle_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vsle_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsle_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vsle_h(a, b) +pub fn lsx_vsle_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vsle_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsle_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vsle_w(a, b) +pub fn lsx_vsle_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vsle_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsle_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsle_d(a, b) +pub fn lsx_vsle_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsle_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslei_b(a: v16i8) -> v16i8 { +pub fn lsx_vslei_b(a: v16i8) -> v16i8 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vslei_b(a, IMM_S5) + unsafe { __lsx_vslei_b(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslei_h(a: v8i16) -> v8i16 { +pub fn lsx_vslei_h(a: v8i16) -> v8i16 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vslei_h(a, IMM_S5) + unsafe { __lsx_vslei_h(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslei_w(a: v4i32) -> v4i32 { +pub fn lsx_vslei_w(a: v4i32) -> v4i32 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vslei_w(a, IMM_S5) + unsafe { __lsx_vslei_w(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslei_d(a: v2i64) -> v2i64 { +pub fn lsx_vslei_d(a: v2i64) -> v2i64 { static_assert_simm_bits!(IMM_S5, 5); - __lsx_vslei_d(a, IMM_S5) + unsafe { __lsx_vslei_d(a, IMM_S5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsle_bu(a: v16u8, b: v16u8) -> v16i8 { - __lsx_vsle_bu(a, b) +pub fn lsx_vsle_bu(a: v16u8, b: v16u8) -> v16i8 { + unsafe { __lsx_vsle_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsle_hu(a: v8u16, b: v8u16) -> v8i16 { - __lsx_vsle_hu(a, b) +pub fn lsx_vsle_hu(a: v8u16, b: v8u16) -> v8i16 { + unsafe { __lsx_vsle_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsle_wu(a: v4u32, b: v4u32) -> v4i32 { - __lsx_vsle_wu(a, b) +pub fn lsx_vsle_wu(a: v4u32, b: v4u32) -> v4i32 { + unsafe { __lsx_vsle_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsle_du(a: v2u64, b: v2u64) -> v2i64 { - __lsx_vsle_du(a, b) +pub fn lsx_vsle_du(a: v2u64, b: v2u64) -> v2i64 { + unsafe { __lsx_vsle_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslei_bu(a: v16u8) -> v16i8 { +pub fn lsx_vslei_bu(a: v16u8) -> v16i8 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vslei_bu(a, IMM5) + unsafe { __lsx_vslei_bu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslei_hu(a: v8u16) -> v8i16 { +pub fn lsx_vslei_hu(a: v8u16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vslei_hu(a, IMM5) + unsafe { __lsx_vslei_hu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslei_wu(a: v4u32) -> v4i32 { +pub fn lsx_vslei_wu(a: v4u32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vslei_wu(a, IMM5) + unsafe { __lsx_vslei_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vslei_du(a: v2u64) -> v2i64 { +pub fn lsx_vslei_du(a: v2u64) -> v2i64 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vslei_du(a, IMM5) + unsafe { __lsx_vslei_du(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsat_b(a: v16i8) -> v16i8 { +pub fn lsx_vsat_b(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vsat_b(a, IMM3) + unsafe { __lsx_vsat_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsat_h(a: v8i16) -> v8i16 { +pub fn lsx_vsat_h(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsat_h(a, IMM4) + unsafe { __lsx_vsat_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsat_w(a: v4i32) -> v4i32 { +pub fn lsx_vsat_w(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsat_w(a, IMM5) + unsafe { __lsx_vsat_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsat_d(a: v2i64) -> v2i64 { +pub fn lsx_vsat_d(a: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vsat_d(a, IMM6) + unsafe { __lsx_vsat_d(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsat_bu(a: v16u8) -> v16u8 { +pub fn lsx_vsat_bu(a: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vsat_bu(a, IMM3) + unsafe { __lsx_vsat_bu(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsat_hu(a: v8u16) -> v8u16 { +pub fn lsx_vsat_hu(a: v8u16) -> v8u16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsat_hu(a, IMM4) + unsafe { __lsx_vsat_hu(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsat_wu(a: v4u32) -> v4u32 { +pub fn lsx_vsat_wu(a: v4u32) -> v4u32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsat_wu(a, IMM5) + unsafe { __lsx_vsat_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsat_du(a: v2u64) -> v2u64 { +pub fn lsx_vsat_du(a: v2u64) -> v2u64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vsat_du(a, IMM6) + unsafe { __lsx_vsat_du(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vadda_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vadda_b(a, b) +pub fn lsx_vadda_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vadda_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vadda_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vadda_h(a, b) +pub fn lsx_vadda_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vadda_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vadda_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vadda_w(a, b) +pub fn lsx_vadda_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vadda_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vadda_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vadda_d(a, b) +pub fn lsx_vadda_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vadda_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsadd_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vsadd_b(a, b) +pub fn lsx_vsadd_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vsadd_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsadd_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vsadd_h(a, b) +pub fn lsx_vsadd_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vsadd_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsadd_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vsadd_w(a, b) +pub fn lsx_vsadd_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vsadd_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsadd_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsadd_d(a, b) +pub fn lsx_vsadd_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsadd_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsadd_bu(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vsadd_bu(a, b) +pub fn lsx_vsadd_bu(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vsadd_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsadd_hu(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vsadd_hu(a, b) +pub fn lsx_vsadd_hu(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vsadd_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsadd_wu(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vsadd_wu(a, b) +pub fn lsx_vsadd_wu(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vsadd_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsadd_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vsadd_du(a, b) +pub fn lsx_vsadd_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vsadd_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavg_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vavg_b(a, b) +pub fn lsx_vavg_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vavg_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavg_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vavg_h(a, b) +pub fn lsx_vavg_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vavg_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavg_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vavg_w(a, b) +pub fn lsx_vavg_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vavg_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavg_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vavg_d(a, b) +pub fn lsx_vavg_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vavg_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavg_bu(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vavg_bu(a, b) +pub fn lsx_vavg_bu(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vavg_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavg_hu(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vavg_hu(a, b) +pub fn lsx_vavg_hu(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vavg_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavg_wu(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vavg_wu(a, b) +pub fn lsx_vavg_wu(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vavg_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavg_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vavg_du(a, b) +pub fn lsx_vavg_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vavg_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavgr_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vavgr_b(a, b) +pub fn lsx_vavgr_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vavgr_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavgr_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vavgr_h(a, b) +pub fn lsx_vavgr_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vavgr_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavgr_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vavgr_w(a, b) +pub fn lsx_vavgr_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vavgr_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavgr_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vavgr_d(a, b) +pub fn lsx_vavgr_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vavgr_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavgr_bu(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vavgr_bu(a, b) +pub fn lsx_vavgr_bu(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vavgr_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavgr_hu(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vavgr_hu(a, b) +pub fn lsx_vavgr_hu(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vavgr_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavgr_wu(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vavgr_wu(a, b) +pub fn lsx_vavgr_wu(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vavgr_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vavgr_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vavgr_du(a, b) +pub fn lsx_vavgr_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vavgr_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssub_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vssub_b(a, b) +pub fn lsx_vssub_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vssub_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssub_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vssub_h(a, b) +pub fn lsx_vssub_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vssub_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssub_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vssub_w(a, b) +pub fn lsx_vssub_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vssub_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssub_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vssub_d(a, b) +pub fn lsx_vssub_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vssub_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssub_bu(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vssub_bu(a, b) +pub fn lsx_vssub_bu(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vssub_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssub_hu(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vssub_hu(a, b) +pub fn lsx_vssub_hu(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vssub_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssub_wu(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vssub_wu(a, b) +pub fn lsx_vssub_wu(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vssub_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssub_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vssub_du(a, b) +pub fn lsx_vssub_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vssub_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vabsd_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vabsd_b(a, b) +pub fn lsx_vabsd_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vabsd_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vabsd_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vabsd_h(a, b) +pub fn lsx_vabsd_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vabsd_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vabsd_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vabsd_w(a, b) +pub fn lsx_vabsd_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vabsd_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vabsd_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vabsd_d(a, b) +pub fn lsx_vabsd_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vabsd_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vabsd_bu(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vabsd_bu(a, b) +pub fn lsx_vabsd_bu(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vabsd_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vabsd_hu(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vabsd_hu(a, b) +pub fn lsx_vabsd_hu(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vabsd_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vabsd_wu(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vabsd_wu(a, b) +pub fn lsx_vabsd_wu(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vabsd_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vabsd_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vabsd_du(a, b) +pub fn lsx_vabsd_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vabsd_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmul_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vmul_b(a, b) +pub fn lsx_vmul_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vmul_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmul_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vmul_h(a, b) +pub fn lsx_vmul_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vmul_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmul_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vmul_w(a, b) +pub fn lsx_vmul_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vmul_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmul_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vmul_d(a, b) +pub fn lsx_vmul_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vmul_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmadd_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 { - __lsx_vmadd_b(a, b, c) +pub fn lsx_vmadd_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 { + unsafe { __lsx_vmadd_b(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmadd_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 { - __lsx_vmadd_h(a, b, c) +pub fn lsx_vmadd_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 { + unsafe { __lsx_vmadd_h(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmadd_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 { - __lsx_vmadd_w(a, b, c) +pub fn lsx_vmadd_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 { + unsafe { __lsx_vmadd_w(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmadd_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 { - __lsx_vmadd_d(a, b, c) +pub fn lsx_vmadd_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 { + unsafe { __lsx_vmadd_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmsub_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 { - __lsx_vmsub_b(a, b, c) +pub fn lsx_vmsub_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 { + unsafe { __lsx_vmsub_b(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmsub_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 { - __lsx_vmsub_h(a, b, c) +pub fn lsx_vmsub_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 { + unsafe { __lsx_vmsub_h(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmsub_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 { - __lsx_vmsub_w(a, b, c) +pub fn lsx_vmsub_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 { + unsafe { __lsx_vmsub_w(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmsub_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 { - __lsx_vmsub_d(a, b, c) +pub fn lsx_vmsub_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 { + unsafe { __lsx_vmsub_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vdiv_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vdiv_b(a, b) +pub fn lsx_vdiv_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vdiv_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vdiv_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vdiv_h(a, b) +pub fn lsx_vdiv_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vdiv_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vdiv_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vdiv_w(a, b) +pub fn lsx_vdiv_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vdiv_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vdiv_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vdiv_d(a, b) +pub fn lsx_vdiv_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vdiv_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vdiv_bu(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vdiv_bu(a, b) +pub fn lsx_vdiv_bu(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vdiv_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vdiv_hu(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vdiv_hu(a, b) +pub fn lsx_vdiv_hu(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vdiv_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vdiv_wu(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vdiv_wu(a, b) +pub fn lsx_vdiv_wu(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vdiv_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vdiv_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vdiv_du(a, b) +pub fn lsx_vdiv_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vdiv_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhaddw_h_b(a: v16i8, b: v16i8) -> v8i16 { - __lsx_vhaddw_h_b(a, b) +pub fn lsx_vhaddw_h_b(a: v16i8, b: v16i8) -> v8i16 { + unsafe { __lsx_vhaddw_h_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhaddw_w_h(a: v8i16, b: v8i16) -> v4i32 { - __lsx_vhaddw_w_h(a, b) +pub fn lsx_vhaddw_w_h(a: v8i16, b: v8i16) -> v4i32 { + unsafe { __lsx_vhaddw_w_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhaddw_d_w(a: v4i32, b: v4i32) -> v2i64 { - __lsx_vhaddw_d_w(a, b) +pub fn lsx_vhaddw_d_w(a: v4i32, b: v4i32) -> v2i64 { + unsafe { __lsx_vhaddw_d_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhaddw_hu_bu(a: v16u8, b: v16u8) -> v8u16 { - __lsx_vhaddw_hu_bu(a, b) +pub fn lsx_vhaddw_hu_bu(a: v16u8, b: v16u8) -> v8u16 { + unsafe { __lsx_vhaddw_hu_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhaddw_wu_hu(a: v8u16, b: v8u16) -> v4u32 { - __lsx_vhaddw_wu_hu(a, b) +pub fn lsx_vhaddw_wu_hu(a: v8u16, b: v8u16) -> v4u32 { + unsafe { __lsx_vhaddw_wu_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhaddw_du_wu(a: v4u32, b: v4u32) -> v2u64 { - __lsx_vhaddw_du_wu(a, b) +pub fn lsx_vhaddw_du_wu(a: v4u32, b: v4u32) -> v2u64 { + unsafe { __lsx_vhaddw_du_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhsubw_h_b(a: v16i8, b: v16i8) -> v8i16 { - __lsx_vhsubw_h_b(a, b) +pub fn lsx_vhsubw_h_b(a: v16i8, b: v16i8) -> v8i16 { + unsafe { __lsx_vhsubw_h_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhsubw_w_h(a: v8i16, b: v8i16) -> v4i32 { - __lsx_vhsubw_w_h(a, b) +pub fn lsx_vhsubw_w_h(a: v8i16, b: v8i16) -> v4i32 { + unsafe { __lsx_vhsubw_w_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhsubw_d_w(a: v4i32, b: v4i32) -> v2i64 { - __lsx_vhsubw_d_w(a, b) +pub fn lsx_vhsubw_d_w(a: v4i32, b: v4i32) -> v2i64 { + unsafe { __lsx_vhsubw_d_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhsubw_hu_bu(a: v16u8, b: v16u8) -> v8i16 { - __lsx_vhsubw_hu_bu(a, b) +pub fn lsx_vhsubw_hu_bu(a: v16u8, b: v16u8) -> v8i16 { + unsafe { __lsx_vhsubw_hu_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhsubw_wu_hu(a: v8u16, b: v8u16) -> v4i32 { - __lsx_vhsubw_wu_hu(a, b) +pub fn lsx_vhsubw_wu_hu(a: v8u16, b: v8u16) -> v4i32 { + unsafe { __lsx_vhsubw_wu_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhsubw_du_wu(a: v4u32, b: v4u32) -> v2i64 { - __lsx_vhsubw_du_wu(a, b) +pub fn lsx_vhsubw_du_wu(a: v4u32, b: v4u32) -> v2i64 { + unsafe { __lsx_vhsubw_du_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmod_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vmod_b(a, b) +pub fn lsx_vmod_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vmod_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmod_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vmod_h(a, b) +pub fn lsx_vmod_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vmod_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmod_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vmod_w(a, b) +pub fn lsx_vmod_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vmod_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmod_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vmod_d(a, b) +pub fn lsx_vmod_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vmod_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmod_bu(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vmod_bu(a, b) +pub fn lsx_vmod_bu(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vmod_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmod_hu(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vmod_hu(a, b) +pub fn lsx_vmod_hu(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vmod_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmod_wu(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vmod_wu(a, b) +pub fn lsx_vmod_wu(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vmod_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmod_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vmod_du(a, b) +pub fn lsx_vmod_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vmod_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplve_b(a: v16i8, b: i32) -> v16i8 { - __lsx_vreplve_b(a, b) +pub fn lsx_vreplve_b(a: v16i8, b: i32) -> v16i8 { + unsafe { __lsx_vreplve_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplve_h(a: v8i16, b: i32) -> v8i16 { - __lsx_vreplve_h(a, b) +pub fn lsx_vreplve_h(a: v8i16, b: i32) -> v8i16 { + unsafe { __lsx_vreplve_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplve_w(a: v4i32, b: i32) -> v4i32 { - __lsx_vreplve_w(a, b) +pub fn lsx_vreplve_w(a: v4i32, b: i32) -> v4i32 { + unsafe { __lsx_vreplve_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplve_d(a: v2i64, b: i32) -> v2i64 { - __lsx_vreplve_d(a, b) +pub fn lsx_vreplve_d(a: v2i64, b: i32) -> v2i64 { + unsafe { __lsx_vreplve_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplvei_b(a: v16i8) -> v16i8 { +pub fn lsx_vreplvei_b(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vreplvei_b(a, IMM4) + unsafe { __lsx_vreplvei_b(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplvei_h(a: v8i16) -> v8i16 { +pub fn lsx_vreplvei_h(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vreplvei_h(a, IMM3) + unsafe { __lsx_vreplvei_h(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplvei_w(a: v4i32) -> v4i32 { +pub fn lsx_vreplvei_w(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM2, 2); - __lsx_vreplvei_w(a, IMM2) + unsafe { __lsx_vreplvei_w(a, IMM2) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplvei_d(a: v2i64) -> v2i64 { +pub fn lsx_vreplvei_d(a: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM1, 1); - __lsx_vreplvei_d(a, IMM1) + unsafe { __lsx_vreplvei_d(a, IMM1) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickev_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vpickev_b(a, b) +pub fn lsx_vpickev_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vpickev_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickev_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vpickev_h(a, b) +pub fn lsx_vpickev_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vpickev_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickev_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vpickev_w(a, b) +pub fn lsx_vpickev_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vpickev_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickev_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vpickev_d(a, b) +pub fn lsx_vpickev_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vpickev_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickod_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vpickod_b(a, b) +pub fn lsx_vpickod_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vpickod_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickod_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vpickod_h(a, b) +pub fn lsx_vpickod_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vpickod_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickod_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vpickod_w(a, b) +pub fn lsx_vpickod_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vpickod_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickod_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vpickod_d(a, b) +pub fn lsx_vpickod_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vpickod_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vilvh_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vilvh_b(a, b) +pub fn lsx_vilvh_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vilvh_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vilvh_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vilvh_h(a, b) +pub fn lsx_vilvh_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vilvh_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vilvh_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vilvh_w(a, b) +pub fn lsx_vilvh_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vilvh_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vilvh_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vilvh_d(a, b) +pub fn lsx_vilvh_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vilvh_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vilvl_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vilvl_b(a, b) +pub fn lsx_vilvl_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vilvl_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vilvl_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vilvl_h(a, b) +pub fn lsx_vilvl_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vilvl_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vilvl_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vilvl_w(a, b) +pub fn lsx_vilvl_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vilvl_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vilvl_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vilvl_d(a, b) +pub fn lsx_vilvl_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vilvl_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpackev_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vpackev_b(a, b) +pub fn lsx_vpackev_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vpackev_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpackev_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vpackev_h(a, b) +pub fn lsx_vpackev_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vpackev_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpackev_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vpackev_w(a, b) +pub fn lsx_vpackev_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vpackev_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpackev_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vpackev_d(a, b) +pub fn lsx_vpackev_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vpackev_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpackod_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vpackod_b(a, b) +pub fn lsx_vpackod_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vpackod_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpackod_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vpackod_h(a, b) +pub fn lsx_vpackod_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vpackod_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpackod_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vpackod_w(a, b) +pub fn lsx_vpackod_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vpackod_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpackod_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vpackod_d(a, b) +pub fn lsx_vpackod_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vpackod_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vshuf_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 { - __lsx_vshuf_h(a, b, c) +pub fn lsx_vshuf_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 { + unsafe { __lsx_vshuf_h(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vshuf_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 { - __lsx_vshuf_w(a, b, c) +pub fn lsx_vshuf_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 { + unsafe { __lsx_vshuf_w(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vshuf_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 { - __lsx_vshuf_d(a, b, c) +pub fn lsx_vshuf_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 { + unsafe { __lsx_vshuf_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vand_v(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vand_v(a, b) +pub fn lsx_vand_v(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vand_v(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vandi_b(a: v16u8) -> v16u8 { +pub fn lsx_vandi_b(a: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vandi_b(a, IMM8) + unsafe { __lsx_vandi_b(a, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vor_v(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vor_v(a, b) +pub fn lsx_vor_v(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vor_v(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vori_b(a: v16u8) -> v16u8 { +pub fn lsx_vori_b(a: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vori_b(a, IMM8) + unsafe { __lsx_vori_b(a, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vnor_v(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vnor_v(a, b) +pub fn lsx_vnor_v(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vnor_v(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vnori_b(a: v16u8) -> v16u8 { +pub fn lsx_vnori_b(a: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vnori_b(a, IMM8) + unsafe { __lsx_vnori_b(a, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vxor_v(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vxor_v(a, b) +pub fn lsx_vxor_v(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vxor_v(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vxori_b(a: v16u8) -> v16u8 { +pub fn lsx_vxori_b(a: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vxori_b(a, IMM8) + unsafe { __lsx_vxori_b(a, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitsel_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8 { - __lsx_vbitsel_v(a, b, c) +pub fn lsx_vbitsel_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8 { + unsafe { __lsx_vbitsel_v(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbitseli_b(a: v16u8, b: v16u8) -> v16u8 { +pub fn lsx_vbitseli_b(a: v16u8, b: v16u8) -> v16u8 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vbitseli_b(a, b, IMM8) + unsafe { __lsx_vbitseli_b(a, b, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vshuf4i_b(a: v16i8) -> v16i8 { +pub fn lsx_vshuf4i_b(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vshuf4i_b(a, IMM8) + unsafe { __lsx_vshuf4i_b(a, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vshuf4i_h(a: v8i16) -> v8i16 { +pub fn lsx_vshuf4i_h(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vshuf4i_h(a, IMM8) + unsafe { __lsx_vshuf4i_h(a, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vshuf4i_w(a: v4i32) -> v4i32 { +pub fn lsx_vshuf4i_w(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vshuf4i_w(a, IMM8) + unsafe { __lsx_vshuf4i_w(a, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplgr2vr_b(a: i32) -> v16i8 { - __lsx_vreplgr2vr_b(a) +pub fn lsx_vreplgr2vr_b(a: i32) -> v16i8 { + unsafe { __lsx_vreplgr2vr_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplgr2vr_h(a: i32) -> v8i16 { - __lsx_vreplgr2vr_h(a) +pub fn lsx_vreplgr2vr_h(a: i32) -> v8i16 { + unsafe { __lsx_vreplgr2vr_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplgr2vr_w(a: i32) -> v4i32 { - __lsx_vreplgr2vr_w(a) +pub fn lsx_vreplgr2vr_w(a: i32) -> v4i32 { + unsafe { __lsx_vreplgr2vr_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vreplgr2vr_d(a: i64) -> v2i64 { - __lsx_vreplgr2vr_d(a) +pub fn lsx_vreplgr2vr_d(a: i64) -> v2i64 { + unsafe { __lsx_vreplgr2vr_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpcnt_b(a: v16i8) -> v16i8 { - __lsx_vpcnt_b(a) +pub fn lsx_vpcnt_b(a: v16i8) -> v16i8 { + unsafe { __lsx_vpcnt_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpcnt_h(a: v8i16) -> v8i16 { - __lsx_vpcnt_h(a) +pub fn lsx_vpcnt_h(a: v8i16) -> v8i16 { + unsafe { __lsx_vpcnt_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpcnt_w(a: v4i32) -> v4i32 { - __lsx_vpcnt_w(a) +pub fn lsx_vpcnt_w(a: v4i32) -> v4i32 { + unsafe { __lsx_vpcnt_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpcnt_d(a: v2i64) -> v2i64 { - __lsx_vpcnt_d(a) +pub fn lsx_vpcnt_d(a: v2i64) -> v2i64 { + unsafe { __lsx_vpcnt_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vclo_b(a: v16i8) -> v16i8 { - __lsx_vclo_b(a) +pub fn lsx_vclo_b(a: v16i8) -> v16i8 { + unsafe { __lsx_vclo_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vclo_h(a: v8i16) -> v8i16 { - __lsx_vclo_h(a) +pub fn lsx_vclo_h(a: v8i16) -> v8i16 { + unsafe { __lsx_vclo_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vclo_w(a: v4i32) -> v4i32 { - __lsx_vclo_w(a) +pub fn lsx_vclo_w(a: v4i32) -> v4i32 { + unsafe { __lsx_vclo_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vclo_d(a: v2i64) -> v2i64 { - __lsx_vclo_d(a) +pub fn lsx_vclo_d(a: v2i64) -> v2i64 { + unsafe { __lsx_vclo_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vclz_b(a: v16i8) -> v16i8 { - __lsx_vclz_b(a) +pub fn lsx_vclz_b(a: v16i8) -> v16i8 { + unsafe { __lsx_vclz_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vclz_h(a: v8i16) -> v8i16 { - __lsx_vclz_h(a) +pub fn lsx_vclz_h(a: v8i16) -> v8i16 { + unsafe { __lsx_vclz_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vclz_w(a: v4i32) -> v4i32 { - __lsx_vclz_w(a) +pub fn lsx_vclz_w(a: v4i32) -> v4i32 { + unsafe { __lsx_vclz_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vclz_d(a: v2i64) -> v2i64 { - __lsx_vclz_d(a) +pub fn lsx_vclz_d(a: v2i64) -> v2i64 { + unsafe { __lsx_vclz_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickve2gr_b(a: v16i8) -> i32 { +pub fn lsx_vpickve2gr_b(a: v16i8) -> i32 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vpickve2gr_b(a, IMM4) + unsafe { __lsx_vpickve2gr_b(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickve2gr_h(a: v8i16) -> i32 { +pub fn lsx_vpickve2gr_h(a: v8i16) -> i32 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vpickve2gr_h(a, IMM3) + unsafe { __lsx_vpickve2gr_h(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickve2gr_w(a: v4i32) -> i32 { +pub fn lsx_vpickve2gr_w(a: v4i32) -> i32 { static_assert_uimm_bits!(IMM2, 2); - __lsx_vpickve2gr_w(a, IMM2) + unsafe { __lsx_vpickve2gr_w(a, IMM2) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickve2gr_d(a: v2i64) -> i64 { +pub fn lsx_vpickve2gr_d(a: v2i64) -> i64 { static_assert_uimm_bits!(IMM1, 1); - __lsx_vpickve2gr_d(a, IMM1) + unsafe { __lsx_vpickve2gr_d(a, IMM1) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickve2gr_bu(a: v16i8) -> u32 { +pub fn lsx_vpickve2gr_bu(a: v16i8) -> u32 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vpickve2gr_bu(a, IMM4) + unsafe { __lsx_vpickve2gr_bu(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickve2gr_hu(a: v8i16) -> u32 { +pub fn lsx_vpickve2gr_hu(a: v8i16) -> u32 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vpickve2gr_hu(a, IMM3) + unsafe { __lsx_vpickve2gr_hu(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickve2gr_wu(a: v4i32) -> u32 { +pub fn lsx_vpickve2gr_wu(a: v4i32) -> u32 { static_assert_uimm_bits!(IMM2, 2); - __lsx_vpickve2gr_wu(a, IMM2) + unsafe { __lsx_vpickve2gr_wu(a, IMM2) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpickve2gr_du(a: v2i64) -> u64 { +pub fn lsx_vpickve2gr_du(a: v2i64) -> u64 { static_assert_uimm_bits!(IMM1, 1); - __lsx_vpickve2gr_du(a, IMM1) + unsafe { __lsx_vpickve2gr_du(a, IMM1) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vinsgr2vr_b(a: v16i8, b: i32) -> v16i8 { +pub fn lsx_vinsgr2vr_b(a: v16i8, b: i32) -> v16i8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vinsgr2vr_b(a, b, IMM4) + unsafe { __lsx_vinsgr2vr_b(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vinsgr2vr_h(a: v8i16, b: i32) -> v8i16 { +pub fn lsx_vinsgr2vr_h(a: v8i16, b: i32) -> v8i16 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vinsgr2vr_h(a, b, IMM3) + unsafe { __lsx_vinsgr2vr_h(a, b, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vinsgr2vr_w(a: v4i32, b: i32) -> v4i32 { +pub fn lsx_vinsgr2vr_w(a: v4i32, b: i32) -> v4i32 { static_assert_uimm_bits!(IMM2, 2); - __lsx_vinsgr2vr_w(a, b, IMM2) + unsafe { __lsx_vinsgr2vr_w(a, b, IMM2) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vinsgr2vr_d(a: v2i64, b: i64) -> v2i64 { +pub fn lsx_vinsgr2vr_d(a: v2i64, b: i64) -> v2i64 { static_assert_uimm_bits!(IMM1, 1); - __lsx_vinsgr2vr_d(a, b, IMM1) + unsafe { __lsx_vinsgr2vr_d(a, b, IMM1) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfadd_s(a: v4f32, b: v4f32) -> v4f32 { - __lsx_vfadd_s(a, b) +pub fn lsx_vfadd_s(a: v4f32, b: v4f32) -> v4f32 { + unsafe { __lsx_vfadd_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfadd_d(a: v2f64, b: v2f64) -> v2f64 { - __lsx_vfadd_d(a, b) +pub fn lsx_vfadd_d(a: v2f64, b: v2f64) -> v2f64 { + unsafe { __lsx_vfadd_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfsub_s(a: v4f32, b: v4f32) -> v4f32 { - __lsx_vfsub_s(a, b) +pub fn lsx_vfsub_s(a: v4f32, b: v4f32) -> v4f32 { + unsafe { __lsx_vfsub_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfsub_d(a: v2f64, b: v2f64) -> v2f64 { - __lsx_vfsub_d(a, b) +pub fn lsx_vfsub_d(a: v2f64, b: v2f64) -> v2f64 { + unsafe { __lsx_vfsub_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmul_s(a: v4f32, b: v4f32) -> v4f32 { - __lsx_vfmul_s(a, b) +pub fn lsx_vfmul_s(a: v4f32, b: v4f32) -> v4f32 { + unsafe { __lsx_vfmul_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmul_d(a: v2f64, b: v2f64) -> v2f64 { - __lsx_vfmul_d(a, b) +pub fn lsx_vfmul_d(a: v2f64, b: v2f64) -> v2f64 { + unsafe { __lsx_vfmul_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfdiv_s(a: v4f32, b: v4f32) -> v4f32 { - __lsx_vfdiv_s(a, b) +pub fn lsx_vfdiv_s(a: v4f32, b: v4f32) -> v4f32 { + unsafe { __lsx_vfdiv_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfdiv_d(a: v2f64, b: v2f64) -> v2f64 { - __lsx_vfdiv_d(a, b) +pub fn lsx_vfdiv_d(a: v2f64, b: v2f64) -> v2f64 { + unsafe { __lsx_vfdiv_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcvt_h_s(a: v4f32, b: v4f32) -> v8i16 { - __lsx_vfcvt_h_s(a, b) +pub fn lsx_vfcvt_h_s(a: v4f32, b: v4f32) -> v8i16 { + unsafe { __lsx_vfcvt_h_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcvt_s_d(a: v2f64, b: v2f64) -> v4f32 { - __lsx_vfcvt_s_d(a, b) +pub fn lsx_vfcvt_s_d(a: v2f64, b: v2f64) -> v4f32 { + unsafe { __lsx_vfcvt_s_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmin_s(a: v4f32, b: v4f32) -> v4f32 { - __lsx_vfmin_s(a, b) +pub fn lsx_vfmin_s(a: v4f32, b: v4f32) -> v4f32 { + unsafe { __lsx_vfmin_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmin_d(a: v2f64, b: v2f64) -> v2f64 { - __lsx_vfmin_d(a, b) +pub fn lsx_vfmin_d(a: v2f64, b: v2f64) -> v2f64 { + unsafe { __lsx_vfmin_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmina_s(a: v4f32, b: v4f32) -> v4f32 { - __lsx_vfmina_s(a, b) +pub fn lsx_vfmina_s(a: v4f32, b: v4f32) -> v4f32 { + unsafe { __lsx_vfmina_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmina_d(a: v2f64, b: v2f64) -> v2f64 { - __lsx_vfmina_d(a, b) +pub fn lsx_vfmina_d(a: v2f64, b: v2f64) -> v2f64 { + unsafe { __lsx_vfmina_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmax_s(a: v4f32, b: v4f32) -> v4f32 { - __lsx_vfmax_s(a, b) +pub fn lsx_vfmax_s(a: v4f32, b: v4f32) -> v4f32 { + unsafe { __lsx_vfmax_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmax_d(a: v2f64, b: v2f64) -> v2f64 { - __lsx_vfmax_d(a, b) +pub fn lsx_vfmax_d(a: v2f64, b: v2f64) -> v2f64 { + unsafe { __lsx_vfmax_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmaxa_s(a: v4f32, b: v4f32) -> v4f32 { - __lsx_vfmaxa_s(a, b) +pub fn lsx_vfmaxa_s(a: v4f32, b: v4f32) -> v4f32 { + unsafe { __lsx_vfmaxa_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmaxa_d(a: v2f64, b: v2f64) -> v2f64 { - __lsx_vfmaxa_d(a, b) +pub fn lsx_vfmaxa_d(a: v2f64, b: v2f64) -> v2f64 { + unsafe { __lsx_vfmaxa_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfclass_s(a: v4f32) -> v4i32 { - __lsx_vfclass_s(a) +pub fn lsx_vfclass_s(a: v4f32) -> v4i32 { + unsafe { __lsx_vfclass_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfclass_d(a: v2f64) -> v2i64 { - __lsx_vfclass_d(a) +pub fn lsx_vfclass_d(a: v2f64) -> v2i64 { + unsafe { __lsx_vfclass_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfsqrt_s(a: v4f32) -> v4f32 { - __lsx_vfsqrt_s(a) +pub fn lsx_vfsqrt_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vfsqrt_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfsqrt_d(a: v2f64) -> v2f64 { - __lsx_vfsqrt_d(a) +pub fn lsx_vfsqrt_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vfsqrt_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrecip_s(a: v4f32) -> v4f32 { - __lsx_vfrecip_s(a) +pub fn lsx_vfrecip_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vfrecip_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrecip_d(a: v2f64) -> v2f64 { - __lsx_vfrecip_d(a) +pub fn lsx_vfrecip_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vfrecip_d(a) } } #[inline] #[target_feature(enable = "lsx,frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrecipe_s(a: v4f32) -> v4f32 { - __lsx_vfrecipe_s(a) +pub fn lsx_vfrecipe_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vfrecipe_s(a) } } #[inline] #[target_feature(enable = "lsx,frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrecipe_d(a: v2f64) -> v2f64 { - __lsx_vfrecipe_d(a) +pub fn lsx_vfrecipe_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vfrecipe_d(a) } } #[inline] #[target_feature(enable = "lsx,frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrsqrte_s(a: v4f32) -> v4f32 { - __lsx_vfrsqrte_s(a) +pub fn lsx_vfrsqrte_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vfrsqrte_s(a) } } #[inline] #[target_feature(enable = "lsx,frecipe")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrsqrte_d(a: v2f64) -> v2f64 { - __lsx_vfrsqrte_d(a) +pub fn lsx_vfrsqrte_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vfrsqrte_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrint_s(a: v4f32) -> v4f32 { - __lsx_vfrint_s(a) +pub fn lsx_vfrint_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vfrint_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrint_d(a: v2f64) -> v2f64 { - __lsx_vfrint_d(a) +pub fn lsx_vfrint_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vfrint_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrsqrt_s(a: v4f32) -> v4f32 { - __lsx_vfrsqrt_s(a) +pub fn lsx_vfrsqrt_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vfrsqrt_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrsqrt_d(a: v2f64) -> v2f64 { - __lsx_vfrsqrt_d(a) +pub fn lsx_vfrsqrt_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vfrsqrt_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vflogb_s(a: v4f32) -> v4f32 { - __lsx_vflogb_s(a) +pub fn lsx_vflogb_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vflogb_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vflogb_d(a: v2f64) -> v2f64 { - __lsx_vflogb_d(a) +pub fn lsx_vflogb_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vflogb_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcvth_s_h(a: v8i16) -> v4f32 { - __lsx_vfcvth_s_h(a) +pub fn lsx_vfcvth_s_h(a: v8i16) -> v4f32 { + unsafe { __lsx_vfcvth_s_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcvth_d_s(a: v4f32) -> v2f64 { - __lsx_vfcvth_d_s(a) +pub fn lsx_vfcvth_d_s(a: v4f32) -> v2f64 { + unsafe { __lsx_vfcvth_d_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcvtl_s_h(a: v8i16) -> v4f32 { - __lsx_vfcvtl_s_h(a) +pub fn lsx_vfcvtl_s_h(a: v8i16) -> v4f32 { + unsafe { __lsx_vfcvtl_s_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcvtl_d_s(a: v4f32) -> v2f64 { - __lsx_vfcvtl_d_s(a) +pub fn lsx_vfcvtl_d_s(a: v4f32) -> v2f64 { + unsafe { __lsx_vfcvtl_d_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftint_w_s(a: v4f32) -> v4i32 { - __lsx_vftint_w_s(a) +pub fn lsx_vftint_w_s(a: v4f32) -> v4i32 { + unsafe { __lsx_vftint_w_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftint_l_d(a: v2f64) -> v2i64 { - __lsx_vftint_l_d(a) +pub fn lsx_vftint_l_d(a: v2f64) -> v2i64 { + unsafe { __lsx_vftint_l_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftint_wu_s(a: v4f32) -> v4u32 { - __lsx_vftint_wu_s(a) +pub fn lsx_vftint_wu_s(a: v4f32) -> v4u32 { + unsafe { __lsx_vftint_wu_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftint_lu_d(a: v2f64) -> v2u64 { - __lsx_vftint_lu_d(a) +pub fn lsx_vftint_lu_d(a: v2f64) -> v2u64 { + unsafe { __lsx_vftint_lu_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrz_w_s(a: v4f32) -> v4i32 { - __lsx_vftintrz_w_s(a) +pub fn lsx_vftintrz_w_s(a: v4f32) -> v4i32 { + unsafe { __lsx_vftintrz_w_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrz_l_d(a: v2f64) -> v2i64 { - __lsx_vftintrz_l_d(a) +pub fn lsx_vftintrz_l_d(a: v2f64) -> v2i64 { + unsafe { __lsx_vftintrz_l_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrz_wu_s(a: v4f32) -> v4u32 { - __lsx_vftintrz_wu_s(a) +pub fn lsx_vftintrz_wu_s(a: v4f32) -> v4u32 { + unsafe { __lsx_vftintrz_wu_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrz_lu_d(a: v2f64) -> v2u64 { - __lsx_vftintrz_lu_d(a) +pub fn lsx_vftintrz_lu_d(a: v2f64) -> v2u64 { + unsafe { __lsx_vftintrz_lu_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vffint_s_w(a: v4i32) -> v4f32 { - __lsx_vffint_s_w(a) +pub fn lsx_vffint_s_w(a: v4i32) -> v4f32 { + unsafe { __lsx_vffint_s_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vffint_d_l(a: v2i64) -> v2f64 { - __lsx_vffint_d_l(a) +pub fn lsx_vffint_d_l(a: v2i64) -> v2f64 { + unsafe { __lsx_vffint_d_l(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vffint_s_wu(a: v4u32) -> v4f32 { - __lsx_vffint_s_wu(a) +pub fn lsx_vffint_s_wu(a: v4u32) -> v4f32 { + unsafe { __lsx_vffint_s_wu(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vffint_d_lu(a: v2u64) -> v2f64 { - __lsx_vffint_d_lu(a) +pub fn lsx_vffint_d_lu(a: v2u64) -> v2f64 { + unsafe { __lsx_vffint_d_lu(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vandn_v(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vandn_v(a, b) +pub fn lsx_vandn_v(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vandn_v(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vneg_b(a: v16i8) -> v16i8 { - __lsx_vneg_b(a) +pub fn lsx_vneg_b(a: v16i8) -> v16i8 { + unsafe { __lsx_vneg_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vneg_h(a: v8i16) -> v8i16 { - __lsx_vneg_h(a) +pub fn lsx_vneg_h(a: v8i16) -> v8i16 { + unsafe { __lsx_vneg_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vneg_w(a: v4i32) -> v4i32 { - __lsx_vneg_w(a) +pub fn lsx_vneg_w(a: v4i32) -> v4i32 { + unsafe { __lsx_vneg_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vneg_d(a: v2i64) -> v2i64 { - __lsx_vneg_d(a) +pub fn lsx_vneg_d(a: v2i64) -> v2i64 { + unsafe { __lsx_vneg_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmuh_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vmuh_b(a, b) +pub fn lsx_vmuh_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vmuh_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmuh_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vmuh_h(a, b) +pub fn lsx_vmuh_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vmuh_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmuh_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vmuh_w(a, b) +pub fn lsx_vmuh_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vmuh_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmuh_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vmuh_d(a, b) +pub fn lsx_vmuh_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vmuh_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmuh_bu(a: v16u8, b: v16u8) -> v16u8 { - __lsx_vmuh_bu(a, b) +pub fn lsx_vmuh_bu(a: v16u8, b: v16u8) -> v16u8 { + unsafe { __lsx_vmuh_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmuh_hu(a: v8u16, b: v8u16) -> v8u16 { - __lsx_vmuh_hu(a, b) +pub fn lsx_vmuh_hu(a: v8u16, b: v8u16) -> v8u16 { + unsafe { __lsx_vmuh_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmuh_wu(a: v4u32, b: v4u32) -> v4u32 { - __lsx_vmuh_wu(a, b) +pub fn lsx_vmuh_wu(a: v4u32, b: v4u32) -> v4u32 { + unsafe { __lsx_vmuh_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmuh_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vmuh_du(a, b) +pub fn lsx_vmuh_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vmuh_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsllwil_h_b(a: v16i8) -> v8i16 { +pub fn lsx_vsllwil_h_b(a: v16i8) -> v8i16 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vsllwil_h_b(a, IMM3) + unsafe { __lsx_vsllwil_h_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsllwil_w_h(a: v8i16) -> v4i32 { +pub fn lsx_vsllwil_w_h(a: v8i16) -> v4i32 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsllwil_w_h(a, IMM4) + unsafe { __lsx_vsllwil_w_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsllwil_d_w(a: v4i32) -> v2i64 { +pub fn lsx_vsllwil_d_w(a: v4i32) -> v2i64 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsllwil_d_w(a, IMM5) + unsafe { __lsx_vsllwil_d_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsllwil_hu_bu(a: v16u8) -> v8u16 { +pub fn lsx_vsllwil_hu_bu(a: v16u8) -> v8u16 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vsllwil_hu_bu(a, IMM3) + unsafe { __lsx_vsllwil_hu_bu(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsllwil_wu_hu(a: v8u16) -> v4u32 { +pub fn lsx_vsllwil_wu_hu(a: v8u16) -> v4u32 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsllwil_wu_hu(a, IMM4) + unsafe { __lsx_vsllwil_wu_hu(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsllwil_du_wu(a: v4u32) -> v2u64 { +pub fn lsx_vsllwil_du_wu(a: v4u32) -> v2u64 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsllwil_du_wu(a, IMM5) + unsafe { __lsx_vsllwil_du_wu(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsran_b_h(a: v8i16, b: v8i16) -> v16i8 { - __lsx_vsran_b_h(a, b) +pub fn lsx_vsran_b_h(a: v8i16, b: v8i16) -> v16i8 { + unsafe { __lsx_vsran_b_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsran_h_w(a: v4i32, b: v4i32) -> v8i16 { - __lsx_vsran_h_w(a, b) +pub fn lsx_vsran_h_w(a: v4i32, b: v4i32) -> v8i16 { + unsafe { __lsx_vsran_h_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsran_w_d(a: v2i64, b: v2i64) -> v4i32 { - __lsx_vsran_w_d(a, b) +pub fn lsx_vsran_w_d(a: v2i64, b: v2i64) -> v4i32 { + unsafe { __lsx_vsran_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssran_b_h(a: v8i16, b: v8i16) -> v16i8 { - __lsx_vssran_b_h(a, b) +pub fn lsx_vssran_b_h(a: v8i16, b: v8i16) -> v16i8 { + unsafe { __lsx_vssran_b_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssran_h_w(a: v4i32, b: v4i32) -> v8i16 { - __lsx_vssran_h_w(a, b) +pub fn lsx_vssran_h_w(a: v4i32, b: v4i32) -> v8i16 { + unsafe { __lsx_vssran_h_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssran_w_d(a: v2i64, b: v2i64) -> v4i32 { - __lsx_vssran_w_d(a, b) +pub fn lsx_vssran_w_d(a: v2i64, b: v2i64) -> v4i32 { + unsafe { __lsx_vssran_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssran_bu_h(a: v8u16, b: v8u16) -> v16u8 { - __lsx_vssran_bu_h(a, b) +pub fn lsx_vssran_bu_h(a: v8u16, b: v8u16) -> v16u8 { + unsafe { __lsx_vssran_bu_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssran_hu_w(a: v4u32, b: v4u32) -> v8u16 { - __lsx_vssran_hu_w(a, b) +pub fn lsx_vssran_hu_w(a: v4u32, b: v4u32) -> v8u16 { + unsafe { __lsx_vssran_hu_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssran_wu_d(a: v2u64, b: v2u64) -> v4u32 { - __lsx_vssran_wu_d(a, b) +pub fn lsx_vssran_wu_d(a: v2u64, b: v2u64) -> v4u32 { + unsafe { __lsx_vssran_wu_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrarn_b_h(a: v8i16, b: v8i16) -> v16i8 { - __lsx_vsrarn_b_h(a, b) +pub fn lsx_vsrarn_b_h(a: v8i16, b: v8i16) -> v16i8 { + unsafe { __lsx_vsrarn_b_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrarn_h_w(a: v4i32, b: v4i32) -> v8i16 { - __lsx_vsrarn_h_w(a, b) +pub fn lsx_vsrarn_h_w(a: v4i32, b: v4i32) -> v8i16 { + unsafe { __lsx_vsrarn_h_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrarn_w_d(a: v2i64, b: v2i64) -> v4i32 { - __lsx_vsrarn_w_d(a, b) +pub fn lsx_vsrarn_w_d(a: v2i64, b: v2i64) -> v4i32 { + unsafe { __lsx_vsrarn_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarn_b_h(a: v8i16, b: v8i16) -> v16i8 { - __lsx_vssrarn_b_h(a, b) +pub fn lsx_vssrarn_b_h(a: v8i16, b: v8i16) -> v16i8 { + unsafe { __lsx_vssrarn_b_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarn_h_w(a: v4i32, b: v4i32) -> v8i16 { - __lsx_vssrarn_h_w(a, b) +pub fn lsx_vssrarn_h_w(a: v4i32, b: v4i32) -> v8i16 { + unsafe { __lsx_vssrarn_h_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarn_w_d(a: v2i64, b: v2i64) -> v4i32 { - __lsx_vssrarn_w_d(a, b) +pub fn lsx_vssrarn_w_d(a: v2i64, b: v2i64) -> v4i32 { + unsafe { __lsx_vssrarn_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarn_bu_h(a: v8u16, b: v8u16) -> v16u8 { - __lsx_vssrarn_bu_h(a, b) +pub fn lsx_vssrarn_bu_h(a: v8u16, b: v8u16) -> v16u8 { + unsafe { __lsx_vssrarn_bu_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarn_hu_w(a: v4u32, b: v4u32) -> v8u16 { - __lsx_vssrarn_hu_w(a, b) +pub fn lsx_vssrarn_hu_w(a: v4u32, b: v4u32) -> v8u16 { + unsafe { __lsx_vssrarn_hu_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarn_wu_d(a: v2u64, b: v2u64) -> v4u32 { - __lsx_vssrarn_wu_d(a, b) +pub fn lsx_vssrarn_wu_d(a: v2u64, b: v2u64) -> v4u32 { + unsafe { __lsx_vssrarn_wu_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrln_b_h(a: v8i16, b: v8i16) -> v16i8 { - __lsx_vsrln_b_h(a, b) +pub fn lsx_vsrln_b_h(a: v8i16, b: v8i16) -> v16i8 { + unsafe { __lsx_vsrln_b_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrln_h_w(a: v4i32, b: v4i32) -> v8i16 { - __lsx_vsrln_h_w(a, b) +pub fn lsx_vsrln_h_w(a: v4i32, b: v4i32) -> v8i16 { + unsafe { __lsx_vsrln_h_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrln_w_d(a: v2i64, b: v2i64) -> v4i32 { - __lsx_vsrln_w_d(a, b) +pub fn lsx_vsrln_w_d(a: v2i64, b: v2i64) -> v4i32 { + unsafe { __lsx_vsrln_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrln_bu_h(a: v8u16, b: v8u16) -> v16u8 { - __lsx_vssrln_bu_h(a, b) +pub fn lsx_vssrln_bu_h(a: v8u16, b: v8u16) -> v16u8 { + unsafe { __lsx_vssrln_bu_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrln_hu_w(a: v4u32, b: v4u32) -> v8u16 { - __lsx_vssrln_hu_w(a, b) +pub fn lsx_vssrln_hu_w(a: v4u32, b: v4u32) -> v8u16 { + unsafe { __lsx_vssrln_hu_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrln_wu_d(a: v2u64, b: v2u64) -> v4u32 { - __lsx_vssrln_wu_d(a, b) +pub fn lsx_vssrln_wu_d(a: v2u64, b: v2u64) -> v4u32 { + unsafe { __lsx_vssrln_wu_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlrn_b_h(a: v8i16, b: v8i16) -> v16i8 { - __lsx_vsrlrn_b_h(a, b) +pub fn lsx_vsrlrn_b_h(a: v8i16, b: v8i16) -> v16i8 { + unsafe { __lsx_vsrlrn_b_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlrn_h_w(a: v4i32, b: v4i32) -> v8i16 { - __lsx_vsrlrn_h_w(a, b) +pub fn lsx_vsrlrn_h_w(a: v4i32, b: v4i32) -> v8i16 { + unsafe { __lsx_vsrlrn_h_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlrn_w_d(a: v2i64, b: v2i64) -> v4i32 { - __lsx_vsrlrn_w_d(a, b) +pub fn lsx_vsrlrn_w_d(a: v2i64, b: v2i64) -> v4i32 { + unsafe { __lsx_vsrlrn_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrn_bu_h(a: v8u16, b: v8u16) -> v16u8 { - __lsx_vssrlrn_bu_h(a, b) +pub fn lsx_vssrlrn_bu_h(a: v8u16, b: v8u16) -> v16u8 { + unsafe { __lsx_vssrlrn_bu_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrn_hu_w(a: v4u32, b: v4u32) -> v8u16 { - __lsx_vssrlrn_hu_w(a, b) +pub fn lsx_vssrlrn_hu_w(a: v4u32, b: v4u32) -> v8u16 { + unsafe { __lsx_vssrlrn_hu_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrn_wu_d(a: v2u64, b: v2u64) -> v4u32 { - __lsx_vssrlrn_wu_d(a, b) +pub fn lsx_vssrlrn_wu_d(a: v2u64, b: v2u64) -> v4u32 { + unsafe { __lsx_vssrlrn_wu_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrstpi_b(a: v16i8, b: v16i8) -> v16i8 { +pub fn lsx_vfrstpi_b(a: v16i8, b: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vfrstpi_b(a, b, IMM5) + unsafe { __lsx_vfrstpi_b(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrstpi_h(a: v8i16, b: v8i16) -> v8i16 { +pub fn lsx_vfrstpi_h(a: v8i16, b: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vfrstpi_h(a, b, IMM5) + unsafe { __lsx_vfrstpi_h(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrstp_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 { - __lsx_vfrstp_b(a, b, c) +pub fn lsx_vfrstp_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 { + unsafe { __lsx_vfrstp_b(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrstp_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 { - __lsx_vfrstp_h(a, b, c) +pub fn lsx_vfrstp_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 { + unsafe { __lsx_vfrstp_h(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vshuf4i_d(a: v2i64, b: v2i64) -> v2i64 { +pub fn lsx_vshuf4i_d(a: v2i64, b: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vshuf4i_d(a, b, IMM8) + unsafe { __lsx_vshuf4i_d(a, b, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbsrl_v(a: v16i8) -> v16i8 { +pub fn lsx_vbsrl_v(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vbsrl_v(a, IMM5) + unsafe { __lsx_vbsrl_v(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vbsll_v(a: v16i8) -> v16i8 { +pub fn lsx_vbsll_v(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vbsll_v(a, IMM5) + unsafe { __lsx_vbsll_v(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vextrins_b(a: v16i8, b: v16i8) -> v16i8 { +pub fn lsx_vextrins_b(a: v16i8, b: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vextrins_b(a, b, IMM8) + unsafe { __lsx_vextrins_b(a, b, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vextrins_h(a: v8i16, b: v8i16) -> v8i16 { +pub fn lsx_vextrins_h(a: v8i16, b: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vextrins_h(a, b, IMM8) + unsafe { __lsx_vextrins_h(a, b, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vextrins_w(a: v4i32, b: v4i32) -> v4i32 { +pub fn lsx_vextrins_w(a: v4i32, b: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vextrins_w(a, b, IMM8) + unsafe { __lsx_vextrins_w(a, b, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vextrins_d(a: v2i64, b: v2i64) -> v2i64 { +pub fn lsx_vextrins_d(a: v2i64, b: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vextrins_d(a, b, IMM8) + unsafe { __lsx_vextrins_d(a, b, IMM8) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmskltz_b(a: v16i8) -> v16i8 { - __lsx_vmskltz_b(a) +pub fn lsx_vmskltz_b(a: v16i8) -> v16i8 { + unsafe { __lsx_vmskltz_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmskltz_h(a: v8i16) -> v8i16 { - __lsx_vmskltz_h(a) +pub fn lsx_vmskltz_h(a: v8i16) -> v8i16 { + unsafe { __lsx_vmskltz_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmskltz_w(a: v4i32) -> v4i32 { - __lsx_vmskltz_w(a) +pub fn lsx_vmskltz_w(a: v4i32) -> v4i32 { + unsafe { __lsx_vmskltz_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmskltz_d(a: v2i64) -> v2i64 { - __lsx_vmskltz_d(a) +pub fn lsx_vmskltz_d(a: v2i64) -> v2i64 { + unsafe { __lsx_vmskltz_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsigncov_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vsigncov_b(a, b) +pub fn lsx_vsigncov_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vsigncov_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsigncov_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vsigncov_h(a, b) +pub fn lsx_vsigncov_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vsigncov_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsigncov_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vsigncov_w(a, b) +pub fn lsx_vsigncov_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vsigncov_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsigncov_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsigncov_d(a, b) +pub fn lsx_vsigncov_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsigncov_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmadd_s(a: v4f32, b: v4f32, c: v4f32) -> v4f32 { - __lsx_vfmadd_s(a, b, c) +pub fn lsx_vfmadd_s(a: v4f32, b: v4f32, c: v4f32) -> v4f32 { + unsafe { __lsx_vfmadd_s(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmadd_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 { - __lsx_vfmadd_d(a, b, c) +pub fn lsx_vfmadd_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 { + unsafe { __lsx_vfmadd_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmsub_s(a: v4f32, b: v4f32, c: v4f32) -> v4f32 { - __lsx_vfmsub_s(a, b, c) +pub fn lsx_vfmsub_s(a: v4f32, b: v4f32, c: v4f32) -> v4f32 { + unsafe { __lsx_vfmsub_s(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfmsub_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 { - __lsx_vfmsub_d(a, b, c) +pub fn lsx_vfmsub_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 { + unsafe { __lsx_vfmsub_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfnmadd_s(a: v4f32, b: v4f32, c: v4f32) -> v4f32 { - __lsx_vfnmadd_s(a, b, c) +pub fn lsx_vfnmadd_s(a: v4f32, b: v4f32, c: v4f32) -> v4f32 { + unsafe { __lsx_vfnmadd_s(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfnmadd_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 { - __lsx_vfnmadd_d(a, b, c) +pub fn lsx_vfnmadd_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 { + unsafe { __lsx_vfnmadd_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfnmsub_s(a: v4f32, b: v4f32, c: v4f32) -> v4f32 { - __lsx_vfnmsub_s(a, b, c) +pub fn lsx_vfnmsub_s(a: v4f32, b: v4f32, c: v4f32) -> v4f32 { + unsafe { __lsx_vfnmsub_s(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfnmsub_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 { - __lsx_vfnmsub_d(a, b, c) +pub fn lsx_vfnmsub_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 { + unsafe { __lsx_vfnmsub_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrne_w_s(a: v4f32) -> v4i32 { - __lsx_vftintrne_w_s(a) +pub fn lsx_vftintrne_w_s(a: v4f32) -> v4i32 { + unsafe { __lsx_vftintrne_w_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrne_l_d(a: v2f64) -> v2i64 { - __lsx_vftintrne_l_d(a) +pub fn lsx_vftintrne_l_d(a: v2f64) -> v2i64 { + unsafe { __lsx_vftintrne_l_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrp_w_s(a: v4f32) -> v4i32 { - __lsx_vftintrp_w_s(a) +pub fn lsx_vftintrp_w_s(a: v4f32) -> v4i32 { + unsafe { __lsx_vftintrp_w_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrp_l_d(a: v2f64) -> v2i64 { - __lsx_vftintrp_l_d(a) +pub fn lsx_vftintrp_l_d(a: v2f64) -> v2i64 { + unsafe { __lsx_vftintrp_l_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrm_w_s(a: v4f32) -> v4i32 { - __lsx_vftintrm_w_s(a) +pub fn lsx_vftintrm_w_s(a: v4f32) -> v4i32 { + unsafe { __lsx_vftintrm_w_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrm_l_d(a: v2f64) -> v2i64 { - __lsx_vftintrm_l_d(a) +pub fn lsx_vftintrm_l_d(a: v2f64) -> v2i64 { + unsafe { __lsx_vftintrm_l_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftint_w_d(a: v2f64, b: v2f64) -> v4i32 { - __lsx_vftint_w_d(a, b) +pub fn lsx_vftint_w_d(a: v2f64, b: v2f64) -> v4i32 { + unsafe { __lsx_vftint_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vffint_s_l(a: v2i64, b: v2i64) -> v4f32 { - __lsx_vffint_s_l(a, b) +pub fn lsx_vffint_s_l(a: v2i64, b: v2i64) -> v4f32 { + unsafe { __lsx_vffint_s_l(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrz_w_d(a: v2f64, b: v2f64) -> v4i32 { - __lsx_vftintrz_w_d(a, b) +pub fn lsx_vftintrz_w_d(a: v2f64, b: v2f64) -> v4i32 { + unsafe { __lsx_vftintrz_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrp_w_d(a: v2f64, b: v2f64) -> v4i32 { - __lsx_vftintrp_w_d(a, b) +pub fn lsx_vftintrp_w_d(a: v2f64, b: v2f64) -> v4i32 { + unsafe { __lsx_vftintrp_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrm_w_d(a: v2f64, b: v2f64) -> v4i32 { - __lsx_vftintrm_w_d(a, b) +pub fn lsx_vftintrm_w_d(a: v2f64, b: v2f64) -> v4i32 { + unsafe { __lsx_vftintrm_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrne_w_d(a: v2f64, b: v2f64) -> v4i32 { - __lsx_vftintrne_w_d(a, b) +pub fn lsx_vftintrne_w_d(a: v2f64, b: v2f64) -> v4i32 { + unsafe { __lsx_vftintrne_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintl_l_s(a: v4f32) -> v2i64 { - __lsx_vftintl_l_s(a) +pub fn lsx_vftintl_l_s(a: v4f32) -> v2i64 { + unsafe { __lsx_vftintl_l_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftinth_l_s(a: v4f32) -> v2i64 { - __lsx_vftinth_l_s(a) +pub fn lsx_vftinth_l_s(a: v4f32) -> v2i64 { + unsafe { __lsx_vftinth_l_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vffinth_d_w(a: v4i32) -> v2f64 { - __lsx_vffinth_d_w(a) +pub fn lsx_vffinth_d_w(a: v4i32) -> v2f64 { + unsafe { __lsx_vffinth_d_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vffintl_d_w(a: v4i32) -> v2f64 { - __lsx_vffintl_d_w(a) +pub fn lsx_vffintl_d_w(a: v4i32) -> v2f64 { + unsafe { __lsx_vffintl_d_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrzl_l_s(a: v4f32) -> v2i64 { - __lsx_vftintrzl_l_s(a) +pub fn lsx_vftintrzl_l_s(a: v4f32) -> v2i64 { + unsafe { __lsx_vftintrzl_l_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrzh_l_s(a: v4f32) -> v2i64 { - __lsx_vftintrzh_l_s(a) +pub fn lsx_vftintrzh_l_s(a: v4f32) -> v2i64 { + unsafe { __lsx_vftintrzh_l_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrpl_l_s(a: v4f32) -> v2i64 { - __lsx_vftintrpl_l_s(a) +pub fn lsx_vftintrpl_l_s(a: v4f32) -> v2i64 { + unsafe { __lsx_vftintrpl_l_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrph_l_s(a: v4f32) -> v2i64 { - __lsx_vftintrph_l_s(a) +pub fn lsx_vftintrph_l_s(a: v4f32) -> v2i64 { + unsafe { __lsx_vftintrph_l_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrml_l_s(a: v4f32) -> v2i64 { - __lsx_vftintrml_l_s(a) +pub fn lsx_vftintrml_l_s(a: v4f32) -> v2i64 { + unsafe { __lsx_vftintrml_l_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrmh_l_s(a: v4f32) -> v2i64 { - __lsx_vftintrmh_l_s(a) +pub fn lsx_vftintrmh_l_s(a: v4f32) -> v2i64 { + unsafe { __lsx_vftintrmh_l_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrnel_l_s(a: v4f32) -> v2i64 { - __lsx_vftintrnel_l_s(a) +pub fn lsx_vftintrnel_l_s(a: v4f32) -> v2i64 { + unsafe { __lsx_vftintrnel_l_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vftintrneh_l_s(a: v4f32) -> v2i64 { - __lsx_vftintrneh_l_s(a) +pub fn lsx_vftintrneh_l_s(a: v4f32) -> v2i64 { + unsafe { __lsx_vftintrneh_l_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrintrne_s(a: v4f32) -> v4f32 { - __lsx_vfrintrne_s(a) +pub fn lsx_vfrintrne_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vfrintrne_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrintrne_d(a: v2f64) -> v2f64 { - __lsx_vfrintrne_d(a) +pub fn lsx_vfrintrne_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vfrintrne_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrintrz_s(a: v4f32) -> v4f32 { - __lsx_vfrintrz_s(a) +pub fn lsx_vfrintrz_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vfrintrz_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrintrz_d(a: v2f64) -> v2f64 { - __lsx_vfrintrz_d(a) +pub fn lsx_vfrintrz_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vfrintrz_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrintrp_s(a: v4f32) -> v4f32 { - __lsx_vfrintrp_s(a) +pub fn lsx_vfrintrp_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vfrintrp_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrintrp_d(a: v2f64) -> v2f64 { - __lsx_vfrintrp_d(a) +pub fn lsx_vfrintrp_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vfrintrp_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrintrm_s(a: v4f32) -> v4f32 { - __lsx_vfrintrm_s(a) +pub fn lsx_vfrintrm_s(a: v4f32) -> v4f32 { + unsafe { __lsx_vfrintrm_s(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfrintrm_d(a: v2f64) -> v2f64 { - __lsx_vfrintrm_d(a) +pub fn lsx_vfrintrm_d(a: v2f64) -> v2f64 { + unsafe { __lsx_vfrintrm_d(a) } } #[inline] @@ -5087,687 +5087,687 @@ pub unsafe fn lsx_vstelm_d(a: v2i64, mem_add #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_d_w(a: v4i32, b: v4i32) -> v2i64 { - __lsx_vaddwev_d_w(a, b) +pub fn lsx_vaddwev_d_w(a: v4i32, b: v4i32) -> v2i64 { + unsafe { __lsx_vaddwev_d_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_w_h(a: v8i16, b: v8i16) -> v4i32 { - __lsx_vaddwev_w_h(a, b) +pub fn lsx_vaddwev_w_h(a: v8i16, b: v8i16) -> v4i32 { + unsafe { __lsx_vaddwev_w_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_h_b(a: v16i8, b: v16i8) -> v8i16 { - __lsx_vaddwev_h_b(a, b) +pub fn lsx_vaddwev_h_b(a: v16i8, b: v16i8) -> v8i16 { + unsafe { __lsx_vaddwev_h_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_d_w(a: v4i32, b: v4i32) -> v2i64 { - __lsx_vaddwod_d_w(a, b) +pub fn lsx_vaddwod_d_w(a: v4i32, b: v4i32) -> v2i64 { + unsafe { __lsx_vaddwod_d_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_w_h(a: v8i16, b: v8i16) -> v4i32 { - __lsx_vaddwod_w_h(a, b) +pub fn lsx_vaddwod_w_h(a: v8i16, b: v8i16) -> v4i32 { + unsafe { __lsx_vaddwod_w_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_h_b(a: v16i8, b: v16i8) -> v8i16 { - __lsx_vaddwod_h_b(a, b) +pub fn lsx_vaddwod_h_b(a: v16i8, b: v16i8) -> v8i16 { + unsafe { __lsx_vaddwod_h_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_d_wu(a: v4u32, b: v4u32) -> v2i64 { - __lsx_vaddwev_d_wu(a, b) +pub fn lsx_vaddwev_d_wu(a: v4u32, b: v4u32) -> v2i64 { + unsafe { __lsx_vaddwev_d_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_w_hu(a: v8u16, b: v8u16) -> v4i32 { - __lsx_vaddwev_w_hu(a, b) +pub fn lsx_vaddwev_w_hu(a: v8u16, b: v8u16) -> v4i32 { + unsafe { __lsx_vaddwev_w_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_h_bu(a: v16u8, b: v16u8) -> v8i16 { - __lsx_vaddwev_h_bu(a, b) +pub fn lsx_vaddwev_h_bu(a: v16u8, b: v16u8) -> v8i16 { + unsafe { __lsx_vaddwev_h_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_d_wu(a: v4u32, b: v4u32) -> v2i64 { - __lsx_vaddwod_d_wu(a, b) +pub fn lsx_vaddwod_d_wu(a: v4u32, b: v4u32) -> v2i64 { + unsafe { __lsx_vaddwod_d_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_w_hu(a: v8u16, b: v8u16) -> v4i32 { - __lsx_vaddwod_w_hu(a, b) +pub fn lsx_vaddwod_w_hu(a: v8u16, b: v8u16) -> v4i32 { + unsafe { __lsx_vaddwod_w_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_h_bu(a: v16u8, b: v16u8) -> v8i16 { - __lsx_vaddwod_h_bu(a, b) +pub fn lsx_vaddwod_h_bu(a: v16u8, b: v16u8) -> v8i16 { + unsafe { __lsx_vaddwod_h_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_d_wu_w(a: v4u32, b: v4i32) -> v2i64 { - __lsx_vaddwev_d_wu_w(a, b) +pub fn lsx_vaddwev_d_wu_w(a: v4u32, b: v4i32) -> v2i64 { + unsafe { __lsx_vaddwev_d_wu_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_w_hu_h(a: v8u16, b: v8i16) -> v4i32 { - __lsx_vaddwev_w_hu_h(a, b) +pub fn lsx_vaddwev_w_hu_h(a: v8u16, b: v8i16) -> v4i32 { + unsafe { __lsx_vaddwev_w_hu_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_h_bu_b(a: v16u8, b: v16i8) -> v8i16 { - __lsx_vaddwev_h_bu_b(a, b) +pub fn lsx_vaddwev_h_bu_b(a: v16u8, b: v16i8) -> v8i16 { + unsafe { __lsx_vaddwev_h_bu_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_d_wu_w(a: v4u32, b: v4i32) -> v2i64 { - __lsx_vaddwod_d_wu_w(a, b) +pub fn lsx_vaddwod_d_wu_w(a: v4u32, b: v4i32) -> v2i64 { + unsafe { __lsx_vaddwod_d_wu_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_w_hu_h(a: v8u16, b: v8i16) -> v4i32 { - __lsx_vaddwod_w_hu_h(a, b) +pub fn lsx_vaddwod_w_hu_h(a: v8u16, b: v8i16) -> v4i32 { + unsafe { __lsx_vaddwod_w_hu_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_h_bu_b(a: v16u8, b: v16i8) -> v8i16 { - __lsx_vaddwod_h_bu_b(a, b) +pub fn lsx_vaddwod_h_bu_b(a: v16u8, b: v16i8) -> v8i16 { + unsafe { __lsx_vaddwod_h_bu_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwev_d_w(a: v4i32, b: v4i32) -> v2i64 { - __lsx_vsubwev_d_w(a, b) +pub fn lsx_vsubwev_d_w(a: v4i32, b: v4i32) -> v2i64 { + unsafe { __lsx_vsubwev_d_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwev_w_h(a: v8i16, b: v8i16) -> v4i32 { - __lsx_vsubwev_w_h(a, b) +pub fn lsx_vsubwev_w_h(a: v8i16, b: v8i16) -> v4i32 { + unsafe { __lsx_vsubwev_w_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwev_h_b(a: v16i8, b: v16i8) -> v8i16 { - __lsx_vsubwev_h_b(a, b) +pub fn lsx_vsubwev_h_b(a: v16i8, b: v16i8) -> v8i16 { + unsafe { __lsx_vsubwev_h_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwod_d_w(a: v4i32, b: v4i32) -> v2i64 { - __lsx_vsubwod_d_w(a, b) +pub fn lsx_vsubwod_d_w(a: v4i32, b: v4i32) -> v2i64 { + unsafe { __lsx_vsubwod_d_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwod_w_h(a: v8i16, b: v8i16) -> v4i32 { - __lsx_vsubwod_w_h(a, b) +pub fn lsx_vsubwod_w_h(a: v8i16, b: v8i16) -> v4i32 { + unsafe { __lsx_vsubwod_w_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwod_h_b(a: v16i8, b: v16i8) -> v8i16 { - __lsx_vsubwod_h_b(a, b) +pub fn lsx_vsubwod_h_b(a: v16i8, b: v16i8) -> v8i16 { + unsafe { __lsx_vsubwod_h_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwev_d_wu(a: v4u32, b: v4u32) -> v2i64 { - __lsx_vsubwev_d_wu(a, b) +pub fn lsx_vsubwev_d_wu(a: v4u32, b: v4u32) -> v2i64 { + unsafe { __lsx_vsubwev_d_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwev_w_hu(a: v8u16, b: v8u16) -> v4i32 { - __lsx_vsubwev_w_hu(a, b) +pub fn lsx_vsubwev_w_hu(a: v8u16, b: v8u16) -> v4i32 { + unsafe { __lsx_vsubwev_w_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwev_h_bu(a: v16u8, b: v16u8) -> v8i16 { - __lsx_vsubwev_h_bu(a, b) +pub fn lsx_vsubwev_h_bu(a: v16u8, b: v16u8) -> v8i16 { + unsafe { __lsx_vsubwev_h_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwod_d_wu(a: v4u32, b: v4u32) -> v2i64 { - __lsx_vsubwod_d_wu(a, b) +pub fn lsx_vsubwod_d_wu(a: v4u32, b: v4u32) -> v2i64 { + unsafe { __lsx_vsubwod_d_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwod_w_hu(a: v8u16, b: v8u16) -> v4i32 { - __lsx_vsubwod_w_hu(a, b) +pub fn lsx_vsubwod_w_hu(a: v8u16, b: v8u16) -> v4i32 { + unsafe { __lsx_vsubwod_w_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwod_h_bu(a: v16u8, b: v16u8) -> v8i16 { - __lsx_vsubwod_h_bu(a, b) +pub fn lsx_vsubwod_h_bu(a: v16u8, b: v16u8) -> v8i16 { + unsafe { __lsx_vsubwod_h_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_q_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vaddwev_q_d(a, b) +pub fn lsx_vaddwev_q_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vaddwev_q_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_q_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vaddwod_q_d(a, b) +pub fn lsx_vaddwod_q_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vaddwod_q_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_q_du(a: v2u64, b: v2u64) -> v2i64 { - __lsx_vaddwev_q_du(a, b) +pub fn lsx_vaddwev_q_du(a: v2u64, b: v2u64) -> v2i64 { + unsafe { __lsx_vaddwev_q_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_q_du(a: v2u64, b: v2u64) -> v2i64 { - __lsx_vaddwod_q_du(a, b) +pub fn lsx_vaddwod_q_du(a: v2u64, b: v2u64) -> v2i64 { + unsafe { __lsx_vaddwod_q_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwev_q_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsubwev_q_d(a, b) +pub fn lsx_vsubwev_q_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsubwev_q_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwod_q_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsubwod_q_d(a, b) +pub fn lsx_vsubwod_q_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsubwod_q_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwev_q_du(a: v2u64, b: v2u64) -> v2i64 { - __lsx_vsubwev_q_du(a, b) +pub fn lsx_vsubwev_q_du(a: v2u64, b: v2u64) -> v2i64 { + unsafe { __lsx_vsubwev_q_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsubwod_q_du(a: v2u64, b: v2u64) -> v2i64 { - __lsx_vsubwod_q_du(a, b) +pub fn lsx_vsubwod_q_du(a: v2u64, b: v2u64) -> v2i64 { + unsafe { __lsx_vsubwod_q_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwev_q_du_d(a: v2u64, b: v2i64) -> v2i64 { - __lsx_vaddwev_q_du_d(a, b) +pub fn lsx_vaddwev_q_du_d(a: v2u64, b: v2i64) -> v2i64 { + unsafe { __lsx_vaddwev_q_du_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vaddwod_q_du_d(a: v2u64, b: v2i64) -> v2i64 { - __lsx_vaddwod_q_du_d(a, b) +pub fn lsx_vaddwod_q_du_d(a: v2u64, b: v2i64) -> v2i64 { + unsafe { __lsx_vaddwod_q_du_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_d_w(a: v4i32, b: v4i32) -> v2i64 { - __lsx_vmulwev_d_w(a, b) +pub fn lsx_vmulwev_d_w(a: v4i32, b: v4i32) -> v2i64 { + unsafe { __lsx_vmulwev_d_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_w_h(a: v8i16, b: v8i16) -> v4i32 { - __lsx_vmulwev_w_h(a, b) +pub fn lsx_vmulwev_w_h(a: v8i16, b: v8i16) -> v4i32 { + unsafe { __lsx_vmulwev_w_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_h_b(a: v16i8, b: v16i8) -> v8i16 { - __lsx_vmulwev_h_b(a, b) +pub fn lsx_vmulwev_h_b(a: v16i8, b: v16i8) -> v8i16 { + unsafe { __lsx_vmulwev_h_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_d_w(a: v4i32, b: v4i32) -> v2i64 { - __lsx_vmulwod_d_w(a, b) +pub fn lsx_vmulwod_d_w(a: v4i32, b: v4i32) -> v2i64 { + unsafe { __lsx_vmulwod_d_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_w_h(a: v8i16, b: v8i16) -> v4i32 { - __lsx_vmulwod_w_h(a, b) +pub fn lsx_vmulwod_w_h(a: v8i16, b: v8i16) -> v4i32 { + unsafe { __lsx_vmulwod_w_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_h_b(a: v16i8, b: v16i8) -> v8i16 { - __lsx_vmulwod_h_b(a, b) +pub fn lsx_vmulwod_h_b(a: v16i8, b: v16i8) -> v8i16 { + unsafe { __lsx_vmulwod_h_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_d_wu(a: v4u32, b: v4u32) -> v2i64 { - __lsx_vmulwev_d_wu(a, b) +pub fn lsx_vmulwev_d_wu(a: v4u32, b: v4u32) -> v2i64 { + unsafe { __lsx_vmulwev_d_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_w_hu(a: v8u16, b: v8u16) -> v4i32 { - __lsx_vmulwev_w_hu(a, b) +pub fn lsx_vmulwev_w_hu(a: v8u16, b: v8u16) -> v4i32 { + unsafe { __lsx_vmulwev_w_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_h_bu(a: v16u8, b: v16u8) -> v8i16 { - __lsx_vmulwev_h_bu(a, b) +pub fn lsx_vmulwev_h_bu(a: v16u8, b: v16u8) -> v8i16 { + unsafe { __lsx_vmulwev_h_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_d_wu(a: v4u32, b: v4u32) -> v2i64 { - __lsx_vmulwod_d_wu(a, b) +pub fn lsx_vmulwod_d_wu(a: v4u32, b: v4u32) -> v2i64 { + unsafe { __lsx_vmulwod_d_wu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_w_hu(a: v8u16, b: v8u16) -> v4i32 { - __lsx_vmulwod_w_hu(a, b) +pub fn lsx_vmulwod_w_hu(a: v8u16, b: v8u16) -> v4i32 { + unsafe { __lsx_vmulwod_w_hu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_h_bu(a: v16u8, b: v16u8) -> v8i16 { - __lsx_vmulwod_h_bu(a, b) +pub fn lsx_vmulwod_h_bu(a: v16u8, b: v16u8) -> v8i16 { + unsafe { __lsx_vmulwod_h_bu(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_d_wu_w(a: v4u32, b: v4i32) -> v2i64 { - __lsx_vmulwev_d_wu_w(a, b) +pub fn lsx_vmulwev_d_wu_w(a: v4u32, b: v4i32) -> v2i64 { + unsafe { __lsx_vmulwev_d_wu_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_w_hu_h(a: v8u16, b: v8i16) -> v4i32 { - __lsx_vmulwev_w_hu_h(a, b) +pub fn lsx_vmulwev_w_hu_h(a: v8u16, b: v8i16) -> v4i32 { + unsafe { __lsx_vmulwev_w_hu_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_h_bu_b(a: v16u8, b: v16i8) -> v8i16 { - __lsx_vmulwev_h_bu_b(a, b) +pub fn lsx_vmulwev_h_bu_b(a: v16u8, b: v16i8) -> v8i16 { + unsafe { __lsx_vmulwev_h_bu_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_d_wu_w(a: v4u32, b: v4i32) -> v2i64 { - __lsx_vmulwod_d_wu_w(a, b) +pub fn lsx_vmulwod_d_wu_w(a: v4u32, b: v4i32) -> v2i64 { + unsafe { __lsx_vmulwod_d_wu_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_w_hu_h(a: v8u16, b: v8i16) -> v4i32 { - __lsx_vmulwod_w_hu_h(a, b) +pub fn lsx_vmulwod_w_hu_h(a: v8u16, b: v8i16) -> v4i32 { + unsafe { __lsx_vmulwod_w_hu_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_h_bu_b(a: v16u8, b: v16i8) -> v8i16 { - __lsx_vmulwod_h_bu_b(a, b) +pub fn lsx_vmulwod_h_bu_b(a: v16u8, b: v16i8) -> v8i16 { + unsafe { __lsx_vmulwod_h_bu_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_q_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vmulwev_q_d(a, b) +pub fn lsx_vmulwev_q_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vmulwev_q_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_q_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vmulwod_q_d(a, b) +pub fn lsx_vmulwod_q_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vmulwod_q_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_q_du(a: v2u64, b: v2u64) -> v2i64 { - __lsx_vmulwev_q_du(a, b) +pub fn lsx_vmulwev_q_du(a: v2u64, b: v2u64) -> v2i64 { + unsafe { __lsx_vmulwev_q_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_q_du(a: v2u64, b: v2u64) -> v2i64 { - __lsx_vmulwod_q_du(a, b) +pub fn lsx_vmulwod_q_du(a: v2u64, b: v2u64) -> v2i64 { + unsafe { __lsx_vmulwod_q_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwev_q_du_d(a: v2u64, b: v2i64) -> v2i64 { - __lsx_vmulwev_q_du_d(a, b) +pub fn lsx_vmulwev_q_du_d(a: v2u64, b: v2i64) -> v2i64 { + unsafe { __lsx_vmulwev_q_du_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmulwod_q_du_d(a: v2u64, b: v2i64) -> v2i64 { - __lsx_vmulwod_q_du_d(a, b) +pub fn lsx_vmulwod_q_du_d(a: v2u64, b: v2i64) -> v2i64 { + unsafe { __lsx_vmulwod_q_du_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhaddw_q_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vhaddw_q_d(a, b) +pub fn lsx_vhaddw_q_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vhaddw_q_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhaddw_qu_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vhaddw_qu_du(a, b) +pub fn lsx_vhaddw_qu_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vhaddw_qu_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhsubw_q_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vhsubw_q_d(a, b) +pub fn lsx_vhsubw_q_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vhsubw_q_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vhsubw_qu_du(a: v2u64, b: v2u64) -> v2u64 { - __lsx_vhsubw_qu_du(a, b) +pub fn lsx_vhsubw_qu_du(a: v2u64, b: v2u64) -> v2u64 { + unsafe { __lsx_vhsubw_qu_du(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_d_w(a: v2i64, b: v4i32, c: v4i32) -> v2i64 { - __lsx_vmaddwev_d_w(a, b, c) +pub fn lsx_vmaddwev_d_w(a: v2i64, b: v4i32, c: v4i32) -> v2i64 { + unsafe { __lsx_vmaddwev_d_w(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_w_h(a: v4i32, b: v8i16, c: v8i16) -> v4i32 { - __lsx_vmaddwev_w_h(a, b, c) +pub fn lsx_vmaddwev_w_h(a: v4i32, b: v8i16, c: v8i16) -> v4i32 { + unsafe { __lsx_vmaddwev_w_h(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_h_b(a: v8i16, b: v16i8, c: v16i8) -> v8i16 { - __lsx_vmaddwev_h_b(a, b, c) +pub fn lsx_vmaddwev_h_b(a: v8i16, b: v16i8, c: v16i8) -> v8i16 { + unsafe { __lsx_vmaddwev_h_b(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_d_wu(a: v2u64, b: v4u32, c: v4u32) -> v2u64 { - __lsx_vmaddwev_d_wu(a, b, c) +pub fn lsx_vmaddwev_d_wu(a: v2u64, b: v4u32, c: v4u32) -> v2u64 { + unsafe { __lsx_vmaddwev_d_wu(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_w_hu(a: v4u32, b: v8u16, c: v8u16) -> v4u32 { - __lsx_vmaddwev_w_hu(a, b, c) +pub fn lsx_vmaddwev_w_hu(a: v4u32, b: v8u16, c: v8u16) -> v4u32 { + unsafe { __lsx_vmaddwev_w_hu(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_h_bu(a: v8u16, b: v16u8, c: v16u8) -> v8u16 { - __lsx_vmaddwev_h_bu(a, b, c) +pub fn lsx_vmaddwev_h_bu(a: v8u16, b: v16u8, c: v16u8) -> v8u16 { + unsafe { __lsx_vmaddwev_h_bu(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_d_w(a: v2i64, b: v4i32, c: v4i32) -> v2i64 { - __lsx_vmaddwod_d_w(a, b, c) +pub fn lsx_vmaddwod_d_w(a: v2i64, b: v4i32, c: v4i32) -> v2i64 { + unsafe { __lsx_vmaddwod_d_w(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_w_h(a: v4i32, b: v8i16, c: v8i16) -> v4i32 { - __lsx_vmaddwod_w_h(a, b, c) +pub fn lsx_vmaddwod_w_h(a: v4i32, b: v8i16, c: v8i16) -> v4i32 { + unsafe { __lsx_vmaddwod_w_h(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_h_b(a: v8i16, b: v16i8, c: v16i8) -> v8i16 { - __lsx_vmaddwod_h_b(a, b, c) +pub fn lsx_vmaddwod_h_b(a: v8i16, b: v16i8, c: v16i8) -> v8i16 { + unsafe { __lsx_vmaddwod_h_b(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_d_wu(a: v2u64, b: v4u32, c: v4u32) -> v2u64 { - __lsx_vmaddwod_d_wu(a, b, c) +pub fn lsx_vmaddwod_d_wu(a: v2u64, b: v4u32, c: v4u32) -> v2u64 { + unsafe { __lsx_vmaddwod_d_wu(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_w_hu(a: v4u32, b: v8u16, c: v8u16) -> v4u32 { - __lsx_vmaddwod_w_hu(a, b, c) +pub fn lsx_vmaddwod_w_hu(a: v4u32, b: v8u16, c: v8u16) -> v4u32 { + unsafe { __lsx_vmaddwod_w_hu(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_h_bu(a: v8u16, b: v16u8, c: v16u8) -> v8u16 { - __lsx_vmaddwod_h_bu(a, b, c) +pub fn lsx_vmaddwod_h_bu(a: v8u16, b: v16u8, c: v16u8) -> v8u16 { + unsafe { __lsx_vmaddwod_h_bu(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_d_wu_w(a: v2i64, b: v4u32, c: v4i32) -> v2i64 { - __lsx_vmaddwev_d_wu_w(a, b, c) +pub fn lsx_vmaddwev_d_wu_w(a: v2i64, b: v4u32, c: v4i32) -> v2i64 { + unsafe { __lsx_vmaddwev_d_wu_w(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_w_hu_h(a: v4i32, b: v8u16, c: v8i16) -> v4i32 { - __lsx_vmaddwev_w_hu_h(a, b, c) +pub fn lsx_vmaddwev_w_hu_h(a: v4i32, b: v8u16, c: v8i16) -> v4i32 { + unsafe { __lsx_vmaddwev_w_hu_h(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_h_bu_b(a: v8i16, b: v16u8, c: v16i8) -> v8i16 { - __lsx_vmaddwev_h_bu_b(a, b, c) +pub fn lsx_vmaddwev_h_bu_b(a: v8i16, b: v16u8, c: v16i8) -> v8i16 { + unsafe { __lsx_vmaddwev_h_bu_b(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_d_wu_w(a: v2i64, b: v4u32, c: v4i32) -> v2i64 { - __lsx_vmaddwod_d_wu_w(a, b, c) +pub fn lsx_vmaddwod_d_wu_w(a: v2i64, b: v4u32, c: v4i32) -> v2i64 { + unsafe { __lsx_vmaddwod_d_wu_w(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_w_hu_h(a: v4i32, b: v8u16, c: v8i16) -> v4i32 { - __lsx_vmaddwod_w_hu_h(a, b, c) +pub fn lsx_vmaddwod_w_hu_h(a: v4i32, b: v8u16, c: v8i16) -> v4i32 { + unsafe { __lsx_vmaddwod_w_hu_h(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_h_bu_b(a: v8i16, b: v16u8, c: v16i8) -> v8i16 { - __lsx_vmaddwod_h_bu_b(a, b, c) +pub fn lsx_vmaddwod_h_bu_b(a: v8i16, b: v16u8, c: v16i8) -> v8i16 { + unsafe { __lsx_vmaddwod_h_bu_b(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_q_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 { - __lsx_vmaddwev_q_d(a, b, c) +pub fn lsx_vmaddwev_q_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 { + unsafe { __lsx_vmaddwev_q_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_q_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 { - __lsx_vmaddwod_q_d(a, b, c) +pub fn lsx_vmaddwod_q_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 { + unsafe { __lsx_vmaddwod_q_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_q_du(a: v2u64, b: v2u64, c: v2u64) -> v2u64 { - __lsx_vmaddwev_q_du(a, b, c) +pub fn lsx_vmaddwev_q_du(a: v2u64, b: v2u64, c: v2u64) -> v2u64 { + unsafe { __lsx_vmaddwev_q_du(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_q_du(a: v2u64, b: v2u64, c: v2u64) -> v2u64 { - __lsx_vmaddwod_q_du(a, b, c) +pub fn lsx_vmaddwod_q_du(a: v2u64, b: v2u64, c: v2u64) -> v2u64 { + unsafe { __lsx_vmaddwod_q_du(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwev_q_du_d(a: v2i64, b: v2u64, c: v2i64) -> v2i64 { - __lsx_vmaddwev_q_du_d(a, b, c) +pub fn lsx_vmaddwev_q_du_d(a: v2i64, b: v2u64, c: v2i64) -> v2i64 { + unsafe { __lsx_vmaddwev_q_du_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmaddwod_q_du_d(a: v2i64, b: v2u64, c: v2i64) -> v2i64 { - __lsx_vmaddwod_q_du_d(a, b, c) +pub fn lsx_vmaddwod_q_du_d(a: v2i64, b: v2u64, c: v2i64) -> v2i64 { + unsafe { __lsx_vmaddwod_q_du_d(a, b, c) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrotr_b(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vrotr_b(a, b) +pub fn lsx_vrotr_b(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vrotr_b(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrotr_h(a: v8i16, b: v8i16) -> v8i16 { - __lsx_vrotr_h(a, b) +pub fn lsx_vrotr_h(a: v8i16, b: v8i16) -> v8i16 { + unsafe { __lsx_vrotr_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrotr_w(a: v4i32, b: v4i32) -> v4i32 { - __lsx_vrotr_w(a, b) +pub fn lsx_vrotr_w(a: v4i32, b: v4i32) -> v4i32 { + unsafe { __lsx_vrotr_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrotr_d(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vrotr_d(a, b) +pub fn lsx_vrotr_d(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vrotr_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vadd_q(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vadd_q(a, b) +pub fn lsx_vadd_q(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vadd_q(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsub_q(a: v2i64, b: v2i64) -> v2i64 { - __lsx_vsub_q(a, b) +pub fn lsx_vsub_q(a: v2i64, b: v2i64) -> v2i64 { + unsafe { __lsx_vsub_q(a, b) } } #[inline] @@ -5809,555 +5809,555 @@ pub unsafe fn lsx_vldrepl_d(mem_addr: *const i8) -> v2i64 { #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmskgez_b(a: v16i8) -> v16i8 { - __lsx_vmskgez_b(a) +pub fn lsx_vmskgez_b(a: v16i8) -> v16i8 { + unsafe { __lsx_vmskgez_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vmsknz_b(a: v16i8) -> v16i8 { - __lsx_vmsknz_b(a) +pub fn lsx_vmsknz_b(a: v16i8) -> v16i8 { + unsafe { __lsx_vmsknz_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vexth_h_b(a: v16i8) -> v8i16 { - __lsx_vexth_h_b(a) +pub fn lsx_vexth_h_b(a: v16i8) -> v8i16 { + unsafe { __lsx_vexth_h_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vexth_w_h(a: v8i16) -> v4i32 { - __lsx_vexth_w_h(a) +pub fn lsx_vexth_w_h(a: v8i16) -> v4i32 { + unsafe { __lsx_vexth_w_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vexth_d_w(a: v4i32) -> v2i64 { - __lsx_vexth_d_w(a) +pub fn lsx_vexth_d_w(a: v4i32) -> v2i64 { + unsafe { __lsx_vexth_d_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vexth_q_d(a: v2i64) -> v2i64 { - __lsx_vexth_q_d(a) +pub fn lsx_vexth_q_d(a: v2i64) -> v2i64 { + unsafe { __lsx_vexth_q_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vexth_hu_bu(a: v16u8) -> v8u16 { - __lsx_vexth_hu_bu(a) +pub fn lsx_vexth_hu_bu(a: v16u8) -> v8u16 { + unsafe { __lsx_vexth_hu_bu(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vexth_wu_hu(a: v8u16) -> v4u32 { - __lsx_vexth_wu_hu(a) +pub fn lsx_vexth_wu_hu(a: v8u16) -> v4u32 { + unsafe { __lsx_vexth_wu_hu(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vexth_du_wu(a: v4u32) -> v2u64 { - __lsx_vexth_du_wu(a) +pub fn lsx_vexth_du_wu(a: v4u32) -> v2u64 { + unsafe { __lsx_vexth_du_wu(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vexth_qu_du(a: v2u64) -> v2u64 { - __lsx_vexth_qu_du(a) +pub fn lsx_vexth_qu_du(a: v2u64) -> v2u64 { + unsafe { __lsx_vexth_qu_du(a) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrotri_b(a: v16i8) -> v16i8 { +pub fn lsx_vrotri_b(a: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM3, 3); - __lsx_vrotri_b(a, IMM3) + unsafe { __lsx_vrotri_b(a, IMM3) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrotri_h(a: v8i16) -> v8i16 { +pub fn lsx_vrotri_h(a: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vrotri_h(a, IMM4) + unsafe { __lsx_vrotri_h(a, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrotri_w(a: v4i32) -> v4i32 { +pub fn lsx_vrotri_w(a: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vrotri_w(a, IMM5) + unsafe { __lsx_vrotri_w(a, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(1)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrotri_d(a: v2i64) -> v2i64 { +pub fn lsx_vrotri_d(a: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vrotri_d(a, IMM6) + unsafe { __lsx_vrotri_d(a, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vextl_q_d(a: v2i64) -> v2i64 { - __lsx_vextl_q_d(a) +pub fn lsx_vextl_q_d(a: v2i64) -> v2i64 { + unsafe { __lsx_vextl_q_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlni_b_h(a: v16i8, b: v16i8) -> v16i8 { +pub fn lsx_vsrlni_b_h(a: v16i8, b: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsrlni_b_h(a, b, IMM4) + unsafe { __lsx_vsrlni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlni_h_w(a: v8i16, b: v8i16) -> v8i16 { +pub fn lsx_vsrlni_h_w(a: v8i16, b: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsrlni_h_w(a, b, IMM5) + unsafe { __lsx_vsrlni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlni_w_d(a: v4i32, b: v4i32) -> v4i32 { +pub fn lsx_vsrlni_w_d(a: v4i32, b: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vsrlni_w_d(a, b, IMM6) + unsafe { __lsx_vsrlni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlni_d_q(a: v2i64, b: v2i64) -> v2i64 { +pub fn lsx_vsrlni_d_q(a: v2i64, b: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vsrlni_d_q(a, b, IMM7) + unsafe { __lsx_vsrlni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlrni_b_h(a: v16i8, b: v16i8) -> v16i8 { +pub fn lsx_vsrlrni_b_h(a: v16i8, b: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsrlrni_b_h(a, b, IMM4) + unsafe { __lsx_vsrlrni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlrni_h_w(a: v8i16, b: v8i16) -> v8i16 { +pub fn lsx_vsrlrni_h_w(a: v8i16, b: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsrlrni_h_w(a, b, IMM5) + unsafe { __lsx_vsrlrni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlrni_w_d(a: v4i32, b: v4i32) -> v4i32 { +pub fn lsx_vsrlrni_w_d(a: v4i32, b: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vsrlrni_w_d(a, b, IMM6) + unsafe { __lsx_vsrlrni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrlrni_d_q(a: v2i64, b: v2i64) -> v2i64 { +pub fn lsx_vsrlrni_d_q(a: v2i64, b: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vsrlrni_d_q(a, b, IMM7) + unsafe { __lsx_vsrlrni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlni_b_h(a: v16i8, b: v16i8) -> v16i8 { +pub fn lsx_vssrlni_b_h(a: v16i8, b: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vssrlni_b_h(a, b, IMM4) + unsafe { __lsx_vssrlni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlni_h_w(a: v8i16, b: v8i16) -> v8i16 { +pub fn lsx_vssrlni_h_w(a: v8i16, b: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vssrlni_h_w(a, b, IMM5) + unsafe { __lsx_vssrlni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlni_w_d(a: v4i32, b: v4i32) -> v4i32 { +pub fn lsx_vssrlni_w_d(a: v4i32, b: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vssrlni_w_d(a, b, IMM6) + unsafe { __lsx_vssrlni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlni_d_q(a: v2i64, b: v2i64) -> v2i64 { +pub fn lsx_vssrlni_d_q(a: v2i64, b: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vssrlni_d_q(a, b, IMM7) + unsafe { __lsx_vssrlni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlni_bu_h(a: v16u8, b: v16i8) -> v16u8 { +pub fn lsx_vssrlni_bu_h(a: v16u8, b: v16i8) -> v16u8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vssrlni_bu_h(a, b, IMM4) + unsafe { __lsx_vssrlni_bu_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlni_hu_w(a: v8u16, b: v8i16) -> v8u16 { +pub fn lsx_vssrlni_hu_w(a: v8u16, b: v8i16) -> v8u16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vssrlni_hu_w(a, b, IMM5) + unsafe { __lsx_vssrlni_hu_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlni_wu_d(a: v4u32, b: v4i32) -> v4u32 { +pub fn lsx_vssrlni_wu_d(a: v4u32, b: v4i32) -> v4u32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vssrlni_wu_d(a, b, IMM6) + unsafe { __lsx_vssrlni_wu_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlni_du_q(a: v2u64, b: v2i64) -> v2u64 { +pub fn lsx_vssrlni_du_q(a: v2u64, b: v2i64) -> v2u64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vssrlni_du_q(a, b, IMM7) + unsafe { __lsx_vssrlni_du_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrni_b_h(a: v16i8, b: v16i8) -> v16i8 { +pub fn lsx_vssrlrni_b_h(a: v16i8, b: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vssrlrni_b_h(a, b, IMM4) + unsafe { __lsx_vssrlrni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrni_h_w(a: v8i16, b: v8i16) -> v8i16 { +pub fn lsx_vssrlrni_h_w(a: v8i16, b: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vssrlrni_h_w(a, b, IMM5) + unsafe { __lsx_vssrlrni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrni_w_d(a: v4i32, b: v4i32) -> v4i32 { +pub fn lsx_vssrlrni_w_d(a: v4i32, b: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vssrlrni_w_d(a, b, IMM6) + unsafe { __lsx_vssrlrni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrni_d_q(a: v2i64, b: v2i64) -> v2i64 { +pub fn lsx_vssrlrni_d_q(a: v2i64, b: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vssrlrni_d_q(a, b, IMM7) + unsafe { __lsx_vssrlrni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrni_bu_h(a: v16u8, b: v16i8) -> v16u8 { +pub fn lsx_vssrlrni_bu_h(a: v16u8, b: v16i8) -> v16u8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vssrlrni_bu_h(a, b, IMM4) + unsafe { __lsx_vssrlrni_bu_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrni_hu_w(a: v8u16, b: v8i16) -> v8u16 { +pub fn lsx_vssrlrni_hu_w(a: v8u16, b: v8i16) -> v8u16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vssrlrni_hu_w(a, b, IMM5) + unsafe { __lsx_vssrlrni_hu_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrni_wu_d(a: v4u32, b: v4i32) -> v4u32 { +pub fn lsx_vssrlrni_wu_d(a: v4u32, b: v4i32) -> v4u32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vssrlrni_wu_d(a, b, IMM6) + unsafe { __lsx_vssrlrni_wu_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrni_du_q(a: v2u64, b: v2i64) -> v2u64 { +pub fn lsx_vssrlrni_du_q(a: v2u64, b: v2i64) -> v2u64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vssrlrni_du_q(a, b, IMM7) + unsafe { __lsx_vssrlrni_du_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrani_b_h(a: v16i8, b: v16i8) -> v16i8 { +pub fn lsx_vsrani_b_h(a: v16i8, b: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsrani_b_h(a, b, IMM4) + unsafe { __lsx_vsrani_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrani_h_w(a: v8i16, b: v8i16) -> v8i16 { +pub fn lsx_vsrani_h_w(a: v8i16, b: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsrani_h_w(a, b, IMM5) + unsafe { __lsx_vsrani_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrani_w_d(a: v4i32, b: v4i32) -> v4i32 { +pub fn lsx_vsrani_w_d(a: v4i32, b: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vsrani_w_d(a, b, IMM6) + unsafe { __lsx_vsrani_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrani_d_q(a: v2i64, b: v2i64) -> v2i64 { +pub fn lsx_vsrani_d_q(a: v2i64, b: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vsrani_d_q(a, b, IMM7) + unsafe { __lsx_vsrani_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrarni_b_h(a: v16i8, b: v16i8) -> v16i8 { +pub fn lsx_vsrarni_b_h(a: v16i8, b: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vsrarni_b_h(a, b, IMM4) + unsafe { __lsx_vsrarni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrarni_h_w(a: v8i16, b: v8i16) -> v8i16 { +pub fn lsx_vsrarni_h_w(a: v8i16, b: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vsrarni_h_w(a, b, IMM5) + unsafe { __lsx_vsrarni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrarni_w_d(a: v4i32, b: v4i32) -> v4i32 { +pub fn lsx_vsrarni_w_d(a: v4i32, b: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vsrarni_w_d(a, b, IMM6) + unsafe { __lsx_vsrarni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vsrarni_d_q(a: v2i64, b: v2i64) -> v2i64 { +pub fn lsx_vsrarni_d_q(a: v2i64, b: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vsrarni_d_q(a, b, IMM7) + unsafe { __lsx_vsrarni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrani_b_h(a: v16i8, b: v16i8) -> v16i8 { +pub fn lsx_vssrani_b_h(a: v16i8, b: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vssrani_b_h(a, b, IMM4) + unsafe { __lsx_vssrani_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrani_h_w(a: v8i16, b: v8i16) -> v8i16 { +pub fn lsx_vssrani_h_w(a: v8i16, b: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vssrani_h_w(a, b, IMM5) + unsafe { __lsx_vssrani_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrani_w_d(a: v4i32, b: v4i32) -> v4i32 { +pub fn lsx_vssrani_w_d(a: v4i32, b: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vssrani_w_d(a, b, IMM6) + unsafe { __lsx_vssrani_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrani_d_q(a: v2i64, b: v2i64) -> v2i64 { +pub fn lsx_vssrani_d_q(a: v2i64, b: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vssrani_d_q(a, b, IMM7) + unsafe { __lsx_vssrani_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrani_bu_h(a: v16u8, b: v16i8) -> v16u8 { +pub fn lsx_vssrani_bu_h(a: v16u8, b: v16i8) -> v16u8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vssrani_bu_h(a, b, IMM4) + unsafe { __lsx_vssrani_bu_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrani_hu_w(a: v8u16, b: v8i16) -> v8u16 { +pub fn lsx_vssrani_hu_w(a: v8u16, b: v8i16) -> v8u16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vssrani_hu_w(a, b, IMM5) + unsafe { __lsx_vssrani_hu_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrani_wu_d(a: v4u32, b: v4i32) -> v4u32 { +pub fn lsx_vssrani_wu_d(a: v4u32, b: v4i32) -> v4u32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vssrani_wu_d(a, b, IMM6) + unsafe { __lsx_vssrani_wu_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrani_du_q(a: v2u64, b: v2i64) -> v2u64 { +pub fn lsx_vssrani_du_q(a: v2u64, b: v2i64) -> v2u64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vssrani_du_q(a, b, IMM7) + unsafe { __lsx_vssrani_du_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarni_b_h(a: v16i8, b: v16i8) -> v16i8 { +pub fn lsx_vssrarni_b_h(a: v16i8, b: v16i8) -> v16i8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vssrarni_b_h(a, b, IMM4) + unsafe { __lsx_vssrarni_b_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarni_h_w(a: v8i16, b: v8i16) -> v8i16 { +pub fn lsx_vssrarni_h_w(a: v8i16, b: v8i16) -> v8i16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vssrarni_h_w(a, b, IMM5) + unsafe { __lsx_vssrarni_h_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarni_w_d(a: v4i32, b: v4i32) -> v4i32 { +pub fn lsx_vssrarni_w_d(a: v4i32, b: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vssrarni_w_d(a, b, IMM6) + unsafe { __lsx_vssrarni_w_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarni_d_q(a: v2i64, b: v2i64) -> v2i64 { +pub fn lsx_vssrarni_d_q(a: v2i64, b: v2i64) -> v2i64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vssrarni_d_q(a, b, IMM7) + unsafe { __lsx_vssrarni_d_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarni_bu_h(a: v16u8, b: v16i8) -> v16u8 { +pub fn lsx_vssrarni_bu_h(a: v16u8, b: v16i8) -> v16u8 { static_assert_uimm_bits!(IMM4, 4); - __lsx_vssrarni_bu_h(a, b, IMM4) + unsafe { __lsx_vssrarni_bu_h(a, b, IMM4) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarni_hu_w(a: v8u16, b: v8i16) -> v8u16 { +pub fn lsx_vssrarni_hu_w(a: v8u16, b: v8i16) -> v8u16 { static_assert_uimm_bits!(IMM5, 5); - __lsx_vssrarni_hu_w(a, b, IMM5) + unsafe { __lsx_vssrarni_hu_w(a, b, IMM5) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarni_wu_d(a: v4u32, b: v4i32) -> v4u32 { +pub fn lsx_vssrarni_wu_d(a: v4u32, b: v4i32) -> v4u32 { static_assert_uimm_bits!(IMM6, 6); - __lsx_vssrarni_wu_d(a, b, IMM6) + unsafe { __lsx_vssrarni_wu_d(a, b, IMM6) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrarni_du_q(a: v2u64, b: v2i64) -> v2u64 { +pub fn lsx_vssrarni_du_q(a: v2u64, b: v2i64) -> v2u64 { static_assert_uimm_bits!(IMM7, 7); - __lsx_vssrarni_du_q(a, b, IMM7) + unsafe { __lsx_vssrarni_du_q(a, b, IMM7) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(2)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vpermi_w(a: v4i32, b: v4i32) -> v4i32 { +pub fn lsx_vpermi_w(a: v4i32, b: v4i32) -> v4i32 { static_assert_uimm_bits!(IMM8, 8); - __lsx_vpermi_w(a, b, IMM8) + unsafe { __lsx_vpermi_w(a, b, IMM8) } } #[inline] @@ -6381,66 +6381,66 @@ pub unsafe fn lsx_vst(a: v16i8, mem_addr: *mut i8) { #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrn_b_h(a: v8i16, b: v8i16) -> v16i8 { - __lsx_vssrlrn_b_h(a, b) +pub fn lsx_vssrlrn_b_h(a: v8i16, b: v8i16) -> v16i8 { + unsafe { __lsx_vssrlrn_b_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrn_h_w(a: v4i32, b: v4i32) -> v8i16 { - __lsx_vssrlrn_h_w(a, b) +pub fn lsx_vssrlrn_h_w(a: v4i32, b: v4i32) -> v8i16 { + unsafe { __lsx_vssrlrn_h_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrlrn_w_d(a: v2i64, b: v2i64) -> v4i32 { - __lsx_vssrlrn_w_d(a, b) +pub fn lsx_vssrlrn_w_d(a: v2i64, b: v2i64) -> v4i32 { + unsafe { __lsx_vssrlrn_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrln_b_h(a: v8i16, b: v8i16) -> v16i8 { - __lsx_vssrln_b_h(a, b) +pub fn lsx_vssrln_b_h(a: v8i16, b: v8i16) -> v16i8 { + unsafe { __lsx_vssrln_b_h(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrln_h_w(a: v4i32, b: v4i32) -> v8i16 { - __lsx_vssrln_h_w(a, b) +pub fn lsx_vssrln_h_w(a: v4i32, b: v4i32) -> v8i16 { + unsafe { __lsx_vssrln_h_w(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vssrln_w_d(a: v2i64, b: v2i64) -> v4i32 { - __lsx_vssrln_w_d(a, b) +pub fn lsx_vssrln_w_d(a: v2i64, b: v2i64) -> v4i32 { + unsafe { __lsx_vssrln_w_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vorn_v(a: v16i8, b: v16i8) -> v16i8 { - __lsx_vorn_v(a, b) +pub fn lsx_vorn_v(a: v16i8, b: v16i8) -> v16i8 { + unsafe { __lsx_vorn_v(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(0)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vldi() -> v2i64 { +pub fn lsx_vldi() -> v2i64 { static_assert_simm_bits!(IMM_S13, 13); - __lsx_vldi(IMM_S13) + unsafe { __lsx_vldi(IMM_S13) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vshuf_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 { - __lsx_vshuf_b(a, b, c) +pub fn lsx_vshuf_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 { + unsafe { __lsx_vshuf_b(a, b, c) } } #[inline] @@ -6460,420 +6460,420 @@ pub unsafe fn lsx_vstx(a: v16i8, mem_addr: *mut i8, b: i64) { #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vextl_qu_du(a: v2u64) -> v2u64 { - __lsx_vextl_qu_du(a) +pub fn lsx_vextl_qu_du(a: v2u64) -> v2u64 { + unsafe { __lsx_vextl_qu_du(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_bnz_b(a: v16u8) -> i32 { - __lsx_bnz_b(a) +pub fn lsx_bnz_b(a: v16u8) -> i32 { + unsafe { __lsx_bnz_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_bnz_d(a: v2u64) -> i32 { - __lsx_bnz_d(a) +pub fn lsx_bnz_d(a: v2u64) -> i32 { + unsafe { __lsx_bnz_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_bnz_h(a: v8u16) -> i32 { - __lsx_bnz_h(a) +pub fn lsx_bnz_h(a: v8u16) -> i32 { + unsafe { __lsx_bnz_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_bnz_v(a: v16u8) -> i32 { - __lsx_bnz_v(a) +pub fn lsx_bnz_v(a: v16u8) -> i32 { + unsafe { __lsx_bnz_v(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_bnz_w(a: v4u32) -> i32 { - __lsx_bnz_w(a) +pub fn lsx_bnz_w(a: v4u32) -> i32 { + unsafe { __lsx_bnz_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_bz_b(a: v16u8) -> i32 { - __lsx_bz_b(a) +pub fn lsx_bz_b(a: v16u8) -> i32 { + unsafe { __lsx_bz_b(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_bz_d(a: v2u64) -> i32 { - __lsx_bz_d(a) +pub fn lsx_bz_d(a: v2u64) -> i32 { + unsafe { __lsx_bz_d(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_bz_h(a: v8u16) -> i32 { - __lsx_bz_h(a) +pub fn lsx_bz_h(a: v8u16) -> i32 { + unsafe { __lsx_bz_h(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_bz_v(a: v16u8) -> i32 { - __lsx_bz_v(a) +pub fn lsx_bz_v(a: v16u8) -> i32 { + unsafe { __lsx_bz_v(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_bz_w(a: v4u32) -> i32 { - __lsx_bz_w(a) +pub fn lsx_bz_w(a: v4u32) -> i32 { + unsafe { __lsx_bz_w(a) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_caf_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_caf_d(a, b) +pub fn lsx_vfcmp_caf_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_caf_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_caf_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_caf_s(a, b) +pub fn lsx_vfcmp_caf_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_caf_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_ceq_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_ceq_d(a, b) +pub fn lsx_vfcmp_ceq_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_ceq_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_ceq_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_ceq_s(a, b) +pub fn lsx_vfcmp_ceq_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_ceq_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cle_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_cle_d(a, b) +pub fn lsx_vfcmp_cle_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_cle_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cle_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_cle_s(a, b) +pub fn lsx_vfcmp_cle_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_cle_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_clt_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_clt_d(a, b) +pub fn lsx_vfcmp_clt_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_clt_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_clt_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_clt_s(a, b) +pub fn lsx_vfcmp_clt_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_clt_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cne_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_cne_d(a, b) +pub fn lsx_vfcmp_cne_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_cne_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cne_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_cne_s(a, b) +pub fn lsx_vfcmp_cne_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_cne_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cor_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_cor_d(a, b) +pub fn lsx_vfcmp_cor_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_cor_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cor_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_cor_s(a, b) +pub fn lsx_vfcmp_cor_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_cor_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cueq_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_cueq_d(a, b) +pub fn lsx_vfcmp_cueq_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_cueq_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cueq_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_cueq_s(a, b) +pub fn lsx_vfcmp_cueq_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_cueq_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cule_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_cule_d(a, b) +pub fn lsx_vfcmp_cule_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_cule_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cule_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_cule_s(a, b) +pub fn lsx_vfcmp_cule_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_cule_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cult_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_cult_d(a, b) +pub fn lsx_vfcmp_cult_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_cult_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cult_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_cult_s(a, b) +pub fn lsx_vfcmp_cult_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_cult_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cun_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_cun_d(a, b) +pub fn lsx_vfcmp_cun_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_cun_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cune_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_cune_d(a, b) +pub fn lsx_vfcmp_cune_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_cune_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cune_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_cune_s(a, b) +pub fn lsx_vfcmp_cune_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_cune_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_cun_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_cun_s(a, b) +pub fn lsx_vfcmp_cun_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_cun_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_saf_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_saf_d(a, b) +pub fn lsx_vfcmp_saf_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_saf_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_saf_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_saf_s(a, b) +pub fn lsx_vfcmp_saf_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_saf_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_seq_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_seq_d(a, b) +pub fn lsx_vfcmp_seq_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_seq_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_seq_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_seq_s(a, b) +pub fn lsx_vfcmp_seq_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_seq_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sle_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_sle_d(a, b) +pub fn lsx_vfcmp_sle_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_sle_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sle_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_sle_s(a, b) +pub fn lsx_vfcmp_sle_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_sle_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_slt_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_slt_d(a, b) +pub fn lsx_vfcmp_slt_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_slt_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_slt_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_slt_s(a, b) +pub fn lsx_vfcmp_slt_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_slt_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sne_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_sne_d(a, b) +pub fn lsx_vfcmp_sne_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_sne_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sne_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_sne_s(a, b) +pub fn lsx_vfcmp_sne_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_sne_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sor_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_sor_d(a, b) +pub fn lsx_vfcmp_sor_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_sor_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sor_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_sor_s(a, b) +pub fn lsx_vfcmp_sor_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_sor_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sueq_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_sueq_d(a, b) +pub fn lsx_vfcmp_sueq_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_sueq_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sueq_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_sueq_s(a, b) +pub fn lsx_vfcmp_sueq_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_sueq_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sule_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_sule_d(a, b) +pub fn lsx_vfcmp_sule_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_sule_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sule_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_sule_s(a, b) +pub fn lsx_vfcmp_sule_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_sule_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sult_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_sult_d(a, b) +pub fn lsx_vfcmp_sult_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_sult_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sult_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_sult_s(a, b) +pub fn lsx_vfcmp_sult_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_sult_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sun_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_sun_d(a, b) +pub fn lsx_vfcmp_sun_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_sun_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sune_d(a: v2f64, b: v2f64) -> v2i64 { - __lsx_vfcmp_sune_d(a, b) +pub fn lsx_vfcmp_sune_d(a: v2f64, b: v2f64) -> v2i64 { + unsafe { __lsx_vfcmp_sune_d(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sune_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_sune_s(a, b) +pub fn lsx_vfcmp_sune_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_sune_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vfcmp_sun_s(a: v4f32, b: v4f32) -> v4i32 { - __lsx_vfcmp_sun_s(a, b) +pub fn lsx_vfcmp_sun_s(a: v4f32, b: v4f32) -> v4i32 { + unsafe { __lsx_vfcmp_sun_s(a, b) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(0)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrepli_b() -> v16i8 { +pub fn lsx_vrepli_b() -> v16i8 { static_assert_simm_bits!(IMM_S10, 10); - __lsx_vrepli_b(IMM_S10) + unsafe { __lsx_vrepli_b(IMM_S10) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(0)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrepli_d() -> v2i64 { +pub fn lsx_vrepli_d() -> v2i64 { static_assert_simm_bits!(IMM_S10, 10); - __lsx_vrepli_d(IMM_S10) + unsafe { __lsx_vrepli_d(IMM_S10) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(0)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrepli_h() -> v8i16 { +pub fn lsx_vrepli_h() -> v8i16 { static_assert_simm_bits!(IMM_S10, 10); - __lsx_vrepli_h(IMM_S10) + unsafe { __lsx_vrepli_h(IMM_S10) } } #[inline] #[target_feature(enable = "lsx")] #[rustc_legacy_const_generics(0)] #[unstable(feature = "stdarch_loongarch", issue = "117427")] -pub unsafe fn lsx_vrepli_w() -> v4i32 { +pub fn lsx_vrepli_w() -> v4i32 { static_assert_simm_bits!(IMM_S10, 10); - __lsx_vrepli_w(IMM_S10) + unsafe { __lsx_vrepli_w(IMM_S10) } } diff --git a/library/stdarch/crates/stdarch-gen-loongarch/README.md b/library/stdarch/crates/stdarch-gen-loongarch/README.md index 1fc81483a12e..2b3f00f34aff 100644 --- a/library/stdarch/crates/stdarch-gen-loongarch/README.md +++ b/library/stdarch/crates/stdarch-gen-loongarch/README.md @@ -11,7 +11,6 @@ LSX: # Generate bindings OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lsxintrin.h OUT_DIR=`pwd`/crates/core_arch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lsx.spec -rustfmt crates/core_arch/src/loongarch64/lsx/generated.rs # Generate tests OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lsx.spec test @@ -25,7 +24,6 @@ LASX: # Generate bindings OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lasxintrin.h OUT_DIR=`pwd`/crates/core_arch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lasx.spec -rustfmt crates/core_arch/src/loongarch64/lasx/generated.rs # Generate tests OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lasx.spec test diff --git a/library/stdarch/crates/stdarch-gen-loongarch/src/main.rs b/library/stdarch/crates/stdarch-gen-loongarch/src/main.rs index aa9990b6ccd1..40132097f5de 100644 --- a/library/stdarch/crates/stdarch-gen-loongarch/src/main.rs +++ b/library/stdarch/crates/stdarch-gen-loongarch/src/main.rs @@ -274,13 +274,14 @@ fn gen_bind_body( } }; + let is_mem = in_t.iter().any(|s| s.contains("POINTER")); let is_store = current_name.to_string().contains("vst"); let link_function = { let fn_decl = { let fn_output = if out_t.to_lowercase() == "void" { String::new() } else { - format!("-> {}", type_to_rst(out_t, is_store)) + format!(" -> {}", type_to_rst(out_t, is_store)) }; let fn_inputs = match para_num { 1 => format!("(a: {})", type_to_rst(in_t[0], is_store)), @@ -304,7 +305,7 @@ fn gen_bind_body( ), _ => panic!("unsupported parameter number"), }; - format!("fn __{current_name}{fn_inputs} {fn_output};") + format!("fn __{current_name}{fn_inputs}{fn_output};") }; let function = format!( r#" #[link_name = "llvm.loongarch.{}"] @@ -456,31 +457,40 @@ fn gen_bind_body( }; rustc_legacy_const_generics = "rustc_legacy_const_generics(2, 3)"; } - format!("pub unsafe fn {current_name}{fn_inputs} {fn_output}") + format!( + "pub {}fn {current_name}{fn_inputs} {fn_output}", + if is_mem { "unsafe " } else { "" } + ) }; + let unsafe_start = if !is_mem { "unsafe { " } else { "" }; + let unsafe_end = if !is_mem { " }" } else { "" }; let mut call_params = { match para_num { - 1 => format!("__{current_name}(a)"), - 2 => format!("__{current_name}(a, b)"), - 3 => format!("__{current_name}(a, b, c)"), - 4 => format!("__{current_name}(a, b, c, d)"), + 1 => format!("{unsafe_start}__{current_name}(a){unsafe_end}"), + 2 => format!("{unsafe_start}__{current_name}(a, b){unsafe_end}"), + 3 => format!("{unsafe_start}__{current_name}(a, b, c){unsafe_end}"), + 4 => format!("{unsafe_start}__{current_name}(a, b, c, d){unsafe_end}"), _ => panic!("unsupported parameter number"), } }; if para_num == 1 && in_t[0] == "HI" { call_params = match asm_fmts[1].as_str() { "si10" => { - format!("static_assert_simm_bits!(IMM_S10, 10);\n __{current_name}(IMM_S10)") + format!( + "static_assert_simm_bits!(IMM_S10, 10);\n {unsafe_start}__{current_name}(IMM_S10){unsafe_end}" + ) } "i13" => { - format!("static_assert_simm_bits!(IMM_S13, 13);\n __{current_name}(IMM_S13)") + format!( + "static_assert_simm_bits!(IMM_S13, 13);\n {unsafe_start}__{current_name}(IMM_S13){unsafe_end}" + ) } _ => panic!("unsupported assembly format: {}", asm_fmts[2]), } } else if para_num == 2 && (in_t[1] == "UQI" || in_t[1] == "USI") { call_params = if asm_fmts[2].starts_with("ui") { format!( - "static_assert_uimm_bits!(IMM{0}, {0});\n __{current_name}(a, IMM{0})", + "static_assert_uimm_bits!(IMM{0}, {0});\n {unsafe_start}__{current_name}(a, IMM{0}){unsafe_end}", asm_fmts[2].get(2..).unwrap() ) } else { @@ -489,14 +499,16 @@ fn gen_bind_body( } else if para_num == 2 && in_t[1] == "QI" { call_params = match asm_fmts[2].as_str() { "si5" => { - format!("static_assert_simm_bits!(IMM_S5, 5);\n __{current_name}(a, IMM_S5)") + format!( + "static_assert_simm_bits!(IMM_S5, 5);\n {unsafe_start}__{current_name}(a, IMM_S5){unsafe_end}" + ) } _ => panic!("unsupported assembly format: {}", asm_fmts[2]), }; } else if para_num == 2 && in_t[0] == "CVPOINTER" && in_t[1] == "SI" { call_params = if asm_fmts[2].starts_with("si") { format!( - "static_assert_simm_bits!(IMM_S{0}, {0});\n __{current_name}(mem_addr, IMM_S{0})", + "static_assert_simm_bits!(IMM_S{0}, {0});\n {unsafe_start}__{current_name}(mem_addr, IMM_S{0}){unsafe_end}", asm_fmts[2].get(2..).unwrap() ) } else { @@ -504,13 +516,13 @@ fn gen_bind_body( } } else if para_num == 2 && in_t[0] == "CVPOINTER" && in_t[1] == "DI" { call_params = match asm_fmts[2].as_str() { - "rk" => format!("__{current_name}(mem_addr, b)"), + "rk" => format!("{unsafe_start}__{current_name}(mem_addr, b){unsafe_end}"), _ => panic!("unsupported assembly format: {}", asm_fmts[2]), }; } else if para_num == 3 && (in_t[2] == "USI" || in_t[2] == "UQI") { call_params = if asm_fmts[2].starts_with("ui") { format!( - "static_assert_uimm_bits!(IMM{0}, {0});\n __{current_name}(a, b, IMM{0})", + "static_assert_uimm_bits!(IMM{0}, {0});\n {unsafe_start}__{current_name}(a, b, IMM{0}){unsafe_end}", asm_fmts[2].get(2..).unwrap() ) } else { @@ -519,19 +531,19 @@ fn gen_bind_body( } else if para_num == 3 && in_t[1] == "CVPOINTER" && in_t[2] == "SI" { call_params = match asm_fmts[2].as_str() { "si12" => format!( - "static_assert_simm_bits!(IMM_S12, 12);\n __{current_name}(a, mem_addr, IMM_S12)" + "static_assert_simm_bits!(IMM_S12, 12);\n {unsafe_start}__{current_name}(a, mem_addr, IMM_S12){unsafe_end}" ), _ => panic!("unsupported assembly format: {}", asm_fmts[2]), }; } else if para_num == 3 && in_t[1] == "CVPOINTER" && in_t[2] == "DI" { call_params = match asm_fmts[2].as_str() { - "rk" => format!("__{current_name}(a, mem_addr, b)"), + "rk" => format!("{unsafe_start}__{current_name}(a, mem_addr, b){unsafe_end}"), _ => panic!("unsupported assembly format: {}", asm_fmts[2]), }; } else if para_num == 4 { call_params = match (asm_fmts[2].as_str(), current_name.chars().last().unwrap()) { ("si8", t) => format!( - "static_assert_simm_bits!(IMM_S8, 8);\n static_assert_uimm_bits!(IMM{0}, {0});\n __{current_name}(a, mem_addr, IMM_S8, IMM{0})", + "static_assert_simm_bits!(IMM_S8, 8);\n static_assert_uimm_bits!(IMM{0}, {0});\n {unsafe_start}__{current_name}(a, mem_addr, IMM_S8, IMM{0}){unsafe_end}", type_to_imm(t) ), (_, _) => panic!( From d1a146bbbbe2de47b77aacf3cb47eb79eb39338b Mon Sep 17 00:00:00 2001 From: Jens Reidel Date: Fri, 18 Jul 2025 18:33:26 +0200 Subject: [PATCH 067/183] tests: Skip supported-crate-types test on musl hosts This test depends on the target-specific behavior of crt-static for musl targets. However, running the testsuite on a musl host requires setting `crt-static` to `false`, as it wouldn't otherwise be possible to build rustc. This in turn will enable `-Ctarget-feature=-crt-static` for all tests, mismatching the expected `+crt-static` for the musl target tested in this testcase. Since this test specifically tests the default value of `crt-static` for the musl target, ignoring it entirely makes more sense than manually setting `-Ctarget-feature=+crt-static` here, but both would be valid approaches. Signed-off-by: Jens Reidel --- tests/ui/print-request/supported-crate-types.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/ui/print-request/supported-crate-types.rs b/tests/ui/print-request/supported-crate-types.rs index c8b4c0c1a416..50185a231eeb 100644 --- a/tests/ui/print-request/supported-crate-types.rs +++ b/tests/ui/print-request/supported-crate-types.rs @@ -8,6 +8,11 @@ //@ check-pass +// FIXME: musl targets are currently statically linked, but running on a musl host +// requires dynamic linkage, which in turn changes the supported crate types for +// x86_64-unknown-linux-musl. +//@ ignore-musl + //@ revisions: wasm musl linux //@[wasm] compile-flags: --target=wasm32-unknown-unknown --print=supported-crate-types -Zunstable-options From b2e94bf020a99473cf80f05f410af8a5cfc486a6 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Fri, 18 Jul 2025 00:20:17 +0800 Subject: [PATCH 068/183] Add test demonstrating current beta `#[align]` name resolution regression See RUST-143834. --- .../fn-align-nameres-ambiguity-143834.rs | 21 ++++++++++++++++++ .../fn-align-nameres-ambiguity-143834.stderr | 22 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs create mode 100644 tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr diff --git a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs new file mode 100644 index 000000000000..5629f92c4681 --- /dev/null +++ b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs @@ -0,0 +1,21 @@ +//~ NOTE `align` could refer to a built-in attribute + +// Anti-regression test to demonstrate that at least we mitigated breakage from adding a new +// `#[align]` built-in attribute. + +// Needs edition >= 2018 macro use behavior. +//@ edition: 2018 + +macro_rules! align { + //~^ NOTE `align` could also refer to the macro defined here + () => { + /* .. */ + }; +} + +pub(crate) use align; +//~^ ERROR `align` is ambiguous +//~| NOTE ambiguous name +//~| NOTE ambiguous because of a name conflict with a builtin attribute + +fn main() {} diff --git a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr new file mode 100644 index 000000000000..304537173a8d --- /dev/null +++ b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr @@ -0,0 +1,22 @@ +error[E0659]: `align` is ambiguous + --> $DIR/fn-align-nameres-ambiguity-143834.rs:16:16 + | +LL | pub(crate) use align; + | ^^^^^ ambiguous name + | + = note: ambiguous because of a name conflict with a builtin attribute + = note: `align` could refer to a built-in attribute +note: `align` could also refer to the macro defined here + --> $DIR/fn-align-nameres-ambiguity-143834.rs:9:1 + | +LL | / macro_rules! align { +LL | | +LL | | () => { +LL | | /* .. */ +LL | | }; +LL | | } + | |_^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0659`. From 7dacaef5d3c252ea47287ce34234a89e3c5ff57e Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 18 Jul 2025 17:35:57 +0000 Subject: [PATCH 069/183] mem: Use `core::ffi::c_int` This alias was added in 9897bfb8a ("Fix memset arguments for MSP430 target"), which predates `core::ffi`. Now that it exists we can just use `core::ffi::c_int`. --- .../compiler-builtins/compiler-builtins/src/mem/mod.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/library/compiler-builtins/compiler-builtins/src/mem/mod.rs b/library/compiler-builtins/compiler-builtins/src/mem/mod.rs index 6828f3804e0f..a6f533cb725e 100644 --- a/library/compiler-builtins/compiler-builtins/src/mem/mod.rs +++ b/library/compiler-builtins/compiler-builtins/src/mem/mod.rs @@ -3,13 +3,6 @@ // FIXME(e2024): this eventually needs to be removed. #![allow(unsafe_op_in_unsafe_fn)] -#[allow(warnings)] -#[cfg(target_pointer_width = "16")] -type c_int = i16; -#[allow(warnings)] -#[cfg(not(target_pointer_width = "16"))] -type c_int = i32; - // memcpy/memmove/memset have optimized implementations on some architectures #[cfg_attr( all(not(feature = "no-asm"), target_arch = "x86_64"), @@ -38,7 +31,7 @@ intrinsics! { } #[mem_builtin] - pub unsafe extern "C" fn memset(s: *mut u8, c: crate::mem::c_int, n: usize) -> *mut u8 { + pub unsafe extern "C" fn memset(s: *mut u8, c: core::ffi::c_int, n: usize) -> *mut u8 { impls::set_bytes(s, c as u8, n); s } From 69b71e44107b4905ec7ad84ccb3edf4f14b3df69 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Fri, 18 Jul 2025 00:10:46 +0800 Subject: [PATCH 070/183] Mitigate `#[align]` name resolution ambiguity regression with a rename From `#[align]` -> `#[rustc_align]`. Attributes starting with `rustc` are always perma-unstable and feature-gated by `feature(rustc_attrs)`. See regression RUST-143834. For the underlying problem where even introducing new feature-gated unstable built-in attributes can break user code such as ```rs macro_rules! align { () => { /* .. */ }; } pub(crate) use align; // `use` here becomes ambiguous ``` refer to RUST-134963. Since the `#[align]` attribute is still feature-gated by `feature(fn_align)`, we can rename it as a mitigation. Note that `#[rustc_align]` will obviously mean that current unstable user code using `feature(fn_aling)` will need additionally `feature(rustc_attrs)`, but this is a short-term mitigation to buy time, and is expected to be changed to a better name with less collision potential. See where mitigation options were considered. --- .../src/attributes.rs | 1 + .../src/attributes/codegen_attrs.rs | 3 +- .../rustc_attr_parsing/src/attributes/repr.rs | 2 +- compiler/rustc_feature/src/builtin_attrs.rs | 3 +- .../src/middle/codegen_fn_attrs.rs | 1 + compiler/rustc_parse/src/validate_attr.rs | 4 +- compiler/rustc_passes/messages.ftl | 6 +- compiler/rustc_passes/src/check_attr.rs | 1 + compiler/rustc_span/src/symbol.rs | 2 + src/tools/miri/tests/pass/fn_align.rs | 10 +- tests/codegen/align-fn.rs | 54 +++--- tests/codegen/min-function-alignment.rs | 6 +- tests/codegen/naked-fn/aligned.rs | 5 +- .../naked-fn/min-function-alignment.rs | 6 +- tests/ui/asm/naked-with-invalid-repr-attr.rs | 6 +- .../asm/naked-with-invalid-repr-attr.stderr | 12 +- tests/ui/attributes/fn-align-dyn.rs | 7 +- .../fn-align-nameres-ambiguity-143834.rs | 10 +- .../fn-align-nameres-ambiguity-143834.stderr | 22 --- tests/ui/attributes/malformed-attrs.rs | 3 +- tests/ui/attributes/malformed-attrs.stderr | 170 +++++++++--------- tests/ui/attributes/malformed-fn-align.rs | 35 ++-- tests/ui/attributes/malformed-fn-align.stderr | 116 ++++++------ .../ui/feature-gates/feature-gate-fn_align.rs | 14 +- .../feature-gate-fn_align.stderr | 26 +-- 25 files changed, 270 insertions(+), 255 deletions(-) delete mode 100644 tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs index 3157b18b6351..9f99b33adcc4 100644 --- a/compiler/rustc_attr_data_structures/src/attributes.rs +++ b/compiler/rustc_attr_data_structures/src/attributes.rs @@ -234,6 +234,7 @@ pub enum CfgEntry { pub enum AttributeKind { // tidy-alphabetical-start /// Represents `#[align(N)]`. + // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity Align { align: Align, span: Span }, /// Represents `#[rustc_allow_const_fn_unstable]`. diff --git a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs index 3e542771d58c..bb28121c2c5d 100644 --- a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs +++ b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs @@ -177,7 +177,8 @@ impl AttributeParser for NakedParser { sym::instruction_set, sym::repr, sym::rustc_std_internal_symbol, - sym::align, + // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity + sym::rustc_align, // obviously compatible with self sym::naked, // documentation diff --git a/compiler/rustc_attr_parsing/src/attributes/repr.rs b/compiler/rustc_attr_parsing/src/attributes/repr.rs index 6a45832ed7fd..521acbb607c7 100644 --- a/compiler/rustc_attr_parsing/src/attributes/repr.rs +++ b/compiler/rustc_attr_parsing/src/attributes/repr.rs @@ -274,7 +274,7 @@ fn parse_alignment(node: &LitKind) -> Result { pub(crate) struct AlignParser(Option<(Align, Span)>); impl AlignParser { - const PATH: &'static [Symbol] = &[sym::align]; + const PATH: &'static [Symbol] = &[sym::rustc_align]; const TEMPLATE: AttributeTemplate = template!(List: ""); fn parse<'c, S: Stage>( diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index 74872504b79f..96df6aa19bcc 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -490,7 +490,8 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ ), ungated!(no_link, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No), ungated!(repr, Normal, template!(List: "C"), DuplicatesOk, EncodeCrossCrate::No), - gated!(align, Normal, template!(List: "alignment"), DuplicatesOk, EncodeCrossCrate::No, fn_align, experimental!(align)), + // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity + gated!(rustc_align, Normal, template!(List: "alignment"), DuplicatesOk, EncodeCrossCrate::No, fn_align, experimental!(rustc_align)), ungated!(unsafe(Edition2024) export_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, EncodeCrossCrate::No), ungated!(unsafe(Edition2024) link_section, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, EncodeCrossCrate::No), ungated!(unsafe(Edition2024) no_mangle, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No), diff --git a/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs b/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs index 6eae3b51e29f..34a29acdc85a 100644 --- a/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs +++ b/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs @@ -70,6 +70,7 @@ pub struct CodegenFnAttrs { /// switching between multiple instruction sets. pub instruction_set: Option, /// The `#[align(...)]` attribute. Determines the alignment of the function body. + // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity pub alignment: Option, /// The `#[patchable_function_entry(...)]` attribute. Indicates how many nops should be around /// the function entry. diff --git a/compiler/rustc_parse/src/validate_attr.rs b/compiler/rustc_parse/src/validate_attr.rs index a476f0db37e0..cca621103b5d 100644 --- a/compiler/rustc_parse/src/validate_attr.rs +++ b/compiler/rustc_parse/src/validate_attr.rs @@ -294,7 +294,9 @@ pub fn check_builtin_meta_item( | sym::rustc_paren_sugar | sym::type_const | sym::repr - | sym::align + // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres + // ambiguity + | sym::rustc_align | sym::deprecated | sym::optimize | sym::pointee diff --git a/compiler/rustc_passes/messages.ftl b/compiler/rustc_passes/messages.ftl index d1b856ca4157..f5375f235412 100644 --- a/compiler/rustc_passes/messages.ftl +++ b/compiler/rustc_passes/messages.ftl @@ -14,7 +14,7 @@ passes_abi_of = fn_abi_of({$fn_name}) = {$fn_abi} passes_align_attr_application = - `#[align(...)]` should be applied to a function item + `#[rustc_align(...)]` should be applied to a function item .label = not a function item passes_align_on_fields = @@ -22,7 +22,7 @@ passes_align_on_fields = .warn = {-passes_previously_accepted} passes_align_should_be_repr_align = - `#[align(...)]` is not supported on {$item} items + `#[rustc_align(...)]` is not supported on {$item} items .suggestion = use `#[repr(align(...))]` instead passes_allow_incoherent_impl = @@ -604,7 +604,7 @@ passes_repr_align_greater_than_target_max = passes_repr_align_should_be_align = `#[repr(align(...))]` is not supported on {$item} items - .help = use `#[align(...)]` instead + .help = use `#[rustc_align(...)]` instead passes_repr_conflicting = conflicting representation hints diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 2766b14bb8d0..4f35bcc6be10 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -1957,6 +1957,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } /// Checks if the `#[align]` attributes on `item` are valid. + // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity fn check_align( &self, span: Span, diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index d28a73bc1397..762126a4aaa6 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1809,6 +1809,8 @@ symbols! { rust_out, rustc, rustc_abi, + // FIXME(#82232, #143834): temporary name to mitigate `#[align]` nameres ambiguity + rustc_align, rustc_allocator, rustc_allocator_zeroed, rustc_allow_const_fn_unstable, diff --git a/src/tools/miri/tests/pass/fn_align.rs b/src/tools/miri/tests/pass/fn_align.rs index 28f929958800..9752d033458d 100644 --- a/src/tools/miri/tests/pass/fn_align.rs +++ b/src/tools/miri/tests/pass/fn_align.rs @@ -1,15 +1,19 @@ //@compile-flags: -Zmin-function-alignment=8 + +// FIXME(rust-lang/rust#82232, rust-lang/rust#143834): temporarily renamed to mitigate `#[align]` +// nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] // When a function uses `align(N)`, the function address should be a multiple of `N`. -#[align(256)] +#[rustc_align(256)] fn foo() {} -#[align(16)] +#[rustc_align(16)] fn bar() {} -#[align(4)] +#[rustc_align(4)] fn baz() {} fn main() { diff --git a/tests/codegen/align-fn.rs b/tests/codegen/align-fn.rs index fd572910c287..cbc24e2ae2ea 100644 --- a/tests/codegen/align-fn.rs +++ b/tests/codegen/align-fn.rs @@ -3,11 +3,13 @@ //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) #![crate_type = "lib"] +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] // CHECK: align 16 #[unsafe(no_mangle)] -#[align(16)] +#[rustc_align(16)] pub fn fn_align() {} pub struct A; @@ -15,12 +17,12 @@ pub struct A; impl A { // CHECK: align 16 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] pub fn method_align(self) {} // CHECK: align 16 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] pub fn associated_fn() {} } @@ -29,18 +31,18 @@ trait T: Sized { fn trait_method(self) {} - #[align(8)] + #[rustc_align(8)] fn trait_method_inherit_low(self); - #[align(32)] + #[rustc_align(32)] fn trait_method_inherit_high(self); - #[align(32)] + #[rustc_align(32)] fn trait_method_inherit_default(self) {} - #[align(4)] - #[align(128)] - #[align(8)] + #[rustc_align(4)] + #[rustc_align(128)] + #[rustc_align(8)] fn inherit_highest(self) {} } @@ -48,27 +50,27 @@ impl T for A { // CHECK-LABEL: trait_fn // CHECK-SAME: align 16 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] fn trait_fn() {} // CHECK-LABEL: trait_method // CHECK-SAME: align 16 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] fn trait_method(self) {} // The prototype's align is ignored because the align here is higher. // CHECK-LABEL: trait_method_inherit_low // CHECK-SAME: align 16 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] fn trait_method_inherit_low(self) {} // The prototype's align is used because it is higher. // CHECK-LABEL: trait_method_inherit_high // CHECK-SAME: align 32 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] fn trait_method_inherit_high(self) {} // The prototype's align inherited. @@ -81,8 +83,8 @@ impl T for A { // CHECK-LABEL: inherit_highest // CHECK-SAME: align 128 #[unsafe(no_mangle)] - #[align(32)] - #[align(64)] + #[rustc_align(32)] + #[rustc_align(64)] fn inherit_highest(self) {} } @@ -90,7 +92,7 @@ trait HasDefaultImpl: Sized { // CHECK-LABEL: inherit_from_default_method // CHECK-LABEL: inherit_from_default_method // CHECK-SAME: align 32 - #[align(32)] + #[rustc_align(32)] fn inherit_from_default_method(self) {} } @@ -101,35 +103,35 @@ impl HasDefaultImpl for InstantiateDefaultMethods {} // CHECK-LABEL: align_specified_twice_1 // CHECK-SAME: align 64 #[unsafe(no_mangle)] -#[align(32)] -#[align(64)] +#[rustc_align(32)] +#[rustc_align(64)] pub fn align_specified_twice_1() {} // CHECK-LABEL: align_specified_twice_2 // CHECK-SAME: align 128 #[unsafe(no_mangle)] -#[align(128)] -#[align(32)] +#[rustc_align(128)] +#[rustc_align(32)] pub fn align_specified_twice_2() {} // CHECK-LABEL: align_specified_twice_3 // CHECK-SAME: align 256 #[unsafe(no_mangle)] -#[align(32)] -#[align(256)] +#[rustc_align(32)] +#[rustc_align(256)] pub fn align_specified_twice_3() {} const _: () = { // CHECK-LABEL: align_unmangled // CHECK-SAME: align 256 #[unsafe(no_mangle)] - #[align(32)] - #[align(256)] + #[rustc_align(32)] + #[rustc_align(256)] extern "C" fn align_unmangled() {} }; unsafe extern "C" { - #[align(256)] + #[rustc_align(256)] fn align_unmangled(); } @@ -137,5 +139,5 @@ unsafe extern "C" { // CHECK-LABEL: async_align // CHECK-SAME: align 64 #[unsafe(no_mangle)] -#[align(64)] +#[rustc_align(64)] pub async fn async_align() {} diff --git a/tests/codegen/min-function-alignment.rs b/tests/codegen/min-function-alignment.rs index 6a3843b0f4f5..ea5f957e81f1 100644 --- a/tests/codegen/min-function-alignment.rs +++ b/tests/codegen/min-function-alignment.rs @@ -5,6 +5,8 @@ //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) #![crate_type = "lib"] +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] // Functions without explicit alignment use the global minimum. @@ -21,7 +23,7 @@ pub fn no_explicit_align() {} // align16: align 16 // align1024: align 1024 #[no_mangle] -#[align(8)] +#[rustc_align(8)] pub fn lower_align() {} // the higher value of min-function-alignment and the align attribute wins out @@ -30,7 +32,7 @@ pub fn lower_align() {} // align16: align 32 // align1024: align 1024 #[no_mangle] -#[align(32)] +#[rustc_align(32)] pub fn higher_align() {} // cold functions follow the same rules as other functions diff --git a/tests/codegen/naked-fn/aligned.rs b/tests/codegen/naked-fn/aligned.rs index 2648b0213ca8..d7281c4219a1 100644 --- a/tests/codegen/naked-fn/aligned.rs +++ b/tests/codegen/naked-fn/aligned.rs @@ -4,12 +4,15 @@ //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) #![crate_type = "lib"] +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] + use std::arch::naked_asm; // CHECK: .balign 16 // CHECK-LABEL: naked_empty: -#[align(16)] +#[rustc_align(16)] #[no_mangle] #[unsafe(naked)] pub extern "C" fn naked_empty() { diff --git a/tests/codegen/naked-fn/min-function-alignment.rs b/tests/codegen/naked-fn/min-function-alignment.rs index 4ebaacd3eff7..406e9334fa59 100644 --- a/tests/codegen/naked-fn/min-function-alignment.rs +++ b/tests/codegen/naked-fn/min-function-alignment.rs @@ -3,6 +3,8 @@ //@ ignore-arm no "ret" mnemonic //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] #![crate_type = "lib"] @@ -17,7 +19,7 @@ pub extern "C" fn naked_no_explicit_align() { // CHECK: .balign 16 #[no_mangle] -#[align(8)] +#[rustc_align(8)] #[unsafe(naked)] pub extern "C" fn naked_lower_align() { core::arch::naked_asm!("ret") @@ -25,7 +27,7 @@ pub extern "C" fn naked_lower_align() { // CHECK: .balign 32 #[no_mangle] -#[align(32)] +#[rustc_align(32)] #[unsafe(naked)] pub extern "C" fn naked_higher_align() { core::arch::naked_asm!("ret") diff --git a/tests/ui/asm/naked-with-invalid-repr-attr.rs b/tests/ui/asm/naked-with-invalid-repr-attr.rs index bfbbf29a69ee..4620d007e4ec 100644 --- a/tests/ui/asm/naked-with-invalid-repr-attr.rs +++ b/tests/ui/asm/naked-with-invalid-repr-attr.rs @@ -1,5 +1,9 @@ //@ needs-asm-support + +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] + #![crate_type = "lib"] use std::arch::naked_asm; @@ -21,7 +25,7 @@ extern "C" fn example2() { #[repr(C)] //~^ ERROR attribute should be applied to a struct, enum, or union [E0517] -#[align(16)] +#[rustc_align(16)] #[unsafe(naked)] extern "C" fn example3() { //~^ NOTE not a struct, enum, or union diff --git a/tests/ui/asm/naked-with-invalid-repr-attr.stderr b/tests/ui/asm/naked-with-invalid-repr-attr.stderr index 4eb4a4e5a048..8530495be667 100644 --- a/tests/ui/asm/naked-with-invalid-repr-attr.stderr +++ b/tests/ui/asm/naked-with-invalid-repr-attr.stderr @@ -1,5 +1,5 @@ error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/naked-with-invalid-repr-attr.rs:6:8 + --> $DIR/naked-with-invalid-repr-attr.rs:10:8 | LL | #[repr(C)] | ^ @@ -11,7 +11,7 @@ LL | | } | |_- not a struct, enum, or union error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/naked-with-invalid-repr-attr.rs:14:8 + --> $DIR/naked-with-invalid-repr-attr.rs:18:8 | LL | #[repr(transparent)] | ^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | | } | |_- not a struct, enum, or union error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/naked-with-invalid-repr-attr.rs:22:8 + --> $DIR/naked-with-invalid-repr-attr.rs:26:8 | LL | #[repr(C)] | ^ @@ -35,7 +35,7 @@ LL | | } | |_- not a struct, enum, or union error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/naked-with-invalid-repr-attr.rs:32:8 + --> $DIR/naked-with-invalid-repr-attr.rs:36:8 | LL | #[repr(C, packed)] | ^ @@ -48,7 +48,7 @@ LL | | } | |_- not a struct, enum, or union error[E0517]: attribute should be applied to a struct or union - --> $DIR/naked-with-invalid-repr-attr.rs:32:11 + --> $DIR/naked-with-invalid-repr-attr.rs:36:11 | LL | #[repr(C, packed)] | ^^^^^^ @@ -61,7 +61,7 @@ LL | | } | |_- not a struct or union error[E0517]: attribute should be applied to an enum - --> $DIR/naked-with-invalid-repr-attr.rs:42:8 + --> $DIR/naked-with-invalid-repr-attr.rs:46:8 | LL | #[repr(u8)] | ^^ diff --git a/tests/ui/attributes/fn-align-dyn.rs b/tests/ui/attributes/fn-align-dyn.rs index 8ba4d5e2897d..3778c75a2caa 100644 --- a/tests/ui/attributes/fn-align-dyn.rs +++ b/tests/ui/attributes/fn-align-dyn.rs @@ -1,12 +1,15 @@ //@ run-pass //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) + +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] trait Test { - #[align(4096)] + #[rustc_align(4096)] fn foo(&self); - #[align(4096)] + #[rustc_align(4096)] fn foo1(&self); } diff --git a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs index 5629f92c4681..536d6ff43fba 100644 --- a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs +++ b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs @@ -1,21 +1,19 @@ -//~ NOTE `align` could refer to a built-in attribute - // Anti-regression test to demonstrate that at least we mitigated breakage from adding a new // `#[align]` built-in attribute. +// +// See https://github.com/rust-lang/rust/issues/143834. + +//@ check-pass // Needs edition >= 2018 macro use behavior. //@ edition: 2018 macro_rules! align { - //~^ NOTE `align` could also refer to the macro defined here () => { /* .. */ }; } pub(crate) use align; -//~^ ERROR `align` is ambiguous -//~| NOTE ambiguous name -//~| NOTE ambiguous because of a name conflict with a builtin attribute fn main() {} diff --git a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr deleted file mode 100644 index 304537173a8d..000000000000 --- a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0659]: `align` is ambiguous - --> $DIR/fn-align-nameres-ambiguity-143834.rs:16:16 - | -LL | pub(crate) use align; - | ^^^^^ ambiguous name - | - = note: ambiguous because of a name conflict with a builtin attribute - = note: `align` could refer to a built-in attribute -note: `align` could also refer to the macro defined here - --> $DIR/fn-align-nameres-ambiguity-143834.rs:9:1 - | -LL | / macro_rules! align { -LL | | -LL | | () => { -LL | | /* .. */ -LL | | }; -LL | | } - | |_^ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/attributes/malformed-attrs.rs b/tests/ui/attributes/malformed-attrs.rs index 5026687b97b0..d4c6ecaa1892 100644 --- a/tests/ui/attributes/malformed-attrs.rs +++ b/tests/ui/attributes/malformed-attrs.rs @@ -3,6 +3,7 @@ #![feature(rustc_attrs)] #![feature(rustc_allow_const_fn_unstable)] #![feature(allow_internal_unstable)] +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity #![feature(fn_align)] #![feature(optimize_attribute)] #![feature(dropck_eyepatch)] @@ -53,7 +54,7 @@ #[inline = 5] //~^ ERROR valid forms for the attribute are //~| WARN this was previously accepted by the compiler -#[align] +#[rustc_align] //~^ ERROR malformed #[optimize] //~^ ERROR malformed diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index 0d0c338d3026..de53af851a3e 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -1,5 +1,5 @@ error[E0539]: malformed `cfg` attribute input - --> $DIR/malformed-attrs.rs:102:1 + --> $DIR/malformed-attrs.rs:103:1 | LL | #[cfg] | ^^^^^^ @@ -8,7 +8,7 @@ LL | #[cfg] | help: must be of the form: `#[cfg(predicate)]` error: malformed `cfg_attr` attribute input - --> $DIR/malformed-attrs.rs:104:1 + --> $DIR/malformed-attrs.rs:105:1 | LL | #[cfg_attr] | ^^^^^^^^^^^ @@ -20,67 +20,67 @@ LL | #[cfg_attr(condition, attribute, other_attribute, ...)] | ++++++++++++++++++++++++++++++++++++++++++++ error[E0463]: can't find crate for `wloop` - --> $DIR/malformed-attrs.rs:211:1 + --> $DIR/malformed-attrs.rs:212:1 | LL | extern crate wloop; | ^^^^^^^^^^^^^^^^^^^ can't find crate error: malformed `windows_subsystem` attribute input - --> $DIR/malformed-attrs.rs:29:1 + --> $DIR/malformed-attrs.rs:30:1 | LL | #![windows_subsystem] | ^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#![windows_subsystem = "windows|console"]` error: malformed `crate_name` attribute input - --> $DIR/malformed-attrs.rs:74:1 + --> $DIR/malformed-attrs.rs:75:1 | LL | #[crate_name] | ^^^^^^^^^^^^^ help: must be of the form: `#[crate_name = "name"]` error: malformed `no_sanitize` attribute input - --> $DIR/malformed-attrs.rs:92:1 + --> $DIR/malformed-attrs.rs:93:1 | LL | #[no_sanitize] | ^^^^^^^^^^^^^^ help: must be of the form: `#[no_sanitize(address, kcfi, memory, thread)]` error: malformed `proc_macro` attribute input - --> $DIR/malformed-attrs.rs:99:1 + --> $DIR/malformed-attrs.rs:100:1 | LL | #[proc_macro = 18] | ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro]` error: malformed `instruction_set` attribute input - --> $DIR/malformed-attrs.rs:106:1 + --> $DIR/malformed-attrs.rs:107:1 | LL | #[instruction_set] | ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[instruction_set(set)]` error: malformed `patchable_function_entry` attribute input - --> $DIR/malformed-attrs.rs:108:1 + --> $DIR/malformed-attrs.rs:109:1 | LL | #[patchable_function_entry] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[patchable_function_entry(prefix_nops = m, entry_nops = n)]` error: malformed `coroutine` attribute input - --> $DIR/malformed-attrs.rs:111:5 + --> $DIR/malformed-attrs.rs:112:5 | LL | #[coroutine = 63] || {} | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[coroutine]` error: malformed `proc_macro_attribute` attribute input - --> $DIR/malformed-attrs.rs:116:1 + --> $DIR/malformed-attrs.rs:117:1 | LL | #[proc_macro_attribute = 19] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_attribute]` error: malformed `proc_macro_derive` attribute input - --> $DIR/malformed-attrs.rs:123:1 + --> $DIR/malformed-attrs.rs:124:1 | LL | #[proc_macro_derive] | ^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` error: malformed `must_not_suspend` attribute input - --> $DIR/malformed-attrs.rs:132:1 + --> $DIR/malformed-attrs.rs:133:1 | LL | #[must_not_suspend()] | ^^^^^^^^^^^^^^^^^^^^^ @@ -95,67 +95,67 @@ LL + #[must_not_suspend] | error: malformed `cfi_encoding` attribute input - --> $DIR/malformed-attrs.rs:134:1 + --> $DIR/malformed-attrs.rs:135:1 | LL | #[cfi_encoding] | ^^^^^^^^^^^^^^^ help: must be of the form: `#[cfi_encoding = "encoding"]` error: malformed `linkage` attribute input - --> $DIR/malformed-attrs.rs:173:5 + --> $DIR/malformed-attrs.rs:174:5 | LL | #[linkage] | ^^^^^^^^^^ help: must be of the form: `#[linkage = "external|internal|..."]` error: malformed `allow` attribute input - --> $DIR/malformed-attrs.rs:178:1 + --> $DIR/malformed-attrs.rs:179:1 | LL | #[allow] | ^^^^^^^^ help: must be of the form: `#[allow(lint1, lint2, ..., /*opt*/ reason = "...")]` error: malformed `expect` attribute input - --> $DIR/malformed-attrs.rs:180:1 + --> $DIR/malformed-attrs.rs:181:1 | LL | #[expect] | ^^^^^^^^^ help: must be of the form: `#[expect(lint1, lint2, ..., /*opt*/ reason = "...")]` error: malformed `warn` attribute input - --> $DIR/malformed-attrs.rs:182:1 + --> $DIR/malformed-attrs.rs:183:1 | LL | #[warn] | ^^^^^^^ help: must be of the form: `#[warn(lint1, lint2, ..., /*opt*/ reason = "...")]` error: malformed `deny` attribute input - --> $DIR/malformed-attrs.rs:184:1 + --> $DIR/malformed-attrs.rs:185:1 | LL | #[deny] | ^^^^^^^ help: must be of the form: `#[deny(lint1, lint2, ..., /*opt*/ reason = "...")]` error: malformed `forbid` attribute input - --> $DIR/malformed-attrs.rs:186:1 + --> $DIR/malformed-attrs.rs:187:1 | LL | #[forbid] | ^^^^^^^^^ help: must be of the form: `#[forbid(lint1, lint2, ..., /*opt*/ reason = "...")]` error: malformed `debugger_visualizer` attribute input - --> $DIR/malformed-attrs.rs:188:1 + --> $DIR/malformed-attrs.rs:189:1 | LL | #[debugger_visualizer] | ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[debugger_visualizer(natvis_file = "...", gdb_script_file = "...")]` error: malformed `thread_local` attribute input - --> $DIR/malformed-attrs.rs:203:1 + --> $DIR/malformed-attrs.rs:204:1 | LL | #[thread_local()] | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[thread_local]` error: malformed `no_link` attribute input - --> $DIR/malformed-attrs.rs:207:1 + --> $DIR/malformed-attrs.rs:208:1 | LL | #[no_link()] | ^^^^^^^^^^^^ help: must be of the form: `#[no_link]` error: malformed `macro_use` attribute input - --> $DIR/malformed-attrs.rs:209:1 + --> $DIR/malformed-attrs.rs:210:1 | LL | #[macro_use = 1] | ^^^^^^^^^^^^^^^^ @@ -170,7 +170,7 @@ LL + #[macro_use] | error: malformed `macro_export` attribute input - --> $DIR/malformed-attrs.rs:214:1 + --> $DIR/malformed-attrs.rs:215:1 | LL | #[macro_export = 18] | ^^^^^^^^^^^^^^^^^^^^ @@ -185,31 +185,31 @@ LL + #[macro_export] | error: malformed `allow_internal_unsafe` attribute input - --> $DIR/malformed-attrs.rs:216:1 + --> $DIR/malformed-attrs.rs:217:1 | LL | #[allow_internal_unsafe = 1] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[allow_internal_unsafe]` error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/malformed-attrs.rs:99:1 + --> $DIR/malformed-attrs.rs:100:1 | LL | #[proc_macro = 18] | ^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_attribute]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/malformed-attrs.rs:116:1 + --> $DIR/malformed-attrs.rs:117:1 | LL | #[proc_macro_attribute = 19] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/malformed-attrs.rs:123:1 + --> $DIR/malformed-attrs.rs:124:1 | LL | #[proc_macro_derive] | ^^^^^^^^^^^^^^^^^^^^ error[E0658]: allow_internal_unsafe side-steps the unsafe_code lint - --> $DIR/malformed-attrs.rs:216:1 + --> $DIR/malformed-attrs.rs:217:1 | LL | #[allow_internal_unsafe = 1] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -218,7 +218,7 @@ LL | #[allow_internal_unsafe = 1] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: valid forms for the attribute are `#[doc(hidden|inline|...)]` and `#[doc = "string"]` - --> $DIR/malformed-attrs.rs:43:1 + --> $DIR/malformed-attrs.rs:44:1 | LL | #[doc] | ^^^^^^ @@ -228,7 +228,7 @@ LL | #[doc] = note: `#[deny(ill_formed_attribute_input)]` on by default error: valid forms for the attribute are `#[doc(hidden|inline|...)]` and `#[doc = "string"]` - --> $DIR/malformed-attrs.rs:76:1 + --> $DIR/malformed-attrs.rs:77:1 | LL | #[doc] | ^^^^^^ @@ -237,7 +237,7 @@ LL | #[doc] = note: for more information, see issue #57571 error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated")]` - --> $DIR/malformed-attrs.rs:83:1 + --> $DIR/malformed-attrs.rs:84:1 | LL | #[link] | ^^^^^^^ @@ -246,7 +246,7 @@ LL | #[link] = note: for more information, see issue #57571 error: invalid argument - --> $DIR/malformed-attrs.rs:188:1 + --> $DIR/malformed-attrs.rs:189:1 | LL | #[debugger_visualizer] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -256,7 +256,7 @@ LL | #[debugger_visualizer] = note: expected: `gdb_script_file = "..."` error[E0565]: malformed `omit_gdb_pretty_printer_section` attribute input - --> $DIR/malformed-attrs.rs:26:1 + --> $DIR/malformed-attrs.rs:27:1 | LL | #![omit_gdb_pretty_printer_section = 1] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^ @@ -265,25 +265,25 @@ LL | #![omit_gdb_pretty_printer_section = 1] | help: must be of the form: `#[omit_gdb_pretty_printer_section]` error[E0539]: malformed `export_name` attribute input - --> $DIR/malformed-attrs.rs:32:1 + --> $DIR/malformed-attrs.rs:33:1 | LL | #[unsafe(export_name)] | ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]` error: `rustc_allow_const_fn_unstable` expects a list of feature names - --> $DIR/malformed-attrs.rs:34:1 + --> $DIR/malformed-attrs.rs:35:1 | LL | #[rustc_allow_const_fn_unstable] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `allow_internal_unstable` expects a list of feature names - --> $DIR/malformed-attrs.rs:37:1 + --> $DIR/malformed-attrs.rs:38:1 | LL | #[allow_internal_unstable] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0539]: malformed `rustc_confusables` attribute input - --> $DIR/malformed-attrs.rs:39:1 + --> $DIR/malformed-attrs.rs:40:1 | LL | #[rustc_confusables] | ^^^^^^^^^^^^^^^^^^^^ @@ -292,7 +292,7 @@ LL | #[rustc_confusables] | help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]` error[E0539]: malformed `deprecated` attribute input - --> $DIR/malformed-attrs.rs:41:1 + --> $DIR/malformed-attrs.rs:42:1 | LL | #[deprecated = 5] | ^^^^^^^^^^^^^^^-^ @@ -312,13 +312,13 @@ LL + #[deprecated] | error[E0539]: malformed `rustc_macro_transparency` attribute input - --> $DIR/malformed-attrs.rs:46:1 + --> $DIR/malformed-attrs.rs:47:1 | LL | #[rustc_macro_transparency] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_macro_transparency = "transparent|semitransparent|opaque"]` error[E0539]: malformed `repr` attribute input - --> $DIR/malformed-attrs.rs:48:1 + --> $DIR/malformed-attrs.rs:49:1 | LL | #[repr] | ^^^^^^^ @@ -327,7 +327,7 @@ LL | #[repr] | help: must be of the form: `#[repr(C | Rust | align(...) | packed(...) | | transparent)]` error[E0565]: malformed `rustc_as_ptr` attribute input - --> $DIR/malformed-attrs.rs:51:1 + --> $DIR/malformed-attrs.rs:52:1 | LL | #[rustc_as_ptr = 5] | ^^^^^^^^^^^^^^^---^ @@ -335,17 +335,17 @@ LL | #[rustc_as_ptr = 5] | | didn't expect any arguments here | help: must be of the form: `#[rustc_as_ptr]` -error[E0539]: malformed `align` attribute input - --> $DIR/malformed-attrs.rs:56:1 +error[E0539]: malformed `rustc_align` attribute input + --> $DIR/malformed-attrs.rs:57:1 | -LL | #[align] - | ^^^^^^^^ +LL | #[rustc_align] + | ^^^^^^^^^^^^^^ | | | expected this to be a list - | help: must be of the form: `#[align()]` + | help: must be of the form: `#[rustc_align()]` error[E0539]: malformed `optimize` attribute input - --> $DIR/malformed-attrs.rs:58:1 + --> $DIR/malformed-attrs.rs:59:1 | LL | #[optimize] | ^^^^^^^^^^^ @@ -354,7 +354,7 @@ LL | #[optimize] | help: must be of the form: `#[optimize(size|speed|none)]` error[E0565]: malformed `cold` attribute input - --> $DIR/malformed-attrs.rs:60:1 + --> $DIR/malformed-attrs.rs:61:1 | LL | #[cold = 1] | ^^^^^^^---^ @@ -363,13 +363,13 @@ LL | #[cold = 1] | help: must be of the form: `#[cold]` error: valid forms for the attribute are `#[must_use = "reason"]` and `#[must_use]` - --> $DIR/malformed-attrs.rs:62:1 + --> $DIR/malformed-attrs.rs:63:1 | LL | #[must_use()] | ^^^^^^^^^^^^^ error[E0565]: malformed `no_mangle` attribute input - --> $DIR/malformed-attrs.rs:64:1 + --> $DIR/malformed-attrs.rs:65:1 | LL | #[no_mangle = 1] | ^^^^^^^^^^^^---^ @@ -378,7 +378,7 @@ LL | #[no_mangle = 1] | help: must be of the form: `#[no_mangle]` error[E0565]: malformed `naked` attribute input - --> $DIR/malformed-attrs.rs:66:1 + --> $DIR/malformed-attrs.rs:67:1 | LL | #[unsafe(naked())] | ^^^^^^^^^^^^^^--^^ @@ -387,7 +387,7 @@ LL | #[unsafe(naked())] | help: must be of the form: `#[naked]` error[E0565]: malformed `track_caller` attribute input - --> $DIR/malformed-attrs.rs:68:1 + --> $DIR/malformed-attrs.rs:69:1 | LL | #[track_caller()] | ^^^^^^^^^^^^^^--^ @@ -396,13 +396,13 @@ LL | #[track_caller()] | help: must be of the form: `#[track_caller]` error[E0539]: malformed `export_name` attribute input - --> $DIR/malformed-attrs.rs:70:1 + --> $DIR/malformed-attrs.rs:71:1 | LL | #[export_name()] | ^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]` error[E0805]: malformed `used` attribute input - --> $DIR/malformed-attrs.rs:72:1 + --> $DIR/malformed-attrs.rs:73:1 | LL | #[used()] | ^^^^^^--^ @@ -418,7 +418,7 @@ LL + #[used] | error[E0539]: malformed `target_feature` attribute input - --> $DIR/malformed-attrs.rs:79:1 + --> $DIR/malformed-attrs.rs:80:1 | LL | #[target_feature] | ^^^^^^^^^^^^^^^^^ @@ -427,7 +427,7 @@ LL | #[target_feature] | help: must be of the form: `#[target_feature(enable = "feat1, feat2")]` error[E0565]: malformed `export_stable` attribute input - --> $DIR/malformed-attrs.rs:81:1 + --> $DIR/malformed-attrs.rs:82:1 | LL | #[export_stable = 1] | ^^^^^^^^^^^^^^^^---^ @@ -436,19 +436,19 @@ LL | #[export_stable = 1] | help: must be of the form: `#[export_stable]` error[E0539]: malformed `link_name` attribute input - --> $DIR/malformed-attrs.rs:86:1 + --> $DIR/malformed-attrs.rs:87:1 | LL | #[link_name] | ^^^^^^^^^^^^ help: must be of the form: `#[link_name = "name"]` error[E0539]: malformed `link_section` attribute input - --> $DIR/malformed-attrs.rs:88:1 + --> $DIR/malformed-attrs.rs:89:1 | LL | #[link_section] | ^^^^^^^^^^^^^^^ help: must be of the form: `#[link_section = "name"]` error[E0539]: malformed `coverage` attribute input - --> $DIR/malformed-attrs.rs:90:1 + --> $DIR/malformed-attrs.rs:91:1 | LL | #[coverage] | ^^^^^^^^^^^ this attribute is only valid with either `on` or `off` as an argument @@ -461,7 +461,7 @@ LL | #[coverage(on)] | ++++ error[E0565]: malformed `no_implicit_prelude` attribute input - --> $DIR/malformed-attrs.rs:97:1 + --> $DIR/malformed-attrs.rs:98:1 | LL | #[no_implicit_prelude = 23] | ^^^^^^^^^^^^^^^^^^^^^^----^ @@ -470,7 +470,7 @@ LL | #[no_implicit_prelude = 23] | help: must be of the form: `#[no_implicit_prelude]` error[E0539]: malformed `must_use` attribute input - --> $DIR/malformed-attrs.rs:119:1 + --> $DIR/malformed-attrs.rs:120:1 | LL | #[must_use = 1] | ^^^^^^^^^^^^^-^ @@ -487,7 +487,7 @@ LL + #[must_use] | error[E0539]: malformed `rustc_layout_scalar_valid_range_start` attribute input - --> $DIR/malformed-attrs.rs:128:1 + --> $DIR/malformed-attrs.rs:129:1 | LL | #[rustc_layout_scalar_valid_range_start] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -496,7 +496,7 @@ LL | #[rustc_layout_scalar_valid_range_start] | help: must be of the form: `#[rustc_layout_scalar_valid_range_start(start)]` error[E0539]: malformed `rustc_layout_scalar_valid_range_end` attribute input - --> $DIR/malformed-attrs.rs:130:1 + --> $DIR/malformed-attrs.rs:131:1 | LL | #[rustc_layout_scalar_valid_range_end] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -505,7 +505,7 @@ LL | #[rustc_layout_scalar_valid_range_end] | help: must be of the form: `#[rustc_layout_scalar_valid_range_end(end)]` error[E0565]: malformed `marker` attribute input - --> $DIR/malformed-attrs.rs:155:1 + --> $DIR/malformed-attrs.rs:156:1 | LL | #[marker = 3] | ^^^^^^^^^---^ @@ -514,7 +514,7 @@ LL | #[marker = 3] | help: must be of the form: `#[marker]` error[E0565]: malformed `fundamental` attribute input - --> $DIR/malformed-attrs.rs:157:1 + --> $DIR/malformed-attrs.rs:158:1 | LL | #[fundamental()] | ^^^^^^^^^^^^^--^ @@ -523,7 +523,7 @@ LL | #[fundamental()] | help: must be of the form: `#[fundamental]` error[E0565]: malformed `ffi_pure` attribute input - --> $DIR/malformed-attrs.rs:165:5 + --> $DIR/malformed-attrs.rs:166:5 | LL | #[unsafe(ffi_pure = 1)] | ^^^^^^^^^^^^^^^^^^---^^ @@ -532,7 +532,7 @@ LL | #[unsafe(ffi_pure = 1)] | help: must be of the form: `#[ffi_pure]` error[E0539]: malformed `link_ordinal` attribute input - --> $DIR/malformed-attrs.rs:167:5 + --> $DIR/malformed-attrs.rs:168:5 | LL | #[link_ordinal] | ^^^^^^^^^^^^^^^ @@ -541,7 +541,7 @@ LL | #[link_ordinal] | help: must be of the form: `#[link_ordinal(ordinal)]` error[E0565]: malformed `ffi_const` attribute input - --> $DIR/malformed-attrs.rs:171:5 + --> $DIR/malformed-attrs.rs:172:5 | LL | #[unsafe(ffi_const = 1)] | ^^^^^^^^^^^^^^^^^^^---^^ @@ -550,7 +550,7 @@ LL | #[unsafe(ffi_const = 1)] | help: must be of the form: `#[ffi_const]` error[E0565]: malformed `automatically_derived` attribute input - --> $DIR/malformed-attrs.rs:191:1 + --> $DIR/malformed-attrs.rs:192:1 | LL | #[automatically_derived = 18] | ^^^^^^^^^^^^^^^^^^^^^^^^----^ @@ -559,7 +559,7 @@ LL | #[automatically_derived = 18] | help: must be of the form: `#[automatically_derived]` error[E0565]: malformed `non_exhaustive` attribute input - --> $DIR/malformed-attrs.rs:197:1 + --> $DIR/malformed-attrs.rs:198:1 | LL | #[non_exhaustive = 1] | ^^^^^^^^^^^^^^^^^---^ @@ -568,7 +568,7 @@ LL | #[non_exhaustive = 1] | help: must be of the form: `#[non_exhaustive]` error[E0565]: malformed `type_const` attribute input - --> $DIR/malformed-attrs.rs:143:5 + --> $DIR/malformed-attrs.rs:144:5 | LL | #[type_const = 1] | ^^^^^^^^^^^^^---^ @@ -577,7 +577,7 @@ LL | #[type_const = 1] | help: must be of the form: `#[type_const]` error: attribute should be applied to `const fn` - --> $DIR/malformed-attrs.rs:34:1 + --> $DIR/malformed-attrs.rs:35:1 | LL | #[rustc_allow_const_fn_unstable] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -589,19 +589,19 @@ LL | | } | |_- not a `const fn` error: `#[repr(align(...))]` is not supported on function items - --> $DIR/malformed-attrs.rs:48:1 + --> $DIR/malformed-attrs.rs:49:1 | LL | #[repr] | ^^^^^^^ | -help: use `#[align(...)]` instead - --> $DIR/malformed-attrs.rs:48:1 +help: use `#[rustc_align(...)]` instead + --> $DIR/malformed-attrs.rs:49:1 | LL | #[repr] | ^^^^^^^ warning: `#[diagnostic::do_not_recommend]` does not expect any arguments - --> $DIR/malformed-attrs.rs:149:1 + --> $DIR/malformed-attrs.rs:150:1 | LL | #[diagnostic::do_not_recommend()] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -609,7 +609,7 @@ LL | #[diagnostic::do_not_recommend()] = note: `#[warn(malformed_diagnostic_attributes)]` on by default warning: missing options for `on_unimplemented` attribute - --> $DIR/malformed-attrs.rs:138:1 + --> $DIR/malformed-attrs.rs:139:1 | LL | #[diagnostic::on_unimplemented] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -617,7 +617,7 @@ LL | #[diagnostic::on_unimplemented] = help: at least one of the `message`, `note` and `label` options are expected warning: malformed `on_unimplemented` attribute - --> $DIR/malformed-attrs.rs:140:1 + --> $DIR/malformed-attrs.rs:141:1 | LL | #[diagnostic::on_unimplemented = 1] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here @@ -625,7 +625,7 @@ LL | #[diagnostic::on_unimplemented = 1] = help: only `message`, `note` and `label` are allowed as options error: valid forms for the attribute are `#[inline(always|never)]` and `#[inline]` - --> $DIR/malformed-attrs.rs:53:1 + --> $DIR/malformed-attrs.rs:54:1 | LL | #[inline = 5] | ^^^^^^^^^^^^^ @@ -634,7 +634,7 @@ LL | #[inline = 5] = note: for more information, see issue #57571 error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` - --> $DIR/malformed-attrs.rs:94:1 + --> $DIR/malformed-attrs.rs:95:1 | LL | #[ignore()] | ^^^^^^^^^^^ @@ -643,7 +643,7 @@ LL | #[ignore()] = note: for more information, see issue #57571 error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` - --> $DIR/malformed-attrs.rs:223:1 + --> $DIR/malformed-attrs.rs:224:1 | LL | #[ignore = 1] | ^^^^^^^^^^^^^ @@ -652,7 +652,7 @@ LL | #[ignore = 1] = note: for more information, see issue #57571 error[E0308]: mismatched types - --> $DIR/malformed-attrs.rs:111:23 + --> $DIR/malformed-attrs.rs:112:23 | LL | fn test() { | - help: a return type might be missing here: `-> _` @@ -660,7 +660,7 @@ LL | #[coroutine = 63] || {} | ^^^^^ expected `()`, found coroutine | = note: expected unit type `()` - found coroutine `{coroutine@$DIR/malformed-attrs.rs:111:23: 111:25}` + found coroutine `{coroutine@$DIR/malformed-attrs.rs:112:23: 112:25}` error: aborting due to 75 previous errors; 3 warnings emitted diff --git a/tests/ui/attributes/malformed-fn-align.rs b/tests/ui/attributes/malformed-fn-align.rs index e06e61168424..cf143b28e548 100644 --- a/tests/ui/attributes/malformed-fn-align.rs +++ b/tests/ui/attributes/malformed-fn-align.rs @@ -1,49 +1,54 @@ +// ignore-tidy-linelength + +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] + #![crate_type = "lib"] trait MyTrait { - #[align] //~ ERROR malformed `align` attribute input + #[rustc_align] //~ ERROR malformed `rustc_align` attribute input fn myfun1(); - #[align(1, 2)] //~ ERROR malformed `align` attribute input + #[rustc_align(1, 2)] //~ ERROR malformed `rustc_align` attribute input fn myfun2(); } -#[align = 16] //~ ERROR malformed `align` attribute input +#[rustc_align = 16] //~ ERROR malformed `rustc_align` attribute input fn f1() {} -#[align("hello")] //~ ERROR invalid alignment value: not an unsuffixed integer +#[rustc_align("hello")] //~ ERROR invalid alignment value: not an unsuffixed integer fn f2() {} -#[align(0)] //~ ERROR invalid alignment value: not a power of two +#[rustc_align(0)] //~ ERROR invalid alignment value: not a power of two fn f3() {} #[repr(align(16))] //~ ERROR `#[repr(align(...))]` is not supported on function items fn f4() {} -#[align(-1)] //~ ERROR expected unsuffixed literal, found `-` +#[rustc_align(-1)] //~ ERROR expected unsuffixed literal, found `-` fn f5() {} -#[align(3)] //~ ERROR invalid alignment value: not a power of two +#[rustc_align(3)] //~ ERROR invalid alignment value: not a power of two fn f6() {} -#[align(4usize)] //~ ERROR invalid alignment value: not an unsuffixed integer [E0589] +#[rustc_align(4usize)] //~ ERROR invalid alignment value: not an unsuffixed integer [E0589] //~^ ERROR suffixed literals are not allowed in attributes fn f7() {} -#[align(16)] -#[align(3)] //~ ERROR invalid alignment value: not a power of two -#[align(16)] +#[rustc_align(16)] +#[rustc_align(3)] //~ ERROR invalid alignment value: not a power of two +#[rustc_align(16)] fn f8() {} -#[align(16)] //~ ERROR `#[align(...)]` is not supported on struct items +#[rustc_align(16)] //~ ERROR `#[rustc_align(...)]` is not supported on struct items struct S1; -#[align(32)] //~ ERROR `#[align(...)]` should be applied to a function item +#[rustc_align(32)] //~ ERROR `#[rustc_align(...)]` should be applied to a function item const FOO: i32 = 42; -#[align(32)] //~ ERROR `#[align(...)]` should be applied to a function item +#[rustc_align(32)] //~ ERROR `#[rustc_align(...)]` should be applied to a function item mod test {} -#[align(32)] //~ ERROR `#[align(...)]` should be applied to a function item +#[rustc_align(32)] //~ ERROR `#[rustc_align(...)]` should be applied to a function item use ::std::iter; diff --git a/tests/ui/attributes/malformed-fn-align.stderr b/tests/ui/attributes/malformed-fn-align.stderr index af3625b1f3b9..d995a7bf0703 100644 --- a/tests/ui/attributes/malformed-fn-align.stderr +++ b/tests/ui/attributes/malformed-fn-align.stderr @@ -1,119 +1,119 @@ error: expected unsuffixed literal, found `-` - --> $DIR/malformed-fn-align.rs:24:9 + --> $DIR/malformed-fn-align.rs:29:15 | -LL | #[align(-1)] - | ^ +LL | #[rustc_align(-1)] + | ^ error: suffixed literals are not allowed in attributes - --> $DIR/malformed-fn-align.rs:30:9 + --> $DIR/malformed-fn-align.rs:35:15 | -LL | #[align(4usize)] - | ^^^^^^ +LL | #[rustc_align(4usize)] + | ^^^^^^ | = help: instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.) -error[E0539]: malformed `align` attribute input - --> $DIR/malformed-fn-align.rs:5:5 +error[E0539]: malformed `rustc_align` attribute input + --> $DIR/malformed-fn-align.rs:10:5 | -LL | #[align] - | ^^^^^^^^ +LL | #[rustc_align] + | ^^^^^^^^^^^^^^ | | | expected this to be a list - | help: must be of the form: `#[align()]` + | help: must be of the form: `#[rustc_align()]` -error[E0805]: malformed `align` attribute input - --> $DIR/malformed-fn-align.rs:8:5 +error[E0805]: malformed `rustc_align` attribute input + --> $DIR/malformed-fn-align.rs:13:5 | -LL | #[align(1, 2)] - | ^^^^^^^------^ - | | | - | | expected a single argument here - | help: must be of the form: `#[align()]` +LL | #[rustc_align(1, 2)] + | ^^^^^^^^^^^^^------^ + | | | + | | expected a single argument here + | help: must be of the form: `#[rustc_align()]` -error[E0539]: malformed `align` attribute input - --> $DIR/malformed-fn-align.rs:12:1 +error[E0539]: malformed `rustc_align` attribute input + --> $DIR/malformed-fn-align.rs:17:1 | -LL | #[align = 16] - | ^^^^^^^^^^^^^ +LL | #[rustc_align = 16] + | ^^^^^^^^^^^^^^^^^^^ | | | expected this to be a list - | help: must be of the form: `#[align()]` + | help: must be of the form: `#[rustc_align()]` error[E0589]: invalid alignment value: not an unsuffixed integer - --> $DIR/malformed-fn-align.rs:15:9 + --> $DIR/malformed-fn-align.rs:20:15 | -LL | #[align("hello")] - | ^^^^^^^ +LL | #[rustc_align("hello")] + | ^^^^^^^ error[E0589]: invalid alignment value: not a power of two - --> $DIR/malformed-fn-align.rs:18:9 + --> $DIR/malformed-fn-align.rs:23:15 | -LL | #[align(0)] - | ^ +LL | #[rustc_align(0)] + | ^ error[E0589]: invalid alignment value: not a power of two - --> $DIR/malformed-fn-align.rs:27:9 + --> $DIR/malformed-fn-align.rs:32:15 | -LL | #[align(3)] - | ^ +LL | #[rustc_align(3)] + | ^ error[E0589]: invalid alignment value: not an unsuffixed integer - --> $DIR/malformed-fn-align.rs:30:9 + --> $DIR/malformed-fn-align.rs:35:15 | -LL | #[align(4usize)] - | ^^^^^^ +LL | #[rustc_align(4usize)] + | ^^^^^^ error[E0589]: invalid alignment value: not a power of two - --> $DIR/malformed-fn-align.rs:35:9 + --> $DIR/malformed-fn-align.rs:40:15 | -LL | #[align(3)] - | ^ +LL | #[rustc_align(3)] + | ^ error: `#[repr(align(...))]` is not supported on function items - --> $DIR/malformed-fn-align.rs:21:8 + --> $DIR/malformed-fn-align.rs:26:8 | LL | #[repr(align(16))] | ^^^^^^^^^ | -help: use `#[align(...)]` instead - --> $DIR/malformed-fn-align.rs:21:8 +help: use `#[rustc_align(...)]` instead + --> $DIR/malformed-fn-align.rs:26:8 | LL | #[repr(align(16))] | ^^^^^^^^^ -error: `#[align(...)]` is not supported on struct items - --> $DIR/malformed-fn-align.rs:39:1 +error: `#[rustc_align(...)]` is not supported on struct items + --> $DIR/malformed-fn-align.rs:44:1 | -LL | #[align(16)] - | ^^^^^^^^^^^^ +LL | #[rustc_align(16)] + | ^^^^^^^^^^^^^^^^^^ | help: use `#[repr(align(...))]` instead | -LL - #[align(16)] +LL - #[rustc_align(16)] LL + #[repr(align(16))] | -error: `#[align(...)]` should be applied to a function item - --> $DIR/malformed-fn-align.rs:42:1 +error: `#[rustc_align(...)]` should be applied to a function item + --> $DIR/malformed-fn-align.rs:47:1 | -LL | #[align(32)] - | ^^^^^^^^^^^^ +LL | #[rustc_align(32)] + | ^^^^^^^^^^^^^^^^^^ LL | const FOO: i32 = 42; | -------------------- not a function item -error: `#[align(...)]` should be applied to a function item - --> $DIR/malformed-fn-align.rs:45:1 +error: `#[rustc_align(...)]` should be applied to a function item + --> $DIR/malformed-fn-align.rs:50:1 | -LL | #[align(32)] - | ^^^^^^^^^^^^ +LL | #[rustc_align(32)] + | ^^^^^^^^^^^^^^^^^^ LL | mod test {} | ----------- not a function item -error: `#[align(...)]` should be applied to a function item - --> $DIR/malformed-fn-align.rs:48:1 +error: `#[rustc_align(...)]` should be applied to a function item + --> $DIR/malformed-fn-align.rs:53:1 | -LL | #[align(32)] - | ^^^^^^^^^^^^ +LL | #[rustc_align(32)] + | ^^^^^^^^^^^^^^^^^^ LL | use ::std::iter; | ---------------- not a function item diff --git a/tests/ui/feature-gates/feature-gate-fn_align.rs b/tests/ui/feature-gates/feature-gate-fn_align.rs index b6c300e5cbe6..36e17c4a8dd1 100644 --- a/tests/ui/feature-gates/feature-gate-fn_align.rs +++ b/tests/ui/feature-gates/feature-gate-fn_align.rs @@ -1,12 +1,16 @@ #![crate_type = "lib"] -#[align(16)] -//~^ ERROR the `#[align]` attribute is an experimental feature +// ignore-tidy-linelength + +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity + +#[rustc_align(16)] +//~^ ERROR the `#[rustc_align]` attribute is an experimental feature fn requires_alignment() {} trait MyTrait { - #[align] - //~^ ERROR the `#[align]` attribute is an experimental feature - //~| ERROR malformed `align` attribute input + #[rustc_align] + //~^ ERROR the `#[rustc_align]` attribute is an experimental feature + //~| ERROR malformed `rustc_align` attribute input fn myfun(); } diff --git a/tests/ui/feature-gates/feature-gate-fn_align.stderr b/tests/ui/feature-gates/feature-gate-fn_align.stderr index 921cf08435c2..6196f4f298fd 100644 --- a/tests/ui/feature-gates/feature-gate-fn_align.stderr +++ b/tests/ui/feature-gates/feature-gate-fn_align.stderr @@ -1,31 +1,31 @@ -error[E0658]: the `#[align]` attribute is an experimental feature - --> $DIR/feature-gate-fn_align.rs:3:1 +error[E0658]: the `#[rustc_align]` attribute is an experimental feature + --> $DIR/feature-gate-fn_align.rs:7:1 | -LL | #[align(16)] - | ^^^^^^^^^^^^ +LL | #[rustc_align(16)] + | ^^^^^^^^^^^^^^^^^^ | = note: see issue #82232 for more information = help: add `#![feature(fn_align)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[align]` attribute is an experimental feature - --> $DIR/feature-gate-fn_align.rs:8:5 +error[E0658]: the `#[rustc_align]` attribute is an experimental feature + --> $DIR/feature-gate-fn_align.rs:12:5 | -LL | #[align] - | ^^^^^^^^ +LL | #[rustc_align] + | ^^^^^^^^^^^^^^ | = note: see issue #82232 for more information = help: add `#![feature(fn_align)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0539]: malformed `align` attribute input - --> $DIR/feature-gate-fn_align.rs:8:5 +error[E0539]: malformed `rustc_align` attribute input + --> $DIR/feature-gate-fn_align.rs:12:5 | -LL | #[align] - | ^^^^^^^^ +LL | #[rustc_align] + | ^^^^^^^^^^^^^^ | | | expected this to be a list - | help: must be of the form: `#[align()]` + | help: must be of the form: `#[rustc_align()]` error: aborting due to 3 previous errors From 6b87978169d260ac4512e66c81e9298055b902c2 Mon Sep 17 00:00:00 2001 From: Julien THILLARD <54775010+supersurviveur@users.noreply.github.com> Date: Fri, 18 Jul 2025 20:19:13 +0200 Subject: [PATCH 071/183] Change the `memcmp` and `bcmp` return type to `c_int` Fix the return type of `memcmp` and `bcmp` builtin functions on targets with a `c_int` other than `i32`. Linked issue: https://github.com/rust-lang/rust/issues/144076 --- library/compiler-builtins/compiler-builtins/src/mem/impls.rs | 5 +++-- library/compiler-builtins/compiler-builtins/src/mem/mod.rs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/library/compiler-builtins/compiler-builtins/src/mem/impls.rs b/library/compiler-builtins/compiler-builtins/src/mem/impls.rs index 14a4787485dc..da16dee25ce5 100644 --- a/library/compiler-builtins/compiler-builtins/src/mem/impls.rs +++ b/library/compiler-builtins/compiler-builtins/src/mem/impls.rs @@ -15,6 +15,7 @@ // this use. Of course this is not a guarantee that such use will work, it just means that this // crate doing wrapping pointer arithmetic with a method that must not wrap won't be the problem if // something does go wrong at runtime. +use core::ffi::c_int; use core::intrinsics::likely; const WORD_SIZE: usize = core::mem::size_of::(); @@ -384,13 +385,13 @@ pub unsafe fn set_bytes(mut s: *mut u8, c: u8, mut n: usize) { } #[inline(always)] -pub unsafe fn compare_bytes(s1: *const u8, s2: *const u8, n: usize) -> i32 { +pub unsafe fn compare_bytes(s1: *const u8, s2: *const u8, n: usize) -> c_int { let mut i = 0; while i < n { let a = *s1.wrapping_add(i); let b = *s2.wrapping_add(i); if a != b { - return a as i32 - b as i32; + return c_int::from(a) - c_int::from(b); } i += 1; } diff --git a/library/compiler-builtins/compiler-builtins/src/mem/mod.rs b/library/compiler-builtins/compiler-builtins/src/mem/mod.rs index a6f533cb725e..a227f60a2949 100644 --- a/library/compiler-builtins/compiler-builtins/src/mem/mod.rs +++ b/library/compiler-builtins/compiler-builtins/src/mem/mod.rs @@ -37,12 +37,12 @@ intrinsics! { } #[mem_builtin] - pub unsafe extern "C" fn memcmp(s1: *const u8, s2: *const u8, n: usize) -> i32 { + pub unsafe extern "C" fn memcmp(s1: *const u8, s2: *const u8, n: usize) -> core::ffi::c_int { impls::compare_bytes(s1, s2, n) } #[mem_builtin] - pub unsafe extern "C" fn bcmp(s1: *const u8, s2: *const u8, n: usize) -> i32 { + pub unsafe extern "C" fn bcmp(s1: *const u8, s2: *const u8, n: usize) -> core::ffi::c_int { memcmp(s1, s2, n) } From 966fc577894c283a1285c8554c10fc56ba67e58c Mon Sep 17 00:00:00 2001 From: Makai Date: Tue, 15 Jul 2025 13:13:03 +0000 Subject: [PATCH 072/183] `SmirCtxt` to `CompilerCtxt`, `SmirInterface` to `CompilerInterface` aaa --- compiler/rustc_public/src/alloc.rs | 8 +- .../rustc_public/src/compiler_interface.rs | 22 ++-- compiler/rustc_public/src/lib.rs | 4 +- .../rustc_public/src/rustc_internal/mod.rs | 8 +- .../rustc_public/src/unstable/convert/mod.rs | 14 +- .../src/unstable/convert/stable/abi.rs | 50 ++++---- .../src/unstable/convert/stable/mir.rs | 80 ++++++------ .../src/unstable/convert/stable/mod.rs | 14 +- .../src/unstable/convert/stable/ty.rs | 120 +++++++++--------- compiler/rustc_public/src/unstable/mod.rs | 6 +- compiler/rustc_public_bridge/src/alloc.rs | 12 +- compiler/rustc_public_bridge/src/bridge.rs | 4 +- .../rustc_public_bridge/src/context/impls.rs | 10 +- .../rustc_public_bridge/src/context/mod.rs | 16 +-- compiler/rustc_public_bridge/src/lib.rs | 4 +- 15 files changed, 186 insertions(+), 186 deletions(-) diff --git a/compiler/rustc_public/src/alloc.rs b/compiler/rustc_public/src/alloc.rs index d2db6c08bbc0..f2cb8a900a65 100644 --- a/compiler/rustc_public/src/alloc.rs +++ b/compiler/rustc_public/src/alloc.rs @@ -8,7 +8,7 @@ use rustc_abi::Align; use rustc_middle::mir::ConstValue; use rustc_middle::mir::interpret::AllocRange; use rustc_public_bridge::bridge::SmirError; -use rustc_public_bridge::context::SmirCtxt; +use rustc_public_bridge::context::CompilerCtxt; use rustc_public_bridge::{Tables, alloc}; use super::Error; @@ -35,7 +35,7 @@ pub(crate) fn new_allocation<'tcx>( ty: rustc_middle::ty::Ty<'tcx>, const_value: ConstValue<'tcx>, tables: &mut Tables<'tcx, BridgeTys>, - cx: &SmirCtxt<'tcx, BridgeTys>, + cx: &CompilerCtxt<'tcx, BridgeTys>, ) -> Allocation { try_new_allocation(ty, const_value, tables, cx) .unwrap_or_else(|_| panic!("Failed to convert: {const_value:?} to {ty:?}")) @@ -46,7 +46,7 @@ pub(crate) fn try_new_allocation<'tcx>( ty: rustc_middle::ty::Ty<'tcx>, const_value: ConstValue<'tcx>, tables: &mut Tables<'tcx, BridgeTys>, - cx: &SmirCtxt<'tcx, BridgeTys>, + cx: &CompilerCtxt<'tcx, BridgeTys>, ) -> Result { let layout = alloc::create_ty_and_layout(cx, ty).map_err(|e| Error::from_internal(e))?; match const_value { @@ -70,7 +70,7 @@ pub(super) fn allocation_filter<'tcx>( alloc: &rustc_middle::mir::interpret::Allocation, alloc_range: AllocRange, tables: &mut Tables<'tcx, BridgeTys>, - cx: &SmirCtxt<'tcx, BridgeTys>, + cx: &CompilerCtxt<'tcx, BridgeTys>, ) -> Allocation { alloc::allocation_filter(alloc, alloc_range, tables, cx) } diff --git a/compiler/rustc_public/src/compiler_interface.rs b/compiler/rustc_public/src/compiler_interface.rs index d15438c2b800..84c0ea973b7d 100644 --- a/compiler/rustc_public/src/compiler_interface.rs +++ b/compiler/rustc_public/src/compiler_interface.rs @@ -6,7 +6,7 @@ use std::cell::Cell; use rustc_hir::def::DefKind; -use rustc_public_bridge::context::SmirCtxt; +use rustc_public_bridge::context::CompilerCtxt; use rustc_public_bridge::{Bridge, SmirContainer}; use tracing::debug; @@ -66,13 +66,13 @@ impl Bridge for BridgeTys { type Allocation = crate::ty::Allocation; } -/// Stable public API for querying compiler information. +/// Public API for querying compiler information. /// -/// All queries are delegated to [`rustc_public_bridge::context::SmirCtxt`] that provides +/// All queries are delegated to [`rustc_public_bridge::context::CompilerCtxt`] that provides /// similar APIs but based on internal rustc constructs. /// /// Do not use this directly. This is currently used in the macro expansion. -pub(crate) trait SmirInterface { +pub(crate) trait CompilerInterface { fn entry_fn(&self) -> Option; /// Retrieve all items of the local crate that have a MIR associated with them. fn all_local_items(&self) -> CrateItems; @@ -316,7 +316,7 @@ pub(crate) trait SmirInterface { fn associated_items(&self, def_id: DefId) -> AssocItems; } -impl<'tcx> SmirInterface for SmirContainer<'tcx, BridgeTys> { +impl<'tcx> CompilerInterface for SmirContainer<'tcx, BridgeTys> { fn entry_fn(&self) -> Option { let mut tables = self.tables.borrow_mut(); let cx = &*self.cx.borrow(); @@ -1059,10 +1059,10 @@ impl<'tcx> SmirInterface for SmirContainer<'tcx, BridgeTys> { } } -// A thread local variable that stores a pointer to [`SmirInterface`]. +// A thread local variable that stores a pointer to [`CompilerInterface`]. scoped_tls::scoped_thread_local!(static TLV: Cell<*const ()>); -pub(crate) fn run(interface: &dyn SmirInterface, f: F) -> Result +pub(crate) fn run(interface: &dyn CompilerInterface, f: F) -> Result where F: FnOnce() -> T, { @@ -1074,21 +1074,21 @@ where } } -/// Execute the given function with access the [`SmirInterface`]. +/// Execute the given function with access the [`CompilerInterface`]. /// /// I.e., This function will load the current interface and calls a function with it. /// Do not nest these, as that will ICE. -pub(crate) fn with(f: impl FnOnce(&dyn SmirInterface) -> R) -> R { +pub(crate) fn with(f: impl FnOnce(&dyn CompilerInterface) -> R) -> R { assert!(TLV.is_set()); TLV.with(|tlv| { let ptr = tlv.get(); assert!(!ptr.is_null()); - f(unsafe { *(ptr as *const &dyn SmirInterface) }) + f(unsafe { *(ptr as *const &dyn CompilerInterface) }) }) } fn smir_crate<'tcx>( - cx: &SmirCtxt<'tcx, BridgeTys>, + cx: &CompilerCtxt<'tcx, BridgeTys>, crate_num: rustc_span::def_id::CrateNum, ) -> Crate { let name = cx.crate_name(crate_num); diff --git a/compiler/rustc_public/src/lib.rs b/compiler/rustc_public/src/lib.rs index e320c4eca71c..958b3b264788 100644 --- a/compiler/rustc_public/src/lib.rs +++ b/compiler/rustc_public/src/lib.rs @@ -24,7 +24,7 @@ use std::{fmt, io}; pub(crate) use rustc_public_bridge::IndexedVal; use rustc_public_bridge::Tables; -use rustc_public_bridge::context::SmirCtxt; +use rustc_public_bridge::context::CompilerCtxt; /// Export the rustc_internal APIs. Note that this module has no stability /// guarantees and it is not taken into account for semver. #[cfg(feature = "rustc_internal")] @@ -288,7 +288,7 @@ impl rustc_public_bridge::bridge::Allocation align: u64, mutability: rustc_middle::mir::Mutability, tables: &mut Tables<'tcx, compiler_interface::BridgeTys>, - cx: &SmirCtxt<'tcx, compiler_interface::BridgeTys>, + cx: &CompilerCtxt<'tcx, compiler_interface::BridgeTys>, ) -> Self { Self { bytes, diff --git a/compiler/rustc_public/src/rustc_internal/mod.rs b/compiler/rustc_public/src/rustc_internal/mod.rs index 01354fc7bd42..0e1c857e8b13 100644 --- a/compiler/rustc_public/src/rustc_internal/mod.rs +++ b/compiler/rustc_public/src/rustc_internal/mod.rs @@ -6,7 +6,7 @@ use std::cell::{Cell, RefCell}; use rustc_middle::ty::TyCtxt; -use rustc_public_bridge::context::SmirCtxt; +use rustc_public_bridge::context::CompilerCtxt; use rustc_public_bridge::{Bridge, SmirContainer, Tables}; use rustc_span::def_id::CrateNum; use scoped_tls::scoped_thread_local; @@ -72,7 +72,7 @@ where /// Loads the current context and calls a function with it. /// Do not nest these, as that will ICE. pub(crate) fn with_container( - f: impl for<'tcx> FnOnce(&mut Tables<'tcx, B>, &SmirCtxt<'tcx, B>) -> R, + f: impl for<'tcx> FnOnce(&mut Tables<'tcx, B>, &CompilerCtxt<'tcx, B>) -> R, ) -> R { assert!(TLV.is_set()); TLV.with(|tlv| { @@ -89,8 +89,8 @@ pub fn run(tcx: TyCtxt<'_>, f: F) -> Result where F: FnOnce() -> T, { - let smir_cx = RefCell::new(SmirCtxt::new(tcx)); - let container = SmirContainer { tables: RefCell::new(Tables::default()), cx: smir_cx }; + let compiler_cx = RefCell::new(CompilerCtxt::new(tcx)); + let container = SmirContainer { tables: RefCell::new(Tables::default()), cx: compiler_cx }; crate::compiler_interface::run(&container, || init(&container, f)) } diff --git a/compiler/rustc_public/src/unstable/convert/mod.rs b/compiler/rustc_public/src/unstable/convert/mod.rs index 85a71e09c3e7..a2e83c6e2394 100644 --- a/compiler/rustc_public/src/unstable/convert/mod.rs +++ b/compiler/rustc_public/src/unstable/convert/mod.rs @@ -9,7 +9,7 @@ use std::ops::RangeInclusive; use rustc_public_bridge::Tables; -use rustc_public_bridge::context::SmirCtxt; +use rustc_public_bridge::context::CompilerCtxt; use super::Stable; use crate::compiler_interface::BridgeTys; @@ -26,7 +26,7 @@ where fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { (*self).stable(tables, cx) } @@ -41,7 +41,7 @@ where fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { self.as_ref().map(|value| value.stable(tables, cx)) } @@ -57,7 +57,7 @@ where fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { Ok(val) => Ok(val.stable(tables, cx)), @@ -74,7 +74,7 @@ where fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { self.iter().map(|e| e.stable(tables, cx)).collect() } @@ -89,7 +89,7 @@ where fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { (self.0.stable(tables, cx), self.1.stable(tables, cx)) } @@ -103,7 +103,7 @@ where fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { RangeInclusive::new(self.start().stable(tables, cx), self.end().stable(tables, cx)) } diff --git a/compiler/rustc_public/src/unstable/convert/stable/abi.rs b/compiler/rustc_public/src/unstable/convert/stable/abi.rs index 40a8bf614e1f..782e75a930e0 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/abi.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/abi.rs @@ -5,7 +5,7 @@ use rustc_abi::{ArmCall, CanonAbi, InterruptKind, X86Call}; use rustc_middle::ty; use rustc_public_bridge::Tables; -use rustc_public_bridge::context::SmirCtxt; +use rustc_public_bridge::context::CompilerCtxt; use rustc_target::callconv; use crate::abi::{ @@ -21,7 +21,7 @@ use crate::{IndexedVal, opaque}; impl<'tcx> Stable<'tcx> for rustc_abi::VariantIdx { type T = VariantIdx; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { VariantIdx::to_val(self.as_usize()) } } @@ -29,7 +29,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::VariantIdx { impl<'tcx> Stable<'tcx> for rustc_abi::Endian { type T = crate::target::Endian; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { rustc_abi::Endian::Little => crate::target::Endian::Little, rustc_abi::Endian::Big => crate::target::Endian::Big, @@ -43,7 +43,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::TyAndLayout<'tcx, ty::Ty<'tcx>> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { TyAndLayout { ty: self.ty.stable(tables, cx), layout: self.layout.stable(tables, cx) } } @@ -55,7 +55,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::Layout<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { tables.layout_id(cx.lift(*self).unwrap()) } @@ -67,7 +67,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::LayoutData( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { LayoutShape { fields: self.fields.stable(tables, cx), @@ -85,7 +85,7 @@ impl<'tcx> Stable<'tcx> for callconv::FnAbi<'tcx, ty::Ty<'tcx>> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { assert!(self.args.len() >= self.fixed_count as usize); assert!(!self.c_variadic || matches!(self.conv, CanonAbi::C)); @@ -105,7 +105,7 @@ impl<'tcx> Stable<'tcx> for callconv::ArgAbi<'tcx, ty::Ty<'tcx>> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { ArgAbi { ty: self.layout.ty.stable(tables, cx), @@ -118,7 +118,7 @@ impl<'tcx> Stable<'tcx> for callconv::ArgAbi<'tcx, ty::Ty<'tcx>> { impl<'tcx> Stable<'tcx> for CanonAbi { type T = CallConvention; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { CanonAbi::C => CallConvention::C, CanonAbi::Rust => CallConvention::Rust, @@ -154,7 +154,7 @@ impl<'tcx> Stable<'tcx> for CanonAbi { impl<'tcx> Stable<'tcx> for callconv::PassMode { type T = PassMode; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { callconv::PassMode::Ignore => PassMode::Ignore, callconv::PassMode::Direct(attr) => PassMode::Direct(opaque(attr)), @@ -179,7 +179,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::FieldsShape { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { rustc_abi::FieldsShape::Primitive => FieldsShape::Primitive, @@ -200,7 +200,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::Variants( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { rustc_abi::Variants::Single { index } => { @@ -225,7 +225,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::TagEncoding { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { rustc_abi::TagEncoding::Direct => TagEncoding::Direct, @@ -246,7 +246,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::BackendRepr { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match *self { rustc_abi::BackendRepr::Scalar(scalar) => ValueAbi::Scalar(scalar.stable(tables, cx)), @@ -264,7 +264,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::BackendRepr { impl<'tcx> Stable<'tcx> for rustc_abi::Size { type T = Size; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { Size::from_bits(self.bits_usize()) } } @@ -272,7 +272,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::Size { impl<'tcx> Stable<'tcx> for rustc_abi::Align { type T = Align; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { self.bytes() } } @@ -283,7 +283,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::Scalar { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { rustc_abi::Scalar::Initialized { value, valid_range } => Scalar::Initialized { @@ -301,7 +301,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::Primitive { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { rustc_abi::Primitive::Int(length, signed) => { @@ -318,7 +318,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::Primitive { impl<'tcx> Stable<'tcx> for rustc_abi::AddressSpace { type T = AddressSpace; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { AddressSpace(self.0) } } @@ -326,7 +326,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::AddressSpace { impl<'tcx> Stable<'tcx> for rustc_abi::Integer { type T = IntegerLength; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { rustc_abi::Integer::I8 => IntegerLength::I8, rustc_abi::Integer::I16 => IntegerLength::I16, @@ -340,7 +340,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::Integer { impl<'tcx> Stable<'tcx> for rustc_abi::Float { type T = FloatLength; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { rustc_abi::Float::F16 => FloatLength::F16, rustc_abi::Float::F32 => FloatLength::F32, @@ -353,7 +353,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::Float { impl<'tcx> Stable<'tcx> for rustc_abi::WrappingRange { type T = WrappingRange; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { WrappingRange { start: self.start, end: self.end } } } @@ -364,7 +364,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::ReprFlags { fn stable<'cx>( &self, _tables: &mut Tables<'cx, BridgeTys>, - _cx: &SmirCtxt<'cx, BridgeTys>, + _cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { ReprFlags { is_simd: self.intersects(Self::IS_SIMD), @@ -381,7 +381,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::IntegerType { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { rustc_abi::IntegerType::Pointer(signed) => IntegerType::Pointer { is_signed: *signed }, @@ -398,7 +398,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::ReprOptions { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { ReprOptions { int: self.int.map(|int| int.stable(tables, cx)), diff --git a/compiler/rustc_public/src/unstable/convert/stable/mir.rs b/compiler/rustc_public/src/unstable/convert/stable/mir.rs index bd7d48071526..433e7a20f017 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/mir.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/mir.rs @@ -4,7 +4,7 @@ use rustc_middle::mir::mono::MonoItem; use rustc_middle::{bug, mir}; use rustc_public_bridge::Tables; use rustc_public_bridge::bridge::SmirError; -use rustc_public_bridge::context::SmirCtxt; +use rustc_public_bridge::context::CompilerCtxt; use crate::compiler_interface::BridgeTys; use crate::mir::alloc::GlobalAlloc; @@ -19,7 +19,7 @@ impl<'tcx> Stable<'tcx> for mir::Body<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { crate::mir::Body::new( self.basic_blocks @@ -54,7 +54,7 @@ impl<'tcx> Stable<'tcx> for mir::VarDebugInfo<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { crate::mir::VarDebugInfo { name: self.name.to_string(), @@ -71,7 +71,7 @@ impl<'tcx> Stable<'tcx> for mir::Statement<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { Statement { kind: self.kind.stable(tables, cx), @@ -85,7 +85,7 @@ impl<'tcx> Stable<'tcx> for mir::SourceInfo { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { crate::mir::SourceInfo { span: self.span.stable(tables, cx), scope: self.scope.into() } } @@ -96,7 +96,7 @@ impl<'tcx> Stable<'tcx> for mir::VarDebugInfoFragment<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { VarDebugInfoFragment { ty: self.ty.stable(tables, cx), @@ -110,7 +110,7 @@ impl<'tcx> Stable<'tcx> for mir::VarDebugInfoContents<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { mir::VarDebugInfoContents::Place(place) => { @@ -133,7 +133,7 @@ impl<'tcx> Stable<'tcx> for mir::StatementKind<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { mir::StatementKind::Assign(assign) => crate::mir::StatementKind::Assign( @@ -195,7 +195,7 @@ impl<'tcx> Stable<'tcx> for mir::Rvalue<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::mir::Rvalue::*; match self { @@ -259,7 +259,7 @@ impl<'tcx> Stable<'tcx> for mir::Rvalue<'tcx> { impl<'tcx> Stable<'tcx> for mir::Mutability { type T = crate::mir::Mutability; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_hir::Mutability::*; match *self { Not => crate::mir::Mutability::Not, @@ -270,7 +270,7 @@ impl<'tcx> Stable<'tcx> for mir::Mutability { impl<'tcx> Stable<'tcx> for mir::RawPtrKind { type T = crate::mir::RawPtrKind; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use mir::RawPtrKind::*; match *self { Const => crate::mir::RawPtrKind::Const, @@ -285,7 +285,7 @@ impl<'tcx> Stable<'tcx> for mir::BorrowKind { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::mir::BorrowKind::*; match *self { @@ -298,7 +298,7 @@ impl<'tcx> Stable<'tcx> for mir::BorrowKind { impl<'tcx> Stable<'tcx> for mir::MutBorrowKind { type T = crate::mir::MutBorrowKind; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::mir::MutBorrowKind::*; match *self { Default => crate::mir::MutBorrowKind::Default, @@ -310,7 +310,7 @@ impl<'tcx> Stable<'tcx> for mir::MutBorrowKind { impl<'tcx> Stable<'tcx> for mir::FakeBorrowKind { type T = crate::mir::FakeBorrowKind; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::mir::FakeBorrowKind::*; match *self { Deep => crate::mir::FakeBorrowKind::Deep, @@ -324,7 +324,7 @@ impl<'tcx> Stable<'tcx> for mir::NullOp<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::mir::NullOp::*; match self { @@ -344,7 +344,7 @@ impl<'tcx> Stable<'tcx> for mir::CastKind { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::mir::CastKind::*; match self { @@ -364,7 +364,7 @@ impl<'tcx> Stable<'tcx> for mir::CastKind { impl<'tcx> Stable<'tcx> for mir::FakeReadCause { type T = crate::mir::FakeReadCause; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::mir::FakeReadCause::*; match self { ForMatchGuard => crate::mir::FakeReadCause::ForMatchGuard, @@ -383,7 +383,7 @@ impl<'tcx> Stable<'tcx> for mir::Operand<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::mir::Operand::*; match self { @@ -400,7 +400,7 @@ impl<'tcx> Stable<'tcx> for mir::ConstOperand<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { crate::mir::ConstOperand { span: self.span.stable(tables, cx), @@ -415,7 +415,7 @@ impl<'tcx> Stable<'tcx> for mir::Place<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { crate::mir::Place { local: self.local.as_usize(), @@ -429,7 +429,7 @@ impl<'tcx> Stable<'tcx> for mir::PlaceElem<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::mir::ProjectionElem::*; match self { @@ -464,21 +464,21 @@ impl<'tcx> Stable<'tcx> for mir::PlaceElem<'tcx> { impl<'tcx> Stable<'tcx> for mir::UserTypeProjection { type T = crate::mir::UserTypeProjection; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { UserTypeProjection { base: self.base.as_usize(), projection: opaque(&self.projs) } } } impl<'tcx> Stable<'tcx> for mir::Local { type T = crate::mir::Local; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { self.as_usize() } } impl<'tcx> Stable<'tcx> for mir::RetagKind { type T = crate::mir::RetagKind; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::mir::RetagKind; match self { RetagKind::FnEntry => crate::mir::RetagKind::FnEntry, @@ -491,7 +491,7 @@ impl<'tcx> Stable<'tcx> for mir::RetagKind { impl<'tcx> Stable<'tcx> for mir::UnwindAction { type T = crate::mir::UnwindAction; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::mir::UnwindAction; match self { UnwindAction::Continue => crate::mir::UnwindAction::Continue, @@ -508,7 +508,7 @@ impl<'tcx> Stable<'tcx> for mir::NonDivergingIntrinsic<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::mir::NonDivergingIntrinsic; @@ -533,7 +533,7 @@ impl<'tcx> Stable<'tcx> for mir::AssertMessage<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::mir::AssertKind; match self { @@ -580,7 +580,7 @@ impl<'tcx> Stable<'tcx> for mir::AssertMessage<'tcx> { impl<'tcx> Stable<'tcx> for mir::BinOp { type T = crate::mir::BinOp; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::mir::BinOp; match self { BinOp::Add => crate::mir::BinOp::Add, @@ -615,7 +615,7 @@ impl<'tcx> Stable<'tcx> for mir::BinOp { impl<'tcx> Stable<'tcx> for mir::UnOp { type T = crate::mir::UnOp; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::mir::UnOp; match self { UnOp::Not => crate::mir::UnOp::Not, @@ -630,7 +630,7 @@ impl<'tcx> Stable<'tcx> for mir::AggregateKind<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { mir::AggregateKind::Array(ty) => { @@ -676,7 +676,7 @@ impl<'tcx> Stable<'tcx> for mir::InlineAsmOperand<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::mir::InlineAsmOperand; @@ -703,7 +703,7 @@ impl<'tcx> Stable<'tcx> for mir::Terminator<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::mir::Terminator; Terminator { @@ -718,7 +718,7 @@ impl<'tcx> Stable<'tcx> for mir::TerminatorKind<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::mir::TerminatorKind; match self { @@ -807,7 +807,7 @@ impl<'tcx> Stable<'tcx> for mir::interpret::ConstAllocation<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { self.inner().stable(tables, cx) } @@ -819,7 +819,7 @@ impl<'tcx> Stable<'tcx> for mir::interpret::Allocation { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_public_bridge::context::SmirAllocRange; alloc::allocation_filter( @@ -836,7 +836,7 @@ impl<'tcx> Stable<'tcx> for mir::interpret::AllocId { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - _: &SmirCtxt<'cx, BridgeTys>, + _: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { tables.create_alloc_id(*self) } @@ -848,7 +848,7 @@ impl<'tcx> Stable<'tcx> for mir::interpret::GlobalAlloc<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { mir::interpret::GlobalAlloc::Function { instance, .. } => { @@ -877,7 +877,7 @@ impl<'tcx> Stable<'tcx> for rustc_middle::mir::Const<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let id = tables.intern_mir_const(cx.lift(*self).unwrap()); match *self { @@ -913,7 +913,7 @@ impl<'tcx> Stable<'tcx> for rustc_middle::mir::Const<'tcx> { impl<'tcx> Stable<'tcx> for mir::interpret::ErrorHandled { type T = Error; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { Error::new(format!("{self:?}")) } } @@ -924,7 +924,7 @@ impl<'tcx> Stable<'tcx> for MonoItem<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::mir::mono::MonoItem as StableMonoItem; match self { diff --git a/compiler/rustc_public/src/unstable/convert/stable/mod.rs b/compiler/rustc_public/src/unstable/convert/stable/mod.rs index ea78ca50eb3e..add52fc18caa 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/mod.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/mod.rs @@ -2,7 +2,7 @@ use rustc_abi::FieldIdx; use rustc_public_bridge::Tables; -use rustc_public_bridge::context::SmirCtxt; +use rustc_public_bridge::context::CompilerCtxt; use super::Stable; use crate::compiler_interface::BridgeTys; @@ -13,7 +13,7 @@ mod ty; impl<'tcx> Stable<'tcx> for rustc_hir::Safety { type T = crate::mir::Safety; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { rustc_hir::Safety::Unsafe => crate::mir::Safety::Unsafe, rustc_hir::Safety::Safe => crate::mir::Safety::Safe, @@ -23,14 +23,14 @@ impl<'tcx> Stable<'tcx> for rustc_hir::Safety { impl<'tcx> Stable<'tcx> for FieldIdx { type T = usize; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { self.as_usize() } } impl<'tcx> Stable<'tcx> for rustc_hir::CoroutineSource { type T = crate::mir::CoroutineSource; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_hir::CoroutineSource; match self { CoroutineSource::Block => crate::mir::CoroutineSource::Block, @@ -45,7 +45,7 @@ impl<'tcx> Stable<'tcx> for rustc_hir::CoroutineKind { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_hir::{CoroutineDesugaring, CoroutineKind}; match *self { @@ -77,7 +77,7 @@ impl<'tcx> Stable<'tcx> for rustc_hir::CoroutineKind { impl<'tcx> Stable<'tcx> for rustc_span::Symbol { type T = crate::Symbol; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { self.to_string() } } @@ -88,7 +88,7 @@ impl<'tcx> Stable<'tcx> for rustc_span::Span { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - _: &SmirCtxt<'cx, BridgeTys>, + _: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { tables.create_span(*self) } diff --git a/compiler/rustc_public/src/unstable/convert/stable/ty.rs b/compiler/rustc_public/src/unstable/convert/stable/ty.rs index 6b226b8a24d1..d679615b3bdc 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/ty.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/ty.rs @@ -3,7 +3,7 @@ use rustc_middle::ty::Ty; use rustc_middle::{bug, mir, ty}; use rustc_public_bridge::Tables; -use rustc_public_bridge::context::SmirCtxt; +use rustc_public_bridge::context::CompilerCtxt; use crate::alloc; use crate::compiler_interface::BridgeTys; @@ -14,7 +14,7 @@ use crate::unstable::Stable; impl<'tcx> Stable<'tcx> for ty::AliasTyKind { type T = crate::ty::AliasKind; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { ty::Projection => crate::ty::AliasKind::Projection, ty::Inherent => crate::ty::AliasKind::Inherent, @@ -29,7 +29,7 @@ impl<'tcx> Stable<'tcx> for ty::AliasTy<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let ty::AliasTy { args, def_id, .. } = self; crate::ty::AliasTy { def_id: tables.alias_def(*def_id), args: args.stable(tables, cx) } @@ -41,7 +41,7 @@ impl<'tcx> Stable<'tcx> for ty::AliasTerm<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let ty::AliasTerm { args, def_id, .. } = self; crate::ty::AliasTerm { def_id: tables.alias_def(*def_id), args: args.stable(tables, cx) } @@ -51,7 +51,7 @@ impl<'tcx> Stable<'tcx> for ty::AliasTerm<'tcx> { impl<'tcx> Stable<'tcx> for ty::DynKind { type T = crate::ty::DynKind; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { ty::Dyn => crate::ty::DynKind::Dyn, } @@ -64,7 +64,7 @@ impl<'tcx> Stable<'tcx> for ty::ExistentialPredicate<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::ExistentialPredicate::*; match self { @@ -85,7 +85,7 @@ impl<'tcx> Stable<'tcx> for ty::ExistentialTraitRef<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let ty::ExistentialTraitRef { def_id, args, .. } = self; crate::ty::ExistentialTraitRef { @@ -101,7 +101,7 @@ impl<'tcx> Stable<'tcx> for ty::TermKind<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::TermKind; match self { @@ -120,7 +120,7 @@ impl<'tcx> Stable<'tcx> for ty::ExistentialProjection<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let ty::ExistentialProjection { def_id, args, term, .. } = self; crate::ty::ExistentialProjection { @@ -136,7 +136,7 @@ impl<'tcx> Stable<'tcx> for ty::adjustment::PointerCoercion { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::ty::adjustment::PointerCoercion; match self { @@ -154,7 +154,7 @@ impl<'tcx> Stable<'tcx> for ty::adjustment::PointerCoercion { impl<'tcx> Stable<'tcx> for ty::UserTypeAnnotationIndex { type T = usize; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { self.as_usize() } } @@ -162,7 +162,7 @@ impl<'tcx> Stable<'tcx> for ty::UserTypeAnnotationIndex { impl<'tcx> Stable<'tcx> for ty::AdtKind { type T = AdtKind; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { ty::AdtKind::Struct => AdtKind::Struct, ty::AdtKind::Union => AdtKind::Union, @@ -177,7 +177,7 @@ impl<'tcx> Stable<'tcx> for ty::FieldDef { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { crate::ty::FieldDef { def: tables.create_def_id(self.did), @@ -191,7 +191,7 @@ impl<'tcx> Stable<'tcx> for ty::GenericArgs<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { GenericArgs(self.iter().map(|arg| arg.kind().stable(tables, cx)).collect()) } @@ -203,7 +203,7 @@ impl<'tcx> Stable<'tcx> for ty::GenericArgKind<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::GenericArgKind; match self { @@ -225,7 +225,7 @@ where fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::Binder; @@ -249,7 +249,7 @@ where fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::EarlyBinder; @@ -262,7 +262,7 @@ impl<'tcx> Stable<'tcx> for ty::FnSig<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::FnSig; @@ -285,7 +285,7 @@ impl<'tcx> Stable<'tcx> for ty::BoundTyKind { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::BoundTyKind; @@ -304,7 +304,7 @@ impl<'tcx> Stable<'tcx> for ty::BoundRegionKind { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::BoundRegionKind; @@ -326,7 +326,7 @@ impl<'tcx> Stable<'tcx> for ty::BoundVariableKind { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::BoundVariableKind; @@ -345,7 +345,7 @@ impl<'tcx> Stable<'tcx> for ty::BoundVariableKind { impl<'tcx> Stable<'tcx> for ty::IntTy { type T = IntTy; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { ty::IntTy::Isize => IntTy::Isize, ty::IntTy::I8 => IntTy::I8, @@ -360,7 +360,7 @@ impl<'tcx> Stable<'tcx> for ty::IntTy { impl<'tcx> Stable<'tcx> for ty::UintTy { type T = UintTy; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { ty::UintTy::Usize => UintTy::Usize, ty::UintTy::U8 => UintTy::U8, @@ -375,7 +375,7 @@ impl<'tcx> Stable<'tcx> for ty::UintTy { impl<'tcx> Stable<'tcx> for ty::FloatTy { type T = FloatTy; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { ty::FloatTy::F16 => FloatTy::F16, ty::FloatTy::F32 => FloatTy::F32, @@ -390,7 +390,7 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { tables.intern_ty(cx.lift(*self).unwrap()) } @@ -401,7 +401,7 @@ impl<'tcx> Stable<'tcx> for ty::TyKind<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match self { ty::Bool => TyKind::RigidTy(RigidTy::Bool), @@ -487,7 +487,7 @@ impl<'tcx> Stable<'tcx> for ty::Pattern<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { match **self { ty::PatternKind::Range { start, end } => crate::ty::Pattern::Range { @@ -507,7 +507,7 @@ impl<'tcx> Stable<'tcx> for ty::Const<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let ct = cx.lift(*self).unwrap(); let kind = match ct.kind() { @@ -540,7 +540,7 @@ impl<'tcx> Stable<'tcx> for ty::Const<'tcx> { impl<'tcx> Stable<'tcx> for ty::ParamConst { type T = crate::ty::ParamConst; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use crate::ty::ParamConst; ParamConst { index: self.index, name: self.name.to_string() } } @@ -548,7 +548,7 @@ impl<'tcx> Stable<'tcx> for ty::ParamConst { impl<'tcx> Stable<'tcx> for ty::ParamTy { type T = crate::ty::ParamTy; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use crate::ty::ParamTy; ParamTy { index: self.index, name: self.name.to_string() } } @@ -559,7 +559,7 @@ impl<'tcx> Stable<'tcx> for ty::BoundTy { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::BoundTy; BoundTy { var: self.var.as_usize(), kind: self.kind.stable(tables, cx) } @@ -568,7 +568,7 @@ impl<'tcx> Stable<'tcx> for ty::BoundTy { impl<'tcx> Stable<'tcx> for ty::trait_def::TraitSpecializationKind { type T = crate::ty::TraitSpecializationKind; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use crate::ty::TraitSpecializationKind; match self { @@ -586,7 +586,7 @@ impl<'tcx> Stable<'tcx> for ty::TraitDef { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::opaque; use crate::ty::TraitDecl; @@ -616,7 +616,7 @@ impl<'tcx> Stable<'tcx> for ty::TraitRef<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::TraitRef; @@ -630,7 +630,7 @@ impl<'tcx> Stable<'tcx> for ty::Generics { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::Generics; @@ -655,7 +655,7 @@ impl<'tcx> Stable<'tcx> for ty::Generics { impl<'tcx> Stable<'tcx> for rustc_middle::ty::GenericParamDefKind { type T = crate::ty::GenericParamDefKind; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use crate::ty::GenericParamDefKind; match self { ty::GenericParamDefKind::Lifetime => GenericParamDefKind::Lifetime, @@ -675,7 +675,7 @@ impl<'tcx> Stable<'tcx> for rustc_middle::ty::GenericParamDef { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { GenericParamDef { name: self.name.to_string(), @@ -693,7 +693,7 @@ impl<'tcx> Stable<'tcx> for ty::PredicateKind<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::ty::PredicateKind; match self { @@ -731,7 +731,7 @@ impl<'tcx> Stable<'tcx> for ty::ClauseKind<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use rustc_middle::ty::ClauseKind; match *self { @@ -774,7 +774,7 @@ impl<'tcx> Stable<'tcx> for ty::ClauseKind<'tcx> { impl<'tcx> Stable<'tcx> for ty::ClosureKind { type T = crate::ty::ClosureKind; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::ty::ClosureKind::*; match self { Fn => crate::ty::ClosureKind::Fn, @@ -790,7 +790,7 @@ impl<'tcx> Stable<'tcx> for ty::SubtypePredicate<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let ty::SubtypePredicate { a, b, a_is_expected: _ } = self; crate::ty::SubtypePredicate { a: a.stable(tables, cx), b: b.stable(tables, cx) } @@ -803,7 +803,7 @@ impl<'tcx> Stable<'tcx> for ty::CoercePredicate<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let ty::CoercePredicate { a, b } = self; crate::ty::CoercePredicate { a: a.stable(tables, cx), b: b.stable(tables, cx) } @@ -813,7 +813,7 @@ impl<'tcx> Stable<'tcx> for ty::CoercePredicate<'tcx> { impl<'tcx> Stable<'tcx> for ty::AliasRelationDirection { type T = crate::ty::AliasRelationDirection; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::ty::AliasRelationDirection::*; match self { Equate => crate::ty::AliasRelationDirection::Equate, @@ -828,7 +828,7 @@ impl<'tcx> Stable<'tcx> for ty::TraitPredicate<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let ty::TraitPredicate { trait_ref, polarity } = self; crate::ty::TraitPredicate { @@ -847,7 +847,7 @@ where fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let ty::OutlivesPredicate(a, b) = self; crate::ty::OutlivesPredicate(a.stable(tables, cx), b.stable(tables, cx)) @@ -860,7 +860,7 @@ impl<'tcx> Stable<'tcx> for ty::ProjectionPredicate<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let ty::ProjectionPredicate { projection_term, term } = self; crate::ty::ProjectionPredicate { @@ -873,7 +873,7 @@ impl<'tcx> Stable<'tcx> for ty::ProjectionPredicate<'tcx> { impl<'tcx> Stable<'tcx> for ty::ImplPolarity { type T = crate::ty::ImplPolarity; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::ty::ImplPolarity::*; match self { Positive => crate::ty::ImplPolarity::Positive, @@ -886,7 +886,7 @@ impl<'tcx> Stable<'tcx> for ty::ImplPolarity { impl<'tcx> Stable<'tcx> for ty::PredicatePolarity { type T = crate::ty::PredicatePolarity; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_middle::ty::PredicatePolarity::*; match self { Positive => crate::ty::PredicatePolarity::Positive, @@ -901,7 +901,7 @@ impl<'tcx> Stable<'tcx> for ty::Region<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { Region { kind: self.kind().stable(tables, cx) } } @@ -913,7 +913,7 @@ impl<'tcx> Stable<'tcx> for ty::RegionKind<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::{BoundRegion, EarlyParamRegion, RegionKind}; match self { @@ -948,7 +948,7 @@ impl<'tcx> Stable<'tcx> for ty::Instance<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { let def = tables.instance_def(cx.lift(*self).unwrap()); let kind = match self.def { @@ -976,7 +976,7 @@ impl<'tcx> Stable<'tcx> for ty::Instance<'tcx> { impl<'tcx> Stable<'tcx> for ty::Variance { type T = crate::mir::Variance; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { ty::Bivariant => crate::mir::Variance::Bivariant, ty::Contravariant => crate::mir::Variance::Contravariant, @@ -989,7 +989,7 @@ impl<'tcx> Stable<'tcx> for ty::Variance { impl<'tcx> Stable<'tcx> for ty::Movability { type T = crate::ty::Movability; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { match self { ty::Movability::Static => crate::ty::Movability::Static, ty::Movability::Movable => crate::ty::Movability::Movable, @@ -1000,7 +1000,7 @@ impl<'tcx> Stable<'tcx> for ty::Movability { impl<'tcx> Stable<'tcx> for rustc_abi::ExternAbi { type T = crate::ty::Abi; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use rustc_abi::ExternAbi; use crate::ty::Abi; @@ -1042,7 +1042,7 @@ impl<'tcx> Stable<'tcx> for rustc_session::cstore::ForeignModule { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { crate::ty::ForeignModule { def_id: tables.foreign_module_def(self.def_id), @@ -1057,7 +1057,7 @@ impl<'tcx> Stable<'tcx> for ty::AssocKind { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::{AssocKind, AssocTypeData}; match *self { @@ -1080,7 +1080,7 @@ impl<'tcx> Stable<'tcx> for ty::AssocKind { impl<'tcx> Stable<'tcx> for ty::AssocItemContainer { type T = crate::ty::AssocItemContainer; - fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &SmirCtxt<'_, BridgeTys>) -> Self::T { + fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { use crate::ty::AssocItemContainer; match self { ty::AssocItemContainer::Trait => AssocItemContainer::Trait, @@ -1095,7 +1095,7 @@ impl<'tcx> Stable<'tcx> for ty::AssocItem { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { crate::ty::AssocItem { def_id: tables.assoc_def(self.def_id), @@ -1112,7 +1112,7 @@ impl<'tcx> Stable<'tcx> for ty::ImplTraitInTraitData { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - _: &SmirCtxt<'cx, BridgeTys>, + _: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { use crate::ty::ImplTraitInTraitData; match self { @@ -1135,7 +1135,7 @@ impl<'tcx> Stable<'tcx> for rustc_middle::ty::util::Discr<'tcx> { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { crate::ty::Discr { val: self.val, ty: self.ty.stable(tables, cx) } } diff --git a/compiler/rustc_public/src/unstable/mod.rs b/compiler/rustc_public/src/unstable/mod.rs index ce7c41a64fa0..ca154a3378a7 100644 --- a/compiler/rustc_public/src/unstable/mod.rs +++ b/compiler/rustc_public/src/unstable/mod.rs @@ -10,7 +10,7 @@ use rustc_hir::def::DefKind; use rustc_middle::ty::{List, Ty, TyCtxt}; use rustc_middle::{mir, ty}; use rustc_public_bridge::Tables; -use rustc_public_bridge::context::SmirCtxt; +use rustc_public_bridge::context::CompilerCtxt; use super::compiler_interface::BridgeTys; use crate::{CtorKind, ItemKind}; @@ -21,7 +21,7 @@ mod internal_cx; /// Trait that defines the methods that are fine to call from [`RustcInternal`]. /// /// This trait is only for [`RustcInternal`]. Any other other access to rustc's internals -/// should go through [`rustc_public_bridge::context::SmirCtxt`]. +/// should go through [`rustc_public_bridge::context::CompilerCtxt`]. pub trait InternalCx<'tcx>: Copy + Clone { fn tcx(self) -> TyCtxt<'tcx>; @@ -66,7 +66,7 @@ pub trait Stable<'tcx>: PointeeSized { fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, - cx: &SmirCtxt<'cx, BridgeTys>, + cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T; } diff --git a/compiler/rustc_public_bridge/src/alloc.rs b/compiler/rustc_public_bridge/src/alloc.rs index 23bbaddce06d..906e4aae9f26 100644 --- a/compiler/rustc_public_bridge/src/alloc.rs +++ b/compiler/rustc_public_bridge/src/alloc.rs @@ -10,12 +10,12 @@ use rustc_middle::mir::interpret::{ }; use rustc_middle::ty::{Ty, layout}; -use super::{SmirCtxt, Tables}; +use super::{CompilerCtxt, Tables}; use crate::bridge::Allocation as _; use crate::{Bridge, SmirError}; pub fn create_ty_and_layout<'tcx, B: Bridge>( - cx: &SmirCtxt<'tcx, B>, + cx: &CompilerCtxt<'tcx, B>, ty: Ty<'tcx>, ) -> Result>, &'tcx layout::LayoutError<'tcx>> { use crate::context::SmirTypingEnv; @@ -25,7 +25,7 @@ pub fn create_ty_and_layout<'tcx, B: Bridge>( pub fn try_new_scalar<'tcx, B: Bridge>( layout: TyAndLayout<'tcx, Ty<'tcx>>, scalar: Scalar, - cx: &SmirCtxt<'tcx, B>, + cx: &CompilerCtxt<'tcx, B>, ) -> Result { let size = scalar.size(); let mut allocation = Allocation::new(size, layout.align.abi, AllocInit::Uninit, ()); @@ -40,7 +40,7 @@ pub fn try_new_slice<'tcx, B: Bridge>( layout: TyAndLayout<'tcx, Ty<'tcx>>, data: ConstAllocation<'tcx>, meta: u64, - cx: &SmirCtxt<'tcx, B>, + cx: &CompilerCtxt<'tcx, B>, ) -> Result { let alloc_id = cx.tcx.reserve_and_set_memory_alloc(data); let ptr = Pointer::new(alloc_id.into(), Size::ZERO); @@ -60,7 +60,7 @@ pub fn try_new_slice<'tcx, B: Bridge>( pub fn try_new_indirect<'tcx, B: Bridge>( alloc_id: AllocId, - cx: &SmirCtxt<'tcx, B>, + cx: &CompilerCtxt<'tcx, B>, ) -> ConstAllocation<'tcx> { let alloc = cx.tcx.global_alloc(alloc_id).unwrap_memory(); @@ -72,7 +72,7 @@ pub fn allocation_filter<'tcx, B: Bridge>( alloc: &rustc_middle::mir::interpret::Allocation, alloc_range: AllocRange, tables: &mut Tables<'tcx, B>, - cx: &SmirCtxt<'tcx, B>, + cx: &CompilerCtxt<'tcx, B>, ) -> B::Allocation { let mut bytes: Vec> = alloc .inspect_with_uninit_and_ptr_outside_interpreter( diff --git a/compiler/rustc_public_bridge/src/bridge.rs b/compiler/rustc_public_bridge/src/bridge.rs index 379a8da5df9d..675bb2d8bc33 100644 --- a/compiler/rustc_public_bridge/src/bridge.rs +++ b/compiler/rustc_public_bridge/src/bridge.rs @@ -6,7 +6,7 @@ use std::fmt::Debug; -use super::context::SmirCtxt; +use super::context::CompilerCtxt; use super::{Bridge, Tables}; pub trait SmirError { @@ -25,7 +25,7 @@ pub trait Allocation { align: u64, mutability: rustc_middle::mir::Mutability, tables: &mut Tables<'tcx, B>, - cx: &SmirCtxt<'tcx, B>, + cx: &CompilerCtxt<'tcx, B>, ) -> Self; } diff --git a/compiler/rustc_public_bridge/src/context/impls.rs b/compiler/rustc_public_bridge/src/context/impls.rs index fdefad2821bb..268aa6927d28 100644 --- a/compiler/rustc_public_bridge/src/context/impls.rs +++ b/compiler/rustc_public_bridge/src/context/impls.rs @@ -24,23 +24,23 @@ use rustc_span::def_id::{CrateNum, DefId, LOCAL_CRATE}; use rustc_span::{FileNameDisplayPreference, Span, Symbol}; use rustc_target::callconv::FnAbi; -use super::{SmirAllocRange, SmirCtxt, SmirTy, SmirTypingEnv}; +use super::{SmirAllocRange, CompilerCtxt, SmirTy, SmirTypingEnv}; use crate::builder::BodyBuilder; use crate::{Bridge, SmirError, Tables, filter_def_ids}; -impl<'tcx, B: Bridge> SmirTy<'tcx> for SmirCtxt<'tcx, B> { +impl<'tcx, B: Bridge> SmirTy<'tcx> for CompilerCtxt<'tcx, B> { fn new_foreign(&self, def_id: DefId) -> ty::Ty<'tcx> { ty::Ty::new_foreign(self.tcx, def_id) } } -impl<'tcx, B: Bridge> SmirTypingEnv<'tcx> for SmirCtxt<'tcx, B> { +impl<'tcx, B: Bridge> SmirTypingEnv<'tcx> for CompilerCtxt<'tcx, B> { fn fully_monomorphized(&self) -> ty::TypingEnv<'tcx> { ty::TypingEnv::fully_monomorphized() } } -impl<'tcx, B: Bridge> SmirAllocRange<'tcx> for SmirCtxt<'tcx, B> { +impl<'tcx, B: Bridge> SmirAllocRange<'tcx> for CompilerCtxt<'tcx, B> { fn alloc_range( &self, offset: rustc_abi::Size, @@ -50,7 +50,7 @@ impl<'tcx, B: Bridge> SmirAllocRange<'tcx> for SmirCtxt<'tcx, B> { } } -impl<'tcx, B: Bridge> SmirCtxt<'tcx, B> { +impl<'tcx, B: Bridge> CompilerCtxt<'tcx, B> { pub fn lift>>(&self, value: T) -> Option { self.tcx.lift(value) } diff --git a/compiler/rustc_public_bridge/src/context/mod.rs b/compiler/rustc_public_bridge/src/context/mod.rs index da20be2a4b3a..d2fbf976a24f 100644 --- a/compiler/rustc_public_bridge/src/context/mod.rs +++ b/compiler/rustc_public_bridge/src/context/mod.rs @@ -18,21 +18,21 @@ pub use traits::*; /// Provides direct access to rustc's internal queries. /// -/// `SmirInterface` must go through +/// `CompilerInterface` must go through /// this context to obtain rustc-level information. -pub struct SmirCtxt<'tcx, B: Bridge> { +pub struct CompilerCtxt<'tcx, B: Bridge> { pub tcx: TyCtxt<'tcx>, _marker: PhantomData, } -impl<'tcx, B: Bridge> SmirCtxt<'tcx, B> { +impl<'tcx, B: Bridge> CompilerCtxt<'tcx, B> { pub fn new(tcx: TyCtxt<'tcx>) -> Self { Self { tcx, _marker: Default::default() } } } /// Implement error handling for extracting function ABI information. -impl<'tcx, B: Bridge> FnAbiOfHelpers<'tcx> for SmirCtxt<'tcx, B> { +impl<'tcx, B: Bridge> FnAbiOfHelpers<'tcx> for CompilerCtxt<'tcx, B> { type FnAbiOfResult = Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, B::Error>; #[inline] @@ -46,7 +46,7 @@ impl<'tcx, B: Bridge> FnAbiOfHelpers<'tcx> for SmirCtxt<'tcx, B> { } } -impl<'tcx, B: Bridge> LayoutOfHelpers<'tcx> for SmirCtxt<'tcx, B> { +impl<'tcx, B: Bridge> LayoutOfHelpers<'tcx> for CompilerCtxt<'tcx, B> { type LayoutOfResult = Result, B::Error>; #[inline] @@ -60,19 +60,19 @@ impl<'tcx, B: Bridge> LayoutOfHelpers<'tcx> for SmirCtxt<'tcx, B> { } } -impl<'tcx, B: Bridge> HasTypingEnv<'tcx> for SmirCtxt<'tcx, B> { +impl<'tcx, B: Bridge> HasTypingEnv<'tcx> for CompilerCtxt<'tcx, B> { fn typing_env(&self) -> ty::TypingEnv<'tcx> { ty::TypingEnv::fully_monomorphized() } } -impl<'tcx, B: Bridge> HasTyCtxt<'tcx> for SmirCtxt<'tcx, B> { +impl<'tcx, B: Bridge> HasTyCtxt<'tcx> for CompilerCtxt<'tcx, B> { fn tcx(&self) -> TyCtxt<'tcx> { self.tcx } } -impl<'tcx, B: Bridge> HasDataLayout for SmirCtxt<'tcx, B> { +impl<'tcx, B: Bridge> HasDataLayout for CompilerCtxt<'tcx, B> { fn data_layout(&self) -> &rustc_abi::TargetDataLayout { self.tcx.data_layout() } diff --git a/compiler/rustc_public_bridge/src/lib.rs b/compiler/rustc_public_bridge/src/lib.rs index 652a8093a879..7f58430ea497 100644 --- a/compiler/rustc_public_bridge/src/lib.rs +++ b/compiler/rustc_public_bridge/src/lib.rs @@ -29,7 +29,7 @@ use std::hash::Hash; use std::ops::Index; use bridge::*; -use context::SmirCtxt; +use context::CompilerCtxt; use rustc_data_structures::fx::{self, FxIndexMap}; use rustc_middle::mir; use rustc_middle::mir::interpret::AllocId; @@ -48,7 +48,7 @@ pub mod rustc_internal {} /// A container which is used for TLS. pub struct SmirContainer<'tcx, B: Bridge> { pub tables: RefCell>, - pub cx: RefCell>, + pub cx: RefCell>, } pub struct Tables<'tcx, B: Bridge> { From 7f22e88fab428181401b0c9d3aaf972784a65383 Mon Sep 17 00:00:00 2001 From: Makai Date: Tue, 15 Jul 2025 13:21:41 +0000 Subject: [PATCH 073/183] `SmirContainer` to `Container` --- compiler/rustc_public/src/compiler_interface.rs | 4 ++-- compiler/rustc_public/src/rustc_internal/mod.rs | 8 ++++---- compiler/rustc_public_bridge/src/lib.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_public/src/compiler_interface.rs b/compiler/rustc_public/src/compiler_interface.rs index 84c0ea973b7d..1e7a4223f3f5 100644 --- a/compiler/rustc_public/src/compiler_interface.rs +++ b/compiler/rustc_public/src/compiler_interface.rs @@ -7,7 +7,7 @@ use std::cell::Cell; use rustc_hir::def::DefKind; use rustc_public_bridge::context::CompilerCtxt; -use rustc_public_bridge::{Bridge, SmirContainer}; +use rustc_public_bridge::{Bridge, Container}; use tracing::debug; use crate::abi::{FnAbi, Layout, LayoutShape, ReprOptions}; @@ -316,7 +316,7 @@ pub(crate) trait CompilerInterface { fn associated_items(&self, def_id: DefId) -> AssocItems; } -impl<'tcx> CompilerInterface for SmirContainer<'tcx, BridgeTys> { +impl<'tcx> CompilerInterface for Container<'tcx, BridgeTys> { fn entry_fn(&self) -> Option { let mut tables = self.tables.borrow_mut(); let cx = &*self.cx.borrow(); diff --git a/compiler/rustc_public/src/rustc_internal/mod.rs b/compiler/rustc_public/src/rustc_internal/mod.rs index 0e1c857e8b13..ca999b62f807 100644 --- a/compiler/rustc_public/src/rustc_internal/mod.rs +++ b/compiler/rustc_public/src/rustc_internal/mod.rs @@ -7,7 +7,7 @@ use std::cell::{Cell, RefCell}; use rustc_middle::ty::TyCtxt; use rustc_public_bridge::context::CompilerCtxt; -use rustc_public_bridge::{Bridge, SmirContainer, Tables}; +use rustc_public_bridge::{Bridge, Container, Tables}; use rustc_span::def_id::CrateNum; use scoped_tls::scoped_thread_local; @@ -60,7 +60,7 @@ pub fn crate_num(item: &crate::Crate) -> CrateNum { // datastructures and stable MIR datastructures scoped_thread_local! (static TLV: Cell<*const ()>); -pub(crate) fn init<'tcx, F, T, B: Bridge>(container: &SmirContainer<'tcx, B>, f: F) -> T +pub(crate) fn init<'tcx, F, T, B: Bridge>(container: &Container<'tcx, B>, f: F) -> T where F: FnOnce() -> T, { @@ -78,7 +78,7 @@ pub(crate) fn with_container( TLV.with(|tlv| { let ptr = tlv.get(); assert!(!ptr.is_null()); - let container = ptr as *const SmirContainer<'_, B>; + let container = ptr as *const Container<'_, B>; let mut tables = unsafe { (*container).tables.borrow_mut() }; let cx = unsafe { (*container).cx.borrow() }; f(&mut *tables, &*cx) @@ -90,7 +90,7 @@ where F: FnOnce() -> T, { let compiler_cx = RefCell::new(CompilerCtxt::new(tcx)); - let container = SmirContainer { tables: RefCell::new(Tables::default()), cx: compiler_cx }; + let container = Container { tables: RefCell::new(Tables::default()), cx: compiler_cx }; crate::compiler_interface::run(&container, || init(&container, f)) } diff --git a/compiler/rustc_public_bridge/src/lib.rs b/compiler/rustc_public_bridge/src/lib.rs index 7f58430ea497..2bb259a857c0 100644 --- a/compiler/rustc_public_bridge/src/lib.rs +++ b/compiler/rustc_public_bridge/src/lib.rs @@ -46,7 +46,7 @@ pub mod context; pub mod rustc_internal {} /// A container which is used for TLS. -pub struct SmirContainer<'tcx, B: Bridge> { +pub struct Container<'tcx, B: Bridge> { pub tables: RefCell>, pub cx: RefCell>, } From ad0de062b50e521bd1ea100921d25021ab90b1e5 Mon Sep 17 00:00:00 2001 From: Makai Date: Tue, 15 Jul 2025 13:51:55 +0000 Subject: [PATCH 074/183] use "helper" as a more descriptive name --- compiler/rustc_public/src/alloc.rs | 2 +- compiler/rustc_public/src/compiler_interface.rs | 2 +- compiler/rustc_public/src/unstable/convert/internal.rs | 6 +++--- .../rustc_public/src/unstable/convert/stable/mir.rs | 2 +- .../src/unstable/internal_cx/{traits.rs => helpers.rs} | 6 +++--- compiler/rustc_public/src/unstable/internal_cx/mod.rs | 10 +++++----- compiler/rustc_public_bridge/src/alloc.rs | 2 +- .../src/context/{traits.rs => helpers.rs} | 8 ++++---- compiler/rustc_public_bridge/src/context/impls.rs | 10 +++++----- compiler/rustc_public_bridge/src/context/mod.rs | 4 ++-- 10 files changed, 26 insertions(+), 26 deletions(-) rename compiler/rustc_public/src/unstable/internal_cx/{traits.rs => helpers.rs} (83%) rename compiler/rustc_public_bridge/src/context/{traits.rs => helpers.rs} (71%) diff --git a/compiler/rustc_public/src/alloc.rs b/compiler/rustc_public/src/alloc.rs index f2cb8a900a65..cb6cc37e8298 100644 --- a/compiler/rustc_public/src/alloc.rs +++ b/compiler/rustc_public/src/alloc.rs @@ -59,7 +59,7 @@ pub(crate) fn try_new_allocation<'tcx>( } ConstValue::Indirect { alloc_id, offset } => { let alloc = alloc::try_new_indirect(alloc_id, cx); - use rustc_public_bridge::context::SmirAllocRange; + use rustc_public_bridge::context::AllocRangeHelpers; Ok(allocation_filter(&alloc.0, cx.alloc_range(offset, layout.size), tables, cx)) } } diff --git a/compiler/rustc_public/src/compiler_interface.rs b/compiler/rustc_public/src/compiler_interface.rs index 1e7a4223f3f5..043064951d5d 100644 --- a/compiler/rustc_public/src/compiler_interface.rs +++ b/compiler/rustc_public/src/compiler_interface.rs @@ -567,7 +567,7 @@ impl<'tcx> CompilerInterface for Container<'tcx, BridgeTys> { DefKind::Fn => ForeignItemKind::Fn(tables.fn_def(def_id)), DefKind::Static { .. } => ForeignItemKind::Static(tables.static_def(def_id)), DefKind::ForeignTy => { - use rustc_public_bridge::context::SmirTy; + use rustc_public_bridge::context::TyHelpers; ForeignItemKind::Type(tables.intern_ty(cx.new_foreign(def_id))) } def_kind => unreachable!("Unexpected kind for a foreign item: {:?}", def_kind), diff --git a/compiler/rustc_public/src/unstable/convert/internal.rs b/compiler/rustc_public/src/unstable/convert/internal.rs index 8a6238413b08..0571a03b62bb 100644 --- a/compiler/rustc_public/src/unstable/convert/internal.rs +++ b/compiler/rustc_public/src/unstable/convert/internal.rs @@ -504,7 +504,7 @@ impl RustcInternal for ExistentialProjection { tables: &mut Tables<'_, BridgeTys>, tcx: impl InternalCx<'tcx>, ) -> Self::T<'tcx> { - use crate::unstable::internal_cx::SmirExistentialProjection; + use crate::unstable::internal_cx::ExistentialProjectionHelpers; tcx.new_from_args( self.def_id.0.internal(tables, tcx), self.generic_args.internal(tables, tcx), @@ -536,7 +536,7 @@ impl RustcInternal for ExistentialTraitRef { tables: &mut Tables<'_, BridgeTys>, tcx: impl InternalCx<'tcx>, ) -> Self::T<'tcx> { - use crate::unstable::internal_cx::SmirExistentialTraitRef; + use crate::unstable::internal_cx::ExistentialTraitRefHelpers; tcx.new_from_args( self.def_id.0.internal(tables, tcx), self.generic_args.internal(tables, tcx), @@ -552,7 +552,7 @@ impl RustcInternal for TraitRef { tables: &mut Tables<'_, BridgeTys>, tcx: impl InternalCx<'tcx>, ) -> Self::T<'tcx> { - use crate::unstable::internal_cx::SmirTraitRef; + use crate::unstable::internal_cx::TraitRefHelpers; tcx.new_from_args(self.def_id.0.internal(tables, tcx), self.args().internal(tables, tcx)) } } diff --git a/compiler/rustc_public/src/unstable/convert/stable/mir.rs b/compiler/rustc_public/src/unstable/convert/stable/mir.rs index 433e7a20f017..cb68129c6606 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/mir.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/mir.rs @@ -821,7 +821,7 @@ impl<'tcx> Stable<'tcx> for mir::interpret::Allocation { tables: &mut Tables<'cx, BridgeTys>, cx: &CompilerCtxt<'cx, BridgeTys>, ) -> Self::T { - use rustc_public_bridge::context::SmirAllocRange; + use rustc_public_bridge::context::AllocRangeHelpers; alloc::allocation_filter( self, cx.alloc_range(rustc_abi::Size::ZERO, self.size()), diff --git a/compiler/rustc_public/src/unstable/internal_cx/traits.rs b/compiler/rustc_public/src/unstable/internal_cx/helpers.rs similarity index 83% rename from compiler/rustc_public/src/unstable/internal_cx/traits.rs rename to compiler/rustc_public/src/unstable/internal_cx/helpers.rs index da443cd78f18..da635c04d744 100644 --- a/compiler/rustc_public/src/unstable/internal_cx/traits.rs +++ b/compiler/rustc_public/src/unstable/internal_cx/helpers.rs @@ -5,7 +5,7 @@ use rustc_middle::ty; -pub(crate) trait SmirExistentialProjection<'tcx> { +pub(crate) trait ExistentialProjectionHelpers<'tcx> { fn new_from_args( &self, def_id: rustc_span::def_id::DefId, @@ -14,7 +14,7 @@ pub(crate) trait SmirExistentialProjection<'tcx> { ) -> ty::ExistentialProjection<'tcx>; } -pub(crate) trait SmirExistentialTraitRef<'tcx> { +pub(crate) trait ExistentialTraitRefHelpers<'tcx> { fn new_from_args( &self, trait_def_id: rustc_span::def_id::DefId, @@ -22,7 +22,7 @@ pub(crate) trait SmirExistentialTraitRef<'tcx> { ) -> ty::ExistentialTraitRef<'tcx>; } -pub(crate) trait SmirTraitRef<'tcx> { +pub(crate) trait TraitRefHelpers<'tcx> { fn new_from_args( &self, trait_def_id: rustc_span::def_id::DefId, diff --git a/compiler/rustc_public/src/unstable/internal_cx/mod.rs b/compiler/rustc_public/src/unstable/internal_cx/mod.rs index 6b0a06e304cf..44fbfde87755 100644 --- a/compiler/rustc_public/src/unstable/internal_cx/mod.rs +++ b/compiler/rustc_public/src/unstable/internal_cx/mod.rs @@ -2,13 +2,13 @@ use rustc_middle::ty::{List, Ty, TyCtxt}; use rustc_middle::{mir, ty}; -pub(crate) use traits::*; +pub(crate) use helpers::*; use super::InternalCx; -pub(crate) mod traits; +pub(crate) mod helpers; -impl<'tcx, T: InternalCx<'tcx>> SmirExistentialProjection<'tcx> for T { +impl<'tcx, T: InternalCx<'tcx>> ExistentialProjectionHelpers<'tcx> for T { fn new_from_args( &self, def_id: rustc_span::def_id::DefId, @@ -19,7 +19,7 @@ impl<'tcx, T: InternalCx<'tcx>> SmirExistentialProjection<'tcx> for T { } } -impl<'tcx, T: InternalCx<'tcx>> SmirExistentialTraitRef<'tcx> for T { +impl<'tcx, T: InternalCx<'tcx>> ExistentialTraitRefHelpers<'tcx> for T { fn new_from_args( &self, trait_def_id: rustc_span::def_id::DefId, @@ -29,7 +29,7 @@ impl<'tcx, T: InternalCx<'tcx>> SmirExistentialTraitRef<'tcx> for T { } } -impl<'tcx, T: InternalCx<'tcx>> SmirTraitRef<'tcx> for T { +impl<'tcx, T: InternalCx<'tcx>> TraitRefHelpers<'tcx> for T { fn new_from_args( &self, trait_def_id: rustc_span::def_id::DefId, diff --git a/compiler/rustc_public_bridge/src/alloc.rs b/compiler/rustc_public_bridge/src/alloc.rs index 906e4aae9f26..c866b05e6cf2 100644 --- a/compiler/rustc_public_bridge/src/alloc.rs +++ b/compiler/rustc_public_bridge/src/alloc.rs @@ -18,7 +18,7 @@ pub fn create_ty_and_layout<'tcx, B: Bridge>( cx: &CompilerCtxt<'tcx, B>, ty: Ty<'tcx>, ) -> Result>, &'tcx layout::LayoutError<'tcx>> { - use crate::context::SmirTypingEnv; + use crate::context::TypingEnvHelpers; cx.tcx.layout_of(cx.fully_monomorphized().as_query_input(ty)) } diff --git a/compiler/rustc_public_bridge/src/context/traits.rs b/compiler/rustc_public_bridge/src/context/helpers.rs similarity index 71% rename from compiler/rustc_public_bridge/src/context/traits.rs rename to compiler/rustc_public_bridge/src/context/helpers.rs index 8483bee4aadc..21eef29e5f1c 100644 --- a/compiler/rustc_public_bridge/src/context/traits.rs +++ b/compiler/rustc_public_bridge/src/context/helpers.rs @@ -1,6 +1,6 @@ //! A set of traits that define a stable interface to rustc's internals. //! -//! These traits abstract rustc's internal APIs, allowing StableMIR to maintain a stable +//! These traits abstract rustc's internal APIs, allowing rustc_public to maintain a stable //! interface regardless of internal compiler changes. use rustc_middle::mir::interpret::AllocRange; @@ -8,14 +8,14 @@ use rustc_middle::ty; use rustc_middle::ty::Ty; use rustc_span::def_id::DefId; -pub trait SmirTy<'tcx> { +pub trait TyHelpers<'tcx> { fn new_foreign(&self, def_id: DefId) -> Ty<'tcx>; } -pub trait SmirTypingEnv<'tcx> { +pub trait TypingEnvHelpers<'tcx> { fn fully_monomorphized(&self) -> ty::TypingEnv<'tcx>; } -pub trait SmirAllocRange<'tcx> { +pub trait AllocRangeHelpers<'tcx> { fn alloc_range(&self, offset: rustc_abi::Size, size: rustc_abi::Size) -> AllocRange; } diff --git a/compiler/rustc_public_bridge/src/context/impls.rs b/compiler/rustc_public_bridge/src/context/impls.rs index 268aa6927d28..8079fc95f97d 100644 --- a/compiler/rustc_public_bridge/src/context/impls.rs +++ b/compiler/rustc_public_bridge/src/context/impls.rs @@ -24,23 +24,23 @@ use rustc_span::def_id::{CrateNum, DefId, LOCAL_CRATE}; use rustc_span::{FileNameDisplayPreference, Span, Symbol}; use rustc_target::callconv::FnAbi; -use super::{SmirAllocRange, CompilerCtxt, SmirTy, SmirTypingEnv}; +use super::{AllocRangeHelpers, CompilerCtxt, TyHelpers, TypingEnvHelpers}; use crate::builder::BodyBuilder; use crate::{Bridge, SmirError, Tables, filter_def_ids}; -impl<'tcx, B: Bridge> SmirTy<'tcx> for CompilerCtxt<'tcx, B> { +impl<'tcx, B: Bridge> TyHelpers<'tcx> for CompilerCtxt<'tcx, B> { fn new_foreign(&self, def_id: DefId) -> ty::Ty<'tcx> { ty::Ty::new_foreign(self.tcx, def_id) } } -impl<'tcx, B: Bridge> SmirTypingEnv<'tcx> for CompilerCtxt<'tcx, B> { +impl<'tcx, B: Bridge> TypingEnvHelpers<'tcx> for CompilerCtxt<'tcx, B> { fn fully_monomorphized(&self) -> ty::TypingEnv<'tcx> { ty::TypingEnv::fully_monomorphized() } } -impl<'tcx, B: Bridge> SmirAllocRange<'tcx> for CompilerCtxt<'tcx, B> { +impl<'tcx, B: Bridge> AllocRangeHelpers<'tcx> for CompilerCtxt<'tcx, B> { fn alloc_range( &self, offset: rustc_abi::Size, @@ -426,7 +426,7 @@ impl<'tcx, B: Bridge> CompilerCtxt<'tcx, B> { /// Evaluate constant as a target usize. pub fn eval_target_usize(&self, cnst: MirConst<'tcx>) -> Result { - use crate::context::SmirTypingEnv; + use crate::context::TypingEnvHelpers; cnst.try_eval_target_usize(self.tcx, self.fully_monomorphized()) .ok_or_else(|| B::Error::new(format!("Const `{cnst:?}` cannot be encoded as u64"))) } diff --git a/compiler/rustc_public_bridge/src/context/mod.rs b/compiler/rustc_public_bridge/src/context/mod.rs index d2fbf976a24f..3aa5c33c57db 100644 --- a/compiler/rustc_public_bridge/src/context/mod.rs +++ b/compiler/rustc_public_bridge/src/context/mod.rs @@ -12,9 +12,9 @@ use rustc_middle::ty::{Ty, TyCtxt}; use crate::{Bridge, SmirError}; mod impls; -mod traits; +mod helpers; -pub use traits::*; +pub use helpers::*; /// Provides direct access to rustc's internal queries. /// From 08e3cf511819ecc058230ccf2dd4a8e4f55625e1 Mon Sep 17 00:00:00 2001 From: Makai Date: Tue, 15 Jul 2025 13:53:51 +0000 Subject: [PATCH 075/183] rename `ui-fulldeps/stable-mir` --- tests/ui-fulldeps/{stable-mir => rustc_public}/check_abi.rs | 0 .../ui-fulldeps/{stable-mir => rustc_public}/check_allocation.rs | 0 .../ui-fulldeps/{stable-mir => rustc_public}/check_assoc_items.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/check_attribute.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/check_binop.rs | 0 .../{stable-mir => rustc_public}/check_coroutine_body.rs | 0 .../ui-fulldeps/{stable-mir => rustc_public}/check_crate_defs.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/check_def_ty.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/check_defs.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/check_foreign.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/check_instance.rs | 0 .../ui-fulldeps/{stable-mir => rustc_public}/check_intrinsics.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/check_item_kind.rs | 0 .../{stable-mir => rustc_public}/check_normalization.rs | 0 .../{stable-mir => rustc_public}/check_trait_queries.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/check_transform.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/check_ty_fold.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/check_variant.rs | 0 .../{stable-mir => rustc_public}/closure-generic-body.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/closure_body.rs | 0 .../{stable-mir => rustc_public}/compilation-result.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/crate-info.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/projections.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/smir_internal.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/smir_serde.rs | 0 tests/ui-fulldeps/{stable-mir => rustc_public}/smir_visitor.rs | 0 26 files changed, 0 insertions(+), 0 deletions(-) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_abi.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_allocation.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_assoc_items.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_attribute.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_binop.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_coroutine_body.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_crate_defs.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_def_ty.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_defs.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_foreign.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_instance.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_intrinsics.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_item_kind.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_normalization.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_trait_queries.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_transform.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_ty_fold.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/check_variant.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/closure-generic-body.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/closure_body.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/compilation-result.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/crate-info.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/projections.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/smir_internal.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/smir_serde.rs (100%) rename tests/ui-fulldeps/{stable-mir => rustc_public}/smir_visitor.rs (100%) diff --git a/tests/ui-fulldeps/stable-mir/check_abi.rs b/tests/ui-fulldeps/rustc_public/check_abi.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_abi.rs rename to tests/ui-fulldeps/rustc_public/check_abi.rs diff --git a/tests/ui-fulldeps/stable-mir/check_allocation.rs b/tests/ui-fulldeps/rustc_public/check_allocation.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_allocation.rs rename to tests/ui-fulldeps/rustc_public/check_allocation.rs diff --git a/tests/ui-fulldeps/stable-mir/check_assoc_items.rs b/tests/ui-fulldeps/rustc_public/check_assoc_items.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_assoc_items.rs rename to tests/ui-fulldeps/rustc_public/check_assoc_items.rs diff --git a/tests/ui-fulldeps/stable-mir/check_attribute.rs b/tests/ui-fulldeps/rustc_public/check_attribute.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_attribute.rs rename to tests/ui-fulldeps/rustc_public/check_attribute.rs diff --git a/tests/ui-fulldeps/stable-mir/check_binop.rs b/tests/ui-fulldeps/rustc_public/check_binop.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_binop.rs rename to tests/ui-fulldeps/rustc_public/check_binop.rs diff --git a/tests/ui-fulldeps/stable-mir/check_coroutine_body.rs b/tests/ui-fulldeps/rustc_public/check_coroutine_body.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_coroutine_body.rs rename to tests/ui-fulldeps/rustc_public/check_coroutine_body.rs diff --git a/tests/ui-fulldeps/stable-mir/check_crate_defs.rs b/tests/ui-fulldeps/rustc_public/check_crate_defs.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_crate_defs.rs rename to tests/ui-fulldeps/rustc_public/check_crate_defs.rs diff --git a/tests/ui-fulldeps/stable-mir/check_def_ty.rs b/tests/ui-fulldeps/rustc_public/check_def_ty.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_def_ty.rs rename to tests/ui-fulldeps/rustc_public/check_def_ty.rs diff --git a/tests/ui-fulldeps/stable-mir/check_defs.rs b/tests/ui-fulldeps/rustc_public/check_defs.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_defs.rs rename to tests/ui-fulldeps/rustc_public/check_defs.rs diff --git a/tests/ui-fulldeps/stable-mir/check_foreign.rs b/tests/ui-fulldeps/rustc_public/check_foreign.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_foreign.rs rename to tests/ui-fulldeps/rustc_public/check_foreign.rs diff --git a/tests/ui-fulldeps/stable-mir/check_instance.rs b/tests/ui-fulldeps/rustc_public/check_instance.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_instance.rs rename to tests/ui-fulldeps/rustc_public/check_instance.rs diff --git a/tests/ui-fulldeps/stable-mir/check_intrinsics.rs b/tests/ui-fulldeps/rustc_public/check_intrinsics.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_intrinsics.rs rename to tests/ui-fulldeps/rustc_public/check_intrinsics.rs diff --git a/tests/ui-fulldeps/stable-mir/check_item_kind.rs b/tests/ui-fulldeps/rustc_public/check_item_kind.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_item_kind.rs rename to tests/ui-fulldeps/rustc_public/check_item_kind.rs diff --git a/tests/ui-fulldeps/stable-mir/check_normalization.rs b/tests/ui-fulldeps/rustc_public/check_normalization.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_normalization.rs rename to tests/ui-fulldeps/rustc_public/check_normalization.rs diff --git a/tests/ui-fulldeps/stable-mir/check_trait_queries.rs b/tests/ui-fulldeps/rustc_public/check_trait_queries.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_trait_queries.rs rename to tests/ui-fulldeps/rustc_public/check_trait_queries.rs diff --git a/tests/ui-fulldeps/stable-mir/check_transform.rs b/tests/ui-fulldeps/rustc_public/check_transform.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_transform.rs rename to tests/ui-fulldeps/rustc_public/check_transform.rs diff --git a/tests/ui-fulldeps/stable-mir/check_ty_fold.rs b/tests/ui-fulldeps/rustc_public/check_ty_fold.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_ty_fold.rs rename to tests/ui-fulldeps/rustc_public/check_ty_fold.rs diff --git a/tests/ui-fulldeps/stable-mir/check_variant.rs b/tests/ui-fulldeps/rustc_public/check_variant.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/check_variant.rs rename to tests/ui-fulldeps/rustc_public/check_variant.rs diff --git a/tests/ui-fulldeps/stable-mir/closure-generic-body.rs b/tests/ui-fulldeps/rustc_public/closure-generic-body.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/closure-generic-body.rs rename to tests/ui-fulldeps/rustc_public/closure-generic-body.rs diff --git a/tests/ui-fulldeps/stable-mir/closure_body.rs b/tests/ui-fulldeps/rustc_public/closure_body.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/closure_body.rs rename to tests/ui-fulldeps/rustc_public/closure_body.rs diff --git a/tests/ui-fulldeps/stable-mir/compilation-result.rs b/tests/ui-fulldeps/rustc_public/compilation-result.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/compilation-result.rs rename to tests/ui-fulldeps/rustc_public/compilation-result.rs diff --git a/tests/ui-fulldeps/stable-mir/crate-info.rs b/tests/ui-fulldeps/rustc_public/crate-info.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/crate-info.rs rename to tests/ui-fulldeps/rustc_public/crate-info.rs diff --git a/tests/ui-fulldeps/stable-mir/projections.rs b/tests/ui-fulldeps/rustc_public/projections.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/projections.rs rename to tests/ui-fulldeps/rustc_public/projections.rs diff --git a/tests/ui-fulldeps/stable-mir/smir_internal.rs b/tests/ui-fulldeps/rustc_public/smir_internal.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/smir_internal.rs rename to tests/ui-fulldeps/rustc_public/smir_internal.rs diff --git a/tests/ui-fulldeps/stable-mir/smir_serde.rs b/tests/ui-fulldeps/rustc_public/smir_serde.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/smir_serde.rs rename to tests/ui-fulldeps/rustc_public/smir_serde.rs diff --git a/tests/ui-fulldeps/stable-mir/smir_visitor.rs b/tests/ui-fulldeps/rustc_public/smir_visitor.rs similarity index 100% rename from tests/ui-fulldeps/stable-mir/smir_visitor.rs rename to tests/ui-fulldeps/rustc_public/smir_visitor.rs From 9a37aab5589ecfe4101b727b2a91c3846a0068cd Mon Sep 17 00:00:00 2001 From: Makai Date: Tue, 15 Jul 2025 13:54:44 +0000 Subject: [PATCH 076/183] rename `ui/stable-mir-print` --- .../{stable-mir-print => rustc_public-ir-print}/async-closure.rs | 0 .../async-closure.stdout | 0 .../{stable-mir-print => rustc_public-ir-print}/basic_function.rs | 0 .../basic_function.stdout | 0 tests/ui/{stable-mir-print => rustc_public-ir-print}/operands.rs | 0 .../{stable-mir-print => rustc_public-ir-print}/operands.stdout | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename tests/ui/{stable-mir-print => rustc_public-ir-print}/async-closure.rs (100%) rename tests/ui/{stable-mir-print => rustc_public-ir-print}/async-closure.stdout (100%) rename tests/ui/{stable-mir-print => rustc_public-ir-print}/basic_function.rs (100%) rename tests/ui/{stable-mir-print => rustc_public-ir-print}/basic_function.stdout (100%) rename tests/ui/{stable-mir-print => rustc_public-ir-print}/operands.rs (100%) rename tests/ui/{stable-mir-print => rustc_public-ir-print}/operands.stdout (100%) diff --git a/tests/ui/stable-mir-print/async-closure.rs b/tests/ui/rustc_public-ir-print/async-closure.rs similarity index 100% rename from tests/ui/stable-mir-print/async-closure.rs rename to tests/ui/rustc_public-ir-print/async-closure.rs diff --git a/tests/ui/stable-mir-print/async-closure.stdout b/tests/ui/rustc_public-ir-print/async-closure.stdout similarity index 100% rename from tests/ui/stable-mir-print/async-closure.stdout rename to tests/ui/rustc_public-ir-print/async-closure.stdout diff --git a/tests/ui/stable-mir-print/basic_function.rs b/tests/ui/rustc_public-ir-print/basic_function.rs similarity index 100% rename from tests/ui/stable-mir-print/basic_function.rs rename to tests/ui/rustc_public-ir-print/basic_function.rs diff --git a/tests/ui/stable-mir-print/basic_function.stdout b/tests/ui/rustc_public-ir-print/basic_function.stdout similarity index 100% rename from tests/ui/stable-mir-print/basic_function.stdout rename to tests/ui/rustc_public-ir-print/basic_function.stdout diff --git a/tests/ui/stable-mir-print/operands.rs b/tests/ui/rustc_public-ir-print/operands.rs similarity index 100% rename from tests/ui/stable-mir-print/operands.rs rename to tests/ui/rustc_public-ir-print/operands.rs diff --git a/tests/ui/stable-mir-print/operands.stdout b/tests/ui/rustc_public-ir-print/operands.stdout similarity index 100% rename from tests/ui/stable-mir-print/operands.stdout rename to tests/ui/rustc_public-ir-print/operands.stdout From a1deaa7097aa92bfb184824faf30791c03d190f8 Mon Sep 17 00:00:00 2001 From: Makai Date: Tue, 15 Jul 2025 15:58:40 +0000 Subject: [PATCH 077/183] `SmirError` to `Error` --- compiler/rustc_public/src/alloc.rs | 2 +- compiler/rustc_public/src/error.rs | 4 +-- compiler/rustc_public/src/mir/mono.rs | 26 +++++++++---------- .../src/unstable/convert/stable/mir.rs | 5 ++-- .../src/unstable/internal_cx/mod.rs | 2 +- compiler/rustc_public_bridge/src/alloc.rs | 2 +- compiler/rustc_public_bridge/src/bridge.rs | 2 +- .../rustc_public_bridge/src/context/impls.rs | 2 +- .../rustc_public_bridge/src/context/mod.rs | 4 +-- compiler/rustc_public_bridge/src/lib.rs | 2 +- 10 files changed, 25 insertions(+), 26 deletions(-) diff --git a/compiler/rustc_public/src/alloc.rs b/compiler/rustc_public/src/alloc.rs index cb6cc37e8298..dcb3cc0e75fe 100644 --- a/compiler/rustc_public/src/alloc.rs +++ b/compiler/rustc_public/src/alloc.rs @@ -7,7 +7,7 @@ use rustc_abi::Align; use rustc_middle::mir::ConstValue; use rustc_middle::mir::interpret::AllocRange; -use rustc_public_bridge::bridge::SmirError; +use rustc_public_bridge::bridge::Error as _; use rustc_public_bridge::context::CompilerCtxt; use rustc_public_bridge::{Tables, alloc}; diff --git a/compiler/rustc_public/src/error.rs b/compiler/rustc_public/src/error.rs index bc2124d1716f..70a74eaa9fbc 100644 --- a/compiler/rustc_public/src/error.rs +++ b/compiler/rustc_public/src/error.rs @@ -7,7 +7,7 @@ use std::fmt::{Debug, Display, Formatter}; use std::{fmt, io}; -use rustc_public_bridge::bridge::SmirError; +use rustc_public_bridge::bridge; macro_rules! error { ($fmt: literal $(,)?) => { Error(format!($fmt)) }; @@ -32,7 +32,7 @@ pub enum CompilerError { #[derive(Clone, Debug, Eq, PartialEq)] pub struct Error(pub(crate) String); -impl SmirError for Error { +impl bridge::Error for Error { fn new(msg: String) -> Self { Self(msg) } diff --git a/compiler/rustc_public/src/mir/mono.rs b/compiler/rustc_public/src/mir/mono.rs index c85f0fa36f7d..06f6ac17e7b5 100644 --- a/compiler/rustc_public/src/mir/mono.rs +++ b/compiler/rustc_public/src/mir/mono.rs @@ -1,7 +1,7 @@ use std::fmt::{Debug, Formatter}; use std::io; -use rustc_public_bridge::bridge::SmirError; +use rustc_public_bridge::bridge; use serde::Serialize; use crate::abi::FnAbi; @@ -120,9 +120,9 @@ impl Instance { /// Resolve an instance starting from a function definition and generic arguments. pub fn resolve(def: FnDef, args: &GenericArgs) -> Result { with(|context| { - context - .resolve_instance(def, args) - .ok_or_else(|| Error::new(format!("Failed to resolve `{def:?}` with `{args:?}`"))) + context.resolve_instance(def, args).ok_or_else(|| { + bridge::Error::new(format!("Failed to resolve `{def:?}` with `{args:?}`")) + }) }) } @@ -134,9 +134,9 @@ impl Instance { /// Resolve an instance for a given function pointer. pub fn resolve_for_fn_ptr(def: FnDef, args: &GenericArgs) -> Result { with(|context| { - context - .resolve_for_fn_ptr(def, args) - .ok_or_else(|| Error::new(format!("Failed to resolve `{def:?}` with `{args:?}`"))) + context.resolve_for_fn_ptr(def, args).ok_or_else(|| { + bridge::Error::new(format!("Failed to resolve `{def:?}` with `{args:?}`")) + }) }) } @@ -147,9 +147,9 @@ impl Instance { kind: ClosureKind, ) -> Result { with(|context| { - context - .resolve_closure(def, args, kind) - .ok_or_else(|| Error::new(format!("Failed to resolve `{def:?}` with `{args:?}`"))) + context.resolve_closure(def, args, kind).ok_or_else(|| { + bridge::Error::new(format!("Failed to resolve `{def:?}` with `{args:?}`")) + }) }) } @@ -201,7 +201,7 @@ impl TryFrom for Instance { if !context.requires_monomorphization(def_id) { Ok(context.mono_instance(def_id)) } else { - Err(Error::new("Item requires monomorphization".to_string())) + Err(bridge::Error::new("Item requires monomorphization".to_string())) } }) } @@ -217,7 +217,7 @@ impl TryFrom for CrateItem { if value.kind == InstanceKind::Item && context.has_body(value.def.def_id()) { Ok(CrateItem(context.instance_def_id(value.def))) } else { - Err(Error::new(format!("Item kind `{:?}` cannot be converted", value.kind))) + Err(bridge::Error::new(format!("Item kind `{:?}` cannot be converted", value.kind))) } }) } @@ -263,7 +263,7 @@ impl TryFrom for StaticDef { if matches!(value.kind(), ItemKind::Static) { Ok(StaticDef(value.0)) } else { - Err(Error::new(format!("Expected a static item, but found: {value:?}"))) + Err(bridge::Error::new(format!("Expected a static item, but found: {value:?}"))) } } } diff --git a/compiler/rustc_public/src/unstable/convert/stable/mir.rs b/compiler/rustc_public/src/unstable/convert/stable/mir.rs index cb68129c6606..8dee579e598b 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/mir.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/mir.rs @@ -2,9 +2,8 @@ use rustc_middle::mir::mono::MonoItem; use rustc_middle::{bug, mir}; -use rustc_public_bridge::Tables; -use rustc_public_bridge::bridge::SmirError; use rustc_public_bridge::context::CompilerCtxt; +use rustc_public_bridge::{Tables, bridge}; use crate::compiler_interface::BridgeTys; use crate::mir::alloc::GlobalAlloc; @@ -914,7 +913,7 @@ impl<'tcx> Stable<'tcx> for mir::interpret::ErrorHandled { type T = Error; fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T { - Error::new(format!("{self:?}")) + bridge::Error::new(format!("{self:?}")) } } diff --git a/compiler/rustc_public/src/unstable/internal_cx/mod.rs b/compiler/rustc_public/src/unstable/internal_cx/mod.rs index 44fbfde87755..601ca4fb5cfd 100644 --- a/compiler/rustc_public/src/unstable/internal_cx/mod.rs +++ b/compiler/rustc_public/src/unstable/internal_cx/mod.rs @@ -1,8 +1,8 @@ //! Implementation of InternalCx. +pub(crate) use helpers::*; use rustc_middle::ty::{List, Ty, TyCtxt}; use rustc_middle::{mir, ty}; -pub(crate) use helpers::*; use super::InternalCx; diff --git a/compiler/rustc_public_bridge/src/alloc.rs b/compiler/rustc_public_bridge/src/alloc.rs index c866b05e6cf2..4a4725390a0f 100644 --- a/compiler/rustc_public_bridge/src/alloc.rs +++ b/compiler/rustc_public_bridge/src/alloc.rs @@ -12,7 +12,7 @@ use rustc_middle::ty::{Ty, layout}; use super::{CompilerCtxt, Tables}; use crate::bridge::Allocation as _; -use crate::{Bridge, SmirError}; +use crate::{Bridge, Error}; pub fn create_ty_and_layout<'tcx, B: Bridge>( cx: &CompilerCtxt<'tcx, B>, diff --git a/compiler/rustc_public_bridge/src/bridge.rs b/compiler/rustc_public_bridge/src/bridge.rs index 675bb2d8bc33..d4f4847c8d3b 100644 --- a/compiler/rustc_public_bridge/src/bridge.rs +++ b/compiler/rustc_public_bridge/src/bridge.rs @@ -9,7 +9,7 @@ use std::fmt::Debug; use super::context::CompilerCtxt; use super::{Bridge, Tables}; -pub trait SmirError { +pub trait Error { fn new(msg: String) -> Self; fn from_internal(err: T) -> Self; } diff --git a/compiler/rustc_public_bridge/src/context/impls.rs b/compiler/rustc_public_bridge/src/context/impls.rs index 8079fc95f97d..5637da9e5b10 100644 --- a/compiler/rustc_public_bridge/src/context/impls.rs +++ b/compiler/rustc_public_bridge/src/context/impls.rs @@ -26,7 +26,7 @@ use rustc_target::callconv::FnAbi; use super::{AllocRangeHelpers, CompilerCtxt, TyHelpers, TypingEnvHelpers}; use crate::builder::BodyBuilder; -use crate::{Bridge, SmirError, Tables, filter_def_ids}; +use crate::{Bridge, Error, Tables, filter_def_ids}; impl<'tcx, B: Bridge> TyHelpers<'tcx> for CompilerCtxt<'tcx, B> { fn new_foreign(&self, def_id: DefId) -> ty::Ty<'tcx> { diff --git a/compiler/rustc_public_bridge/src/context/mod.rs b/compiler/rustc_public_bridge/src/context/mod.rs index 3aa5c33c57db..b436319ae8bf 100644 --- a/compiler/rustc_public_bridge/src/context/mod.rs +++ b/compiler/rustc_public_bridge/src/context/mod.rs @@ -9,10 +9,10 @@ use rustc_middle::ty; use rustc_middle::ty::layout::{FnAbiOfHelpers, HasTyCtxt, HasTypingEnv, LayoutOfHelpers}; use rustc_middle::ty::{Ty, TyCtxt}; -use crate::{Bridge, SmirError}; +use crate::{Bridge, Error}; -mod impls; mod helpers; +mod impls; pub use helpers::*; diff --git a/compiler/rustc_public_bridge/src/lib.rs b/compiler/rustc_public_bridge/src/lib.rs index 2bb259a857c0..c0e1b6d4f511 100644 --- a/compiler/rustc_public_bridge/src/lib.rs +++ b/compiler/rustc_public_bridge/src/lib.rs @@ -222,7 +222,7 @@ pub trait Bridge: Sized { type MirConstId: Copy + Debug + PartialEq + IndexedVal; type Layout: Copy + Debug + PartialEq + IndexedVal; - type Error: SmirError; + type Error: Error; type CrateItem: CrateItem; type AdtDef: AdtDef; type ForeignModuleDef: ForeignModuleDef; From 95338717f10b46dfac7ee8333672ede004ca212b Mon Sep 17 00:00:00 2001 From: Makai Date: Tue, 15 Jul 2025 16:02:24 +0000 Subject: [PATCH 078/183] Update docs in `rustc_public_bridge` --- compiler/rustc_public_bridge/src/alloc.rs | 2 +- compiler/rustc_public_bridge/src/builder.rs | 7 +++---- compiler/rustc_public_bridge/src/context/impls.rs | 4 ++-- compiler/rustc_public_bridge/src/context/mod.rs | 4 ++-- compiler/rustc_public_bridge/src/lib.rs | 6 +++--- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/compiler/rustc_public_bridge/src/alloc.rs b/compiler/rustc_public_bridge/src/alloc.rs index 4a4725390a0f..ecf9004562c2 100644 --- a/compiler/rustc_public_bridge/src/alloc.rs +++ b/compiler/rustc_public_bridge/src/alloc.rs @@ -1,4 +1,4 @@ -//! Internal memory allocator implementation for StableMIR. +//! Internal memory allocator implementation for rustc_public. //! //! This module handles all direct interactions with rustc queries and performs //! the actual memory allocations. The stable interface in `rustc_public::alloc` diff --git a/compiler/rustc_public_bridge/src/builder.rs b/compiler/rustc_public_bridge/src/builder.rs index 2141053d09af..ea7f37d72d0d 100644 --- a/compiler/rustc_public_bridge/src/builder.rs +++ b/compiler/rustc_public_bridge/src/builder.rs @@ -1,8 +1,7 @@ -//! Logic required to produce a monomorphic stable body. +//! Logic required to produce a monomorphic body. //! -//! We first retrieve and monomorphize the rustc body representation, i.e., we generate a +//! We retrieve and monomorphize the rustc body representation, i.e., we generate a //! monomorphic body using internal representation. -//! After that, we convert the internal representation into a stable one. use rustc_hir::def::DefKind; use rustc_middle::mir; @@ -25,7 +24,7 @@ impl<'tcx> BodyBuilder<'tcx> { BodyBuilder { tcx, instance } } - /// Build a stable monomorphic body for a given instance based on the MIR body. + /// Build a monomorphic body for a given instance based on the MIR body. /// /// All constants are also evaluated. pub(crate) fn build(mut self) -> mir::Body<'tcx> { diff --git a/compiler/rustc_public_bridge/src/context/impls.rs b/compiler/rustc_public_bridge/src/context/impls.rs index 5637da9e5b10..612e44b56b1a 100644 --- a/compiler/rustc_public_bridge/src/context/impls.rs +++ b/compiler/rustc_public_bridge/src/context/impls.rs @@ -1,4 +1,4 @@ -//! Implementation of StableMIR Context. +//! Implementation of CompilerCtxt. #![allow(rustc::usage_of_qualified_ty)] @@ -85,7 +85,7 @@ impl<'tcx, B: Bridge> CompilerCtxt<'tcx, B> { /// Return whether the item has a body defined by the user. /// /// Note that intrinsics may have a placeholder body that shouldn't be used in practice. - /// In StableMIR, we handle this case as if the body is not available. + /// In rustc_public, we handle this case as if the body is not available. pub(crate) fn item_has_body(&self, def_id: DefId) -> bool { let must_override = if let Some(intrinsic) = self.tcx.intrinsic(def_id) { intrinsic.must_be_overridden diff --git a/compiler/rustc_public_bridge/src/context/mod.rs b/compiler/rustc_public_bridge/src/context/mod.rs index b436319ae8bf..857a2d4e26bc 100644 --- a/compiler/rustc_public_bridge/src/context/mod.rs +++ b/compiler/rustc_public_bridge/src/context/mod.rs @@ -1,4 +1,4 @@ -//! Implementation of StableMIR Context. +//! Implementation of CompilerCtxt. #![allow(rustc::usage_of_qualified_ty)] @@ -19,7 +19,7 @@ pub use helpers::*; /// Provides direct access to rustc's internal queries. /// /// `CompilerInterface` must go through -/// this context to obtain rustc-level information. +/// this context to obtain internal information. pub struct CompilerCtxt<'tcx, B: Bridge> { pub tcx: TyCtxt<'tcx>, _marker: PhantomData, diff --git a/compiler/rustc_public_bridge/src/lib.rs b/compiler/rustc_public_bridge/src/lib.rs index c0e1b6d4f511..dec3be70baff 100644 --- a/compiler/rustc_public_bridge/src/lib.rs +++ b/compiler/rustc_public_bridge/src/lib.rs @@ -1,6 +1,6 @@ -//! Crate that implements what will become the rustc side of Stable MIR. +//! Crate that implements what will become the rustc side of rustc_public. //! -//! This crate is responsible for building Stable MIR components from internal components. +//! This crate serves as a proxy for making calls to rustc queries. //! //! This crate is not intended to be invoked directly by users. //! This crate is the public API of rustc that will be invoked by the `rustc_public` crate. @@ -210,7 +210,7 @@ impl<'tcx, B: Bridge> Tables<'tcx, B> { } } -/// A trait defining types that are used to emulate StableMIR components, which is really +/// A trait defining types that are used to emulate rustc_public components, which is really /// useful when programming in rustc_public-agnostic settings. pub trait Bridge: Sized { type DefId: Copy + Debug + PartialEq + IndexedVal; From 483877a9b2140065df08e15a27c20c9431028ec5 Mon Sep 17 00:00:00 2001 From: Makai Date: Tue, 15 Jul 2025 16:22:33 +0000 Subject: [PATCH 079/183] Update docs in `rustc_public` --- compiler/rustc_public/src/alloc.rs | 2 +- .../rustc_public/src/compiler_interface.rs | 4 ++-- compiler/rustc_public/src/error.rs | 2 +- compiler/rustc_public/src/mir/alloc.rs | 2 +- compiler/rustc_public/src/mir/body.rs | 6 +++--- compiler/rustc_public/src/mir/mono.rs | 4 ++-- compiler/rustc_public/src/mir/pretty.rs | 2 +- compiler/rustc_public/src/mir/visit.rs | 2 +- .../rustc_public/src/rustc_internal/mod.rs | 12 ++++++------ .../rustc_public/src/rustc_internal/pretty.rs | 2 +- .../src/unstable/convert/internal.rs | 2 +- .../rustc_public/src/unstable/convert/mod.rs | 2 +- compiler/rustc_public/src/unstable/mod.rs | 19 ++++++++++--------- 13 files changed, 31 insertions(+), 30 deletions(-) diff --git a/compiler/rustc_public/src/alloc.rs b/compiler/rustc_public/src/alloc.rs index dcb3cc0e75fe..75ad31022ff5 100644 --- a/compiler/rustc_public/src/alloc.rs +++ b/compiler/rustc_public/src/alloc.rs @@ -1,4 +1,4 @@ -//! Memory allocation implementation for StableMIR. +//! Memory allocation implementation for rustc_public. //! //! This module is responsible for constructing stable components. //! All operations requiring rustc queries must be delegated diff --git a/compiler/rustc_public/src/compiler_interface.rs b/compiler/rustc_public/src/compiler_interface.rs index 043064951d5d..5a09c3b24f0f 100644 --- a/compiler/rustc_public/src/compiler_interface.rs +++ b/compiler/rustc_public/src/compiler_interface.rs @@ -1,6 +1,6 @@ //! Define the interface with the Rust compiler. //! -//! StableMIR users should not use any of the items in this module directly. +//! rustc_public users should not use any of the items in this module directly. //! These APIs have no stability guarantee. use std::cell::Cell; @@ -1067,7 +1067,7 @@ where F: FnOnce() -> T, { if TLV.is_set() { - Err(Error::from("StableMIR already running")) + Err(Error::from("rustc_public already running")) } else { let ptr: *const () = (&raw const interface) as _; TLV.set(&Cell::new(ptr), || Ok(f())) diff --git a/compiler/rustc_public/src/error.rs b/compiler/rustc_public/src/error.rs index 70a74eaa9fbc..3d75a4bd3157 100644 --- a/compiler/rustc_public/src/error.rs +++ b/compiler/rustc_public/src/error.rs @@ -1,5 +1,5 @@ //! When things go wrong, we need some error handling. -//! There are a few different types of errors in StableMIR: +//! There are a few different types of errors in rustc_public: //! //! - [CompilerError]: This represents errors that can be raised when invoking the compiler. //! - [Error]: Generic error that represents the reason why a request that could not be fulfilled. diff --git a/compiler/rustc_public/src/mir/alloc.rs b/compiler/rustc_public/src/mir/alloc.rs index 9a94551f3ec8..07a979f3811e 100644 --- a/compiler/rustc_public/src/mir/alloc.rs +++ b/compiler/rustc_public/src/mir/alloc.rs @@ -9,7 +9,7 @@ use crate::target::{Endian, MachineInfo}; use crate::ty::{Allocation, Binder, ExistentialTraitRef, Ty}; use crate::{Error, IndexedVal, with}; -/// An allocation in the SMIR global memory can be either a function pointer, +/// An allocation in the rustc_public's IR global memory can be either a function pointer, /// a static, or a "real" allocation with some data in it. #[derive(Debug, Clone, Eq, PartialEq, Serialize)] pub enum GlobalAlloc { diff --git a/compiler/rustc_public/src/mir/body.rs b/compiler/rustc_public/src/mir/body.rs index 28a7aa6e7582..3320b98cd610 100644 --- a/compiler/rustc_public/src/mir/body.rs +++ b/compiler/rustc_public/src/mir/body.rs @@ -10,7 +10,7 @@ use crate::ty::{ }; use crate::{Error, Opaque, Span, Symbol}; -/// The SMIR representation of a single function. +/// The rustc_public's IR representation of a single function. #[derive(Clone, Debug, Serialize)] pub struct Body { pub blocks: Vec, @@ -771,8 +771,8 @@ pub enum VarDebugInfoContents { // In MIR ProjectionElem is parameterized on the second Field argument and the Index argument. This // is so it can be used for both Places (for which the projection elements are of type // ProjectionElem) and user-provided type annotations (for which the projection elements -// are of type ProjectionElem<(), ()>). In SMIR we don't need this generality, so we just use -// ProjectionElem for Places. +// are of type ProjectionElem<(), ()>). +// In rustc_public's IR we don't need this generality, so we just use ProjectionElem for Places. #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub enum ProjectionElem { /// Dereference projections (e.g. `*_1`) project to the address referenced by the base place. diff --git a/compiler/rustc_public/src/mir/mono.rs b/compiler/rustc_public/src/mir/mono.rs index 06f6ac17e7b5..d488f5a25c7d 100644 --- a/compiler/rustc_public/src/mir/mono.rs +++ b/compiler/rustc_public/src/mir/mono.rs @@ -62,7 +62,7 @@ impl Instance { /// For more information on fallback body, see . /// /// This call is much cheaper than `instance.body().is_some()`, since it doesn't try to build - /// the StableMIR body. + /// the rustc_public's IR body. pub fn has_body(&self) -> bool { with(|cx| cx.has_body(self.def.def_id())) } @@ -157,7 +157,7 @@ impl Instance { /// /// Allow users to check if this shim can be ignored when called directly. /// - /// We have decided not to export different types of Shims to StableMIR users, however, this + /// We have decided not to export different types of Shims to rustc_public users, however, this /// is a query that can be very helpful for users when processing DropGlue. /// /// When generating code for a Drop terminator, users can ignore an empty drop glue. diff --git a/compiler/rustc_public/src/mir/pretty.rs b/compiler/rustc_public/src/mir/pretty.rs index f496d80053e6..a433df2dba1a 100644 --- a/compiler/rustc_public/src/mir/pretty.rs +++ b/compiler/rustc_public/src/mir/pretty.rs @@ -1,4 +1,4 @@ -//! Implement methods to pretty print stable MIR body. +//! Implement methods to pretty print rustc_public's IR body. use std::fmt::Debug; use std::io::Write; use std::{fmt, io, iter}; diff --git a/compiler/rustc_public/src/mir/visit.rs b/compiler/rustc_public/src/mir/visit.rs index 7dc99d1d1e18..04c4d4d2a82d 100644 --- a/compiler/rustc_public/src/mir/visit.rs +++ b/compiler/rustc_public/src/mir/visit.rs @@ -1,4 +1,4 @@ -//! # The Stable MIR Visitor +//! # The rustc_public's IR Visitor //! //! ## Overview //! diff --git a/compiler/rustc_public/src/rustc_internal/mod.rs b/compiler/rustc_public/src/rustc_internal/mod.rs index ca999b62f807..a119958974e4 100644 --- a/compiler/rustc_public/src/rustc_internal/mod.rs +++ b/compiler/rustc_public/src/rustc_internal/mod.rs @@ -1,7 +1,7 @@ -//! Module that implements the bridge between Stable MIR and internal compiler MIR. +//! Module that implements the bridge between rustc_public's IR and internal compiler MIR. //! //! For that, we define APIs that will temporarily be public to 3P that exposes rustc internal APIs -//! until stable MIR is complete. +//! until rustc_public's IR is complete. use std::cell::{Cell, RefCell}; @@ -26,7 +26,7 @@ pub mod pretty; /// /// # Panics /// -/// This function will panic if StableMIR has not been properly initialized. +/// This function will panic if rustc_public has not been properly initialized. pub fn stable<'tcx, S: Stable<'tcx>>(item: S) -> S::T { with_container(|tables, cx| item.stable(tables, cx)) } @@ -41,7 +41,7 @@ pub fn stable<'tcx, S: Stable<'tcx>>(item: S) -> S::T { /// /// # Panics /// -/// This function will panic if StableMIR has not been properly initialized. +/// This function will panic if rustc_public has not been properly initialized. pub fn internal<'tcx, S>(tcx: TyCtxt<'tcx>, item: S) -> S::T<'tcx> where S: RustcInternal, @@ -57,7 +57,7 @@ pub fn crate_num(item: &crate::Crate) -> CrateNum { } // A thread local variable that stores a pointer to the tables mapping between TyCtxt -// datastructures and stable MIR datastructures +// datastructures and rustc_public's IR datastructures scoped_thread_local! (static TLV: Cell<*const ()>); pub(crate) fn init<'tcx, F, T, B: Bridge>(container: &Container<'tcx, B>, f: F) -> T @@ -176,7 +176,7 @@ macro_rules! optional { /// Prefer using [run!] and [run_with_tcx] instead. /// -/// This macro implements the instantiation of a StableMIR driver, and it will invoke +/// This macro implements the instantiation of a rustc_public driver, and it will invoke /// the given callback after the compiler analyses. /// /// The third argument determines whether the callback requires `tcx` as an argument. diff --git a/compiler/rustc_public/src/rustc_internal/pretty.rs b/compiler/rustc_public/src/rustc_internal/pretty.rs index 28c5280fe04c..83522e519778 100644 --- a/compiler/rustc_public/src/rustc_internal/pretty.rs +++ b/compiler/rustc_public/src/rustc_internal/pretty.rs @@ -7,7 +7,7 @@ use super::run; pub fn write_smir_pretty<'tcx, W: io::Write>(tcx: TyCtxt<'tcx>, w: &mut W) -> io::Result<()> { writeln!( w, - "// WARNING: This is highly experimental output it's intended for stable-mir developers only." + "// WARNING: This is highly experimental output it's intended for rustc_public developers only." )?; writeln!( w, diff --git a/compiler/rustc_public/src/unstable/convert/internal.rs b/compiler/rustc_public/src/unstable/convert/internal.rs index 0571a03b62bb..b2d38e497bc8 100644 --- a/compiler/rustc_public/src/unstable/convert/internal.rs +++ b/compiler/rustc_public/src/unstable/convert/internal.rs @@ -1,4 +1,4 @@ -//! Module containing the translation from stable mir constructs to the rustc counterpart. +//! Module containing the translation from rustc_public constructs to the rustc counterpart. //! //! This module will only include a few constructs to allow users to invoke internal rustc APIs //! due to incomplete stable coverage. diff --git a/compiler/rustc_public/src/unstable/convert/mod.rs b/compiler/rustc_public/src/unstable/convert/mod.rs index a2e83c6e2394..f20406631e3f 100644 --- a/compiler/rustc_public/src/unstable/convert/mod.rs +++ b/compiler/rustc_public/src/unstable/convert/mod.rs @@ -1,4 +1,4 @@ -//! This module holds the logic to convert rustc internal ADTs into stable mir ADTs. +//! This module holds the logic to convert rustc internal ADTs into rustc_public ADTs. //! //! The conversion from stable to internal is not meant to be complete, //! and it should be added as when needed to be passed as input to rustc_public_bridge functions. diff --git a/compiler/rustc_public/src/unstable/mod.rs b/compiler/rustc_public/src/unstable/mod.rs index ca154a3378a7..72b14cfa072a 100644 --- a/compiler/rustc_public/src/unstable/mod.rs +++ b/compiler/rustc_public/src/unstable/mod.rs @@ -1,6 +1,6 @@ //! Module that collects the things that have no stability guarantees. //! -//! We want to keep StableMIR definitions and logic separate from +//! We want to keep rustc_public's IR definitions and logic separate from //! any sort of conversion and usage of internal rustc code. So we //! restrict the usage of internal items to be inside this module. @@ -53,16 +53,16 @@ pub trait InternalCx<'tcx>: Copy + Clone { fn adt_def(self, def_id: rustc_hir::def_id::DefId) -> ty::AdtDef<'tcx>; } -/// Trait used to convert between an internal MIR type to a Stable MIR type. +/// Trait used to convert between an internal MIR type to a rustc_public's IR type. /// -/// This trait is currently exposed to users so they can have interoperability between internal MIR -/// and StableMIR constructs. However, they should be used seldom and they have no influence -/// in this crate semver. +/// This trait is currently exposed to users so they can have interoperability +/// between internal MIR and rustc_public's IR constructs. +/// However, they should be used seldom and they have no influence in this crate semver. #[doc(hidden)] pub trait Stable<'tcx>: PointeeSized { /// The stable representation of the type implementing Stable. type T; - /// Converts an object to the equivalent Stable MIR representation. + /// Converts an object to the equivalent rustc_public's IR representation. fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, @@ -70,12 +70,13 @@ pub trait Stable<'tcx>: PointeeSized { ) -> Self::T; } -/// Trait used to translate a stable construct to its rustc counterpart. +/// Trait used to translate a rustc_public's IR construct to its rustc counterpart. /// /// This is basically a mirror of [Stable]. /// -/// This trait is currently exposed to users so they can have interoperability between internal MIR -/// and StableMIR constructs. They should be used seldom as they have no stability guarantees. +/// This trait is currently exposed to users so they can have interoperability +/// between internal MIR and rustc_public's IR constructs. +/// They should be used seldom as they have no stability guarantees. #[doc(hidden)] pub trait RustcInternal { type T<'tcx>; From 4d79328091167135e890b77f0fbf5b8b9479c80b Mon Sep 17 00:00:00 2001 From: Makai Date: Tue, 15 Jul 2025 16:37:26 +0000 Subject: [PATCH 080/183] use `RustcPublic` instead of `StableMir` --- compiler/rustc_public/src/rustc_internal/mod.rs | 12 ++++++------ tests/ui-fulldeps/rustc_public/check_abi.rs | 2 +- tests/ui-fulldeps/rustc_public/check_allocation.rs | 2 +- tests/ui-fulldeps/rustc_public/check_attribute.rs | 2 +- tests/ui-fulldeps/rustc_public/check_binop.rs | 2 +- tests/ui-fulldeps/rustc_public/check_crate_defs.rs | 2 +- tests/ui-fulldeps/rustc_public/check_def_ty.rs | 2 +- tests/ui-fulldeps/rustc_public/check_defs.rs | 2 +- tests/ui-fulldeps/rustc_public/check_foreign.rs | 2 +- tests/ui-fulldeps/rustc_public/check_instance.rs | 2 +- tests/ui-fulldeps/rustc_public/check_intrinsics.rs | 2 +- tests/ui-fulldeps/rustc_public/check_item_kind.rs | 2 +- .../ui-fulldeps/rustc_public/check_normalization.rs | 2 +- .../ui-fulldeps/rustc_public/check_trait_queries.rs | 2 +- tests/ui-fulldeps/rustc_public/check_transform.rs | 2 +- tests/ui-fulldeps/rustc_public/check_ty_fold.rs | 2 +- tests/ui-fulldeps/rustc_public/check_variant.rs | 2 +- tests/ui-fulldeps/rustc_public/compilation-result.rs | 2 +- tests/ui-fulldeps/rustc_public/crate-info.rs | 2 +- tests/ui-fulldeps/rustc_public/projections.rs | 2 +- tests/ui-fulldeps/rustc_public/smir_internal.rs | 2 +- tests/ui-fulldeps/rustc_public/smir_serde.rs | 2 +- tests/ui-fulldeps/rustc_public/smir_visitor.rs | 2 +- 23 files changed, 28 insertions(+), 28 deletions(-) diff --git a/compiler/rustc_public/src/rustc_internal/mod.rs b/compiler/rustc_public/src/rustc_internal/mod.rs index a119958974e4..225c811ab3a5 100644 --- a/compiler/rustc_public/src/rustc_internal/mod.rs +++ b/compiler/rustc_public/src/rustc_internal/mod.rs @@ -191,7 +191,7 @@ macro_rules! run_driver { use rustc_public::CompilerError; use std::ops::ControlFlow; - pub struct StableMir ControlFlow> + pub struct RustcPublic ControlFlow> where B: Send, C: Send, @@ -201,15 +201,15 @@ macro_rules! run_driver { result: Option>, } - impl StableMir + impl RustcPublic where B: Send, C: Send, F: FnOnce($($crate::optional!($with_tcx TyCtxt))?) -> ControlFlow + Send, { - /// Creates a new `StableMir` instance, with given test_function and arguments. + /// Creates a new `RustcPublic` instance, with given test_function and arguments. pub fn new(callback: F) -> Self { - StableMir { callback: Some(callback), result: None } + RustcPublic { callback: Some(callback), result: None } } /// Runs the compiler against given target and tests it with `test_function` @@ -236,7 +236,7 @@ macro_rules! run_driver { } } - impl Callbacks for StableMir + impl Callbacks for RustcPublic where B: Send, C: Send, @@ -265,6 +265,6 @@ macro_rules! run_driver { } } - StableMir::new($callback).run($args) + RustcPublic::new($callback).run($args) }}; } diff --git a/tests/ui-fulldeps/rustc_public/check_abi.rs b/tests/ui-fulldeps/rustc_public/check_abi.rs index fc2227d147db..57c8377ea367 100644 --- a/tests/ui-fulldeps/rustc_public/check_abi.rs +++ b/tests/ui-fulldeps/rustc_public/check_abi.rs @@ -167,7 +167,7 @@ impl MirVisitor for AdtDefVisitor { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "alloc_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_allocation.rs b/tests/ui-fulldeps/rustc_public/check_allocation.rs index 83845a9aa422..70e4ee3fe347 100644 --- a/tests/ui-fulldeps/rustc_public/check_allocation.rs +++ b/tests/ui-fulldeps/rustc_public/check_allocation.rs @@ -202,7 +202,7 @@ fn get_item<'a>( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "alloc_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_attribute.rs b/tests/ui-fulldeps/rustc_public/check_attribute.rs index d8807872ec46..0c34ac4dfe95 100644 --- a/tests/ui-fulldeps/rustc_public/check_attribute.rs +++ b/tests/ui-fulldeps/rustc_public/check_attribute.rs @@ -52,7 +52,7 @@ fn get_item<'a>( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "attribute_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_binop.rs b/tests/ui-fulldeps/rustc_public/check_binop.rs index aa089a5d1257..35be6f973cc7 100644 --- a/tests/ui-fulldeps/rustc_public/check_binop.rs +++ b/tests/ui-fulldeps/rustc_public/check_binop.rs @@ -76,7 +76,7 @@ impl<'a> MirVisitor for Visitor<'a> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "binop_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_crate_defs.rs b/tests/ui-fulldeps/rustc_public/check_crate_defs.rs index 27d5b0bc2388..3ca8b66e58dc 100644 --- a/tests/ui-fulldeps/rustc_public/check_crate_defs.rs +++ b/tests/ui-fulldeps/rustc_public/check_crate_defs.rs @@ -79,7 +79,7 @@ fn contains(items: &[T], expected: &[&str]) { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "crate_definitions.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_def_ty.rs b/tests/ui-fulldeps/rustc_public/check_def_ty.rs index b5954352dc02..176a9d79ef11 100644 --- a/tests/ui-fulldeps/rustc_public/check_def_ty.rs +++ b/tests/ui-fulldeps/rustc_public/check_def_ty.rs @@ -70,7 +70,7 @@ fn check_fn_def(ty: Ty) { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "defs_ty_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_defs.rs b/tests/ui-fulldeps/rustc_public/check_defs.rs index 5e45f19cac89..0c45859a132a 100644 --- a/tests/ui-fulldeps/rustc_public/check_defs.rs +++ b/tests/ui-fulldeps/rustc_public/check_defs.rs @@ -106,7 +106,7 @@ fn get_instances(body: mir::Body) -> Vec { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "defs_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_foreign.rs b/tests/ui-fulldeps/rustc_public/check_foreign.rs index 9aee067f41b6..78b62594c618 100644 --- a/tests/ui-fulldeps/rustc_public/check_foreign.rs +++ b/tests/ui-fulldeps/rustc_public/check_foreign.rs @@ -52,7 +52,7 @@ fn test_foreign() -> ControlFlow<()> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "foreign_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_instance.rs b/tests/ui-fulldeps/rustc_public/check_instance.rs index 189710760439..fd7523963fa9 100644 --- a/tests/ui-fulldeps/rustc_public/check_instance.rs +++ b/tests/ui-fulldeps/rustc_public/check_instance.rs @@ -81,7 +81,7 @@ fn test_body(body: mir::Body) { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "instance_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_intrinsics.rs b/tests/ui-fulldeps/rustc_public/check_intrinsics.rs index 854ac77956e0..f722f0bbd718 100644 --- a/tests/ui-fulldeps/rustc_public/check_intrinsics.rs +++ b/tests/ui-fulldeps/rustc_public/check_intrinsics.rs @@ -110,7 +110,7 @@ impl<'a> MirVisitor for CallsVisitor<'a> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "binop_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_item_kind.rs b/tests/ui-fulldeps/rustc_public/check_item_kind.rs index 58e740bdaef5..b759628f1a42 100644 --- a/tests/ui-fulldeps/rustc_public/check_item_kind.rs +++ b/tests/ui-fulldeps/rustc_public/check_item_kind.rs @@ -41,7 +41,7 @@ fn test_item_kind() -> ControlFlow<()> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "item_kind_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_normalization.rs b/tests/ui-fulldeps/rustc_public/check_normalization.rs index aa6a257dac6d..db9d3031600d 100644 --- a/tests/ui-fulldeps/rustc_public/check_normalization.rs +++ b/tests/ui-fulldeps/rustc_public/check_normalization.rs @@ -55,7 +55,7 @@ fn check_ty(ty: Ty) { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "normalization_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_trait_queries.rs b/tests/ui-fulldeps/rustc_public/check_trait_queries.rs index a6c37883643f..0dd13044fcce 100644 --- a/tests/ui-fulldeps/rustc_public/check_trait_queries.rs +++ b/tests/ui-fulldeps/rustc_public/check_trait_queries.rs @@ -67,7 +67,7 @@ fn assert_impl(impl_names: &HashSet, target: &str) { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "trait_queries.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_transform.rs b/tests/ui-fulldeps/rustc_public/check_transform.rs index 3209fcf9ede5..b30d98c3b26f 100644 --- a/tests/ui-fulldeps/rustc_public/check_transform.rs +++ b/tests/ui-fulldeps/rustc_public/check_transform.rs @@ -115,7 +115,7 @@ fn get_item<'a>( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "transform_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_ty_fold.rs b/tests/ui-fulldeps/rustc_public/check_ty_fold.rs index 07ef0d2bb50b..93cd30493440 100644 --- a/tests/ui-fulldeps/rustc_public/check_ty_fold.rs +++ b/tests/ui-fulldeps/rustc_public/check_ty_fold.rs @@ -73,7 +73,7 @@ impl<'a> MirVisitor for PlaceVisitor<'a> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "ty_fold_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/check_variant.rs b/tests/ui-fulldeps/rustc_public/check_variant.rs index ebe76bd89d5d..9ed16f2357c0 100644 --- a/tests/ui-fulldeps/rustc_public/check_variant.rs +++ b/tests/ui-fulldeps/rustc_public/check_variant.rs @@ -120,7 +120,7 @@ fn check_statement_is_aggregate_assign( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "defs_ty_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/compilation-result.rs b/tests/ui-fulldeps/rustc_public/compilation-result.rs index ed013375c713..d33e602e8191 100644 --- a/tests/ui-fulldeps/rustc_public/compilation-result.rs +++ b/tests/ui-fulldeps/rustc_public/compilation-result.rs @@ -20,7 +20,7 @@ use std::io::Write; /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "input_compilation_result_test.rs"; diff --git a/tests/ui-fulldeps/rustc_public/crate-info.rs b/tests/ui-fulldeps/rustc_public/crate-info.rs index 4f46dff9b820..19082d7394ab 100644 --- a/tests/ui-fulldeps/rustc_public/crate-info.rs +++ b/tests/ui-fulldeps/rustc_public/crate-info.rs @@ -189,7 +189,7 @@ fn get_item<'a>( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/projections.rs b/tests/ui-fulldeps/rustc_public/projections.rs index 3b360cd2fcff..e0213b4253c7 100644 --- a/tests/ui-fulldeps/rustc_public/projections.rs +++ b/tests/ui-fulldeps/rustc_public/projections.rs @@ -141,7 +141,7 @@ fn get_item<'a>( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/smir_internal.rs b/tests/ui-fulldeps/rustc_public/smir_internal.rs index dd70cfe5f5e6..b74bdfe4eb19 100644 --- a/tests/ui-fulldeps/rustc_public/smir_internal.rs +++ b/tests/ui-fulldeps/rustc_public/smir_internal.rs @@ -34,7 +34,7 @@ fn test_translation(tcx: TyCtxt<'_>) -> ControlFlow<()> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "internal_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/smir_serde.rs b/tests/ui-fulldeps/rustc_public/smir_serde.rs index 31642c6cb94c..972bc5efe206 100644 --- a/tests/ui-fulldeps/rustc_public/smir_serde.rs +++ b/tests/ui-fulldeps/rustc_public/smir_serde.rs @@ -41,7 +41,7 @@ fn serialize_to_json(_tcx: TyCtxt<'_>) -> ControlFlow<()> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "internal_input.rs"; diff --git a/tests/ui-fulldeps/rustc_public/smir_visitor.rs b/tests/ui-fulldeps/rustc_public/smir_visitor.rs index 66787e2927bd..9438f46a59b5 100644 --- a/tests/ui-fulldeps/rustc_public/smir_visitor.rs +++ b/tests/ui-fulldeps/rustc_public/smir_visitor.rs @@ -177,7 +177,7 @@ impl mir::MutMirVisitor for TestMutVisitor { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "sim_visitor_input.rs"; From 20a7f722d824ebc4e733ec848d797088363624e9 Mon Sep 17 00:00:00 2001 From: Makai Date: Thu, 17 Jul 2025 15:49:51 +0000 Subject: [PATCH 081/183] fix `ui/rustc_public-ir-print` outputs --- tests/ui/rustc_public-ir-print/async-closure.stdout | 2 +- tests/ui/rustc_public-ir-print/basic_function.stdout | 2 +- tests/ui/rustc_public-ir-print/operands.stdout | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ui/rustc_public-ir-print/async-closure.stdout b/tests/ui/rustc_public-ir-print/async-closure.stdout index 318112997220..4afb15af7a93 100644 --- a/tests/ui/rustc_public-ir-print/async-closure.stdout +++ b/tests/ui/rustc_public-ir-print/async-closure.stdout @@ -1,4 +1,4 @@ -// WARNING: This is highly experimental output it's intended for stable-mir developers only. +// WARNING: This is highly experimental output it's intended for rustc_public developers only. // If you find a bug or want to improve the output open a issue at https://github.com/rust-lang/project-stable-mir. fn foo() -> () { let mut _0: (); diff --git a/tests/ui/rustc_public-ir-print/basic_function.stdout b/tests/ui/rustc_public-ir-print/basic_function.stdout index 319d9c1dc699..dc885e009e91 100644 --- a/tests/ui/rustc_public-ir-print/basic_function.stdout +++ b/tests/ui/rustc_public-ir-print/basic_function.stdout @@ -1,4 +1,4 @@ -// WARNING: This is highly experimental output it's intended for stable-mir developers only. +// WARNING: This is highly experimental output it's intended for rustc_public developers only. // If you find a bug or want to improve the output open a issue at https://github.com/rust-lang/project-stable-mir. fn foo(_1: i32) -> i32 { let mut _0: i32; diff --git a/tests/ui/rustc_public-ir-print/operands.stdout b/tests/ui/rustc_public-ir-print/operands.stdout index 37c5ec1a95e6..a4b1c07f3a0b 100644 --- a/tests/ui/rustc_public-ir-print/operands.stdout +++ b/tests/ui/rustc_public-ir-print/operands.stdout @@ -1,4 +1,4 @@ -// WARNING: This is highly experimental output it's intended for stable-mir developers only. +// WARNING: This is highly experimental output it's intended for rustc_public developers only. // If you find a bug or want to improve the output open a issue at https://github.com/rust-lang/project-stable-mir. fn operands(_1: u8) -> () { let mut _0: (); From 208687e9d39add66f4a4cd846fcaae1387caabfa Mon Sep 17 00:00:00 2001 From: The rustc-josh-sync Cronjob Bot Date: Fri, 18 Jul 2025 19:04:50 +0000 Subject: [PATCH 082/183] Prepare for merging from rust-lang/rust This updates the rust-version file to 82310651b93a594a3fd69015e1562186a080d94c. --- library/compiler-builtins/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/compiler-builtins/rust-version b/library/compiler-builtins/rust-version index 73183983599f..a4db05a87968 100644 --- a/library/compiler-builtins/rust-version +++ b/library/compiler-builtins/rust-version @@ -1 +1 @@ -d087f112b7d1323446c7b39a8b616aee7fa56b3d +82310651b93a594a3fd69015e1562186a080d94c From 3fb1af39876d1d3fadc48b1f66edb52bcfc3d04a Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Fri, 18 Jul 2025 16:02:38 -0700 Subject: [PATCH 083/183] enzyme submodule update --- src/tools/enzyme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/enzyme b/src/tools/enzyme index b5098d515d5e..2cccfba93c16 160000 --- a/src/tools/enzyme +++ b/src/tools/enzyme @@ -1 +1 @@ -Subproject commit b5098d515d5e1bd0f5470553bc0d18da9794ca8b +Subproject commit 2cccfba93c1650f26f1cf8be8aa875a7c1d23fb3 From 42d6b0d8bcdc5a0dfd77fe2daac6f8a8f67ac6cd Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Wed, 18 Jun 2025 15:25:29 -0700 Subject: [PATCH 084/183] make more builder functions generic --- compiler/rustc_codegen_llvm/src/declare.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/declare.rs b/compiler/rustc_codegen_llvm/src/declare.rs index eb75716d768b..960a895a2031 100644 --- a/compiler/rustc_codegen_llvm/src/declare.rs +++ b/compiler/rustc_codegen_llvm/src/declare.rs @@ -215,7 +215,9 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { llfn } +} +impl<'ll, CX: Borrow>> GenericCx<'ll, CX> { /// Declare a global with an intention to define it. /// /// Use this function when you intend to define a global. This function will @@ -234,13 +236,13 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { /// /// Use this function when you intend to define a global without a name. pub(crate) fn define_private_global(&self, ty: &'ll Type) -> &'ll Value { - unsafe { llvm::LLVMRustInsertPrivateGlobal(self.llmod, ty) } + unsafe { llvm::LLVMRustInsertPrivateGlobal(self.llmod(), ty) } } /// Gets declared value by name. pub(crate) fn get_declared_value(&self, name: &str) -> Option<&'ll Value> { debug!("get_declared_value(name={:?})", name); - unsafe { llvm::LLVMRustGetNamedValue(self.llmod, name.as_c_char_ptr(), name.len()) } + unsafe { llvm::LLVMRustGetNamedValue(self.llmod(), name.as_c_char_ptr(), name.len()) } } /// Gets defined or externally defined (AvailableExternally linkage) value by From 634016478ec95c6ff933d32789e663ace78e8f82 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Wed, 18 Jun 2025 15:29:43 -0700 Subject: [PATCH 085/183] add -Zoffload=Enable flag behind -Zunstable-options, to enable gpu (host) code generation --- compiler/rustc_codegen_llvm/src/back/lto.rs | 6 +++++ compiler/rustc_codegen_ssa/src/back/write.rs | 2 ++ compiler/rustc_interface/src/tests.rs | 9 ++++--- compiler/rustc_session/src/config.rs | 19 +++++++++++++- compiler/rustc_session/src/options.rs | 27 ++++++++++++++++++++ 5 files changed, 58 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs index 655e1c953737..b050a69eece9 100644 --- a/compiler/rustc_codegen_llvm/src/back/lto.rs +++ b/compiler/rustc_codegen_llvm/src/back/lto.rs @@ -668,6 +668,12 @@ pub(crate) fn run_pass_manager( write::llvm_optimize(cgcx, dcx, module, None, config, opt_level, opt_stage, stage)?; } + if enable_gpu && !thin { + let cx = + SimpleCx::new(module.module_llvm.llmod(), &module.module_llvm.llcx, cgcx.pointer_size); + crate::builder::gpu_offload::handle_gpu_code(cgcx, &cx); + } + if cfg!(llvm_enzyme) && enable_ad && !thin { let cx = SimpleCx::new(module.module_llvm.llmod(), &module.module_llvm.llcx, cgcx.pointer_size); diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index 50a7cba300b4..24e0a4eb5333 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -120,6 +120,7 @@ pub struct ModuleConfig { pub emit_lifetime_markers: bool, pub llvm_plugins: Vec, pub autodiff: Vec, + pub offload: Vec, } impl ModuleConfig { @@ -268,6 +269,7 @@ impl ModuleConfig { emit_lifetime_markers: sess.emit_lifetime_markers(), llvm_plugins: if_regular!(sess.opts.unstable_opts.llvm_plugins.clone(), vec![]), autodiff: if_regular!(sess.opts.unstable_opts.autodiff.clone(), vec![]), + offload: if_regular!(sess.opts.unstable_opts.offload.clone(), vec![]), } } diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index 360b5629e9d6..8771bb440504 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -13,10 +13,10 @@ use rustc_session::config::{ CoverageOptions, DebugInfo, DumpMonoStatsFormat, ErrorOutputType, ExternEntry, ExternLocation, Externs, FmtDebug, FunctionReturn, InliningThreshold, Input, InstrumentCoverage, InstrumentXRay, LinkSelfContained, LinkerPluginLto, LocationDetail, LtoCli, MirIncludeSpans, - NextSolverConfig, OomStrategy, Options, OutFileName, OutputType, OutputTypes, PAuthKey, PacRet, - Passes, PatchableFunctionEntry, Polonius, ProcMacroExecutionStrategy, Strip, SwitchWithOptPath, - SymbolManglingVersion, WasiExecModel, build_configuration, build_session_options, - rustc_optgroups, + NextSolverConfig, Offload, OomStrategy, Options, OutFileName, OutputType, OutputTypes, + PAuthKey, PacRet, Passes, PatchableFunctionEntry, Polonius, ProcMacroExecutionStrategy, Strip, + SwitchWithOptPath, SymbolManglingVersion, WasiExecModel, build_configuration, + build_session_options, rustc_optgroups, }; use rustc_session::lint::Level; use rustc_session::search_paths::SearchPath; @@ -833,6 +833,7 @@ fn test_unstable_options_tracking_hash() { tracked!(no_profiler_runtime, true); tracked!(no_trait_vptr, true); tracked!(no_unique_section_names, true); + tracked!(offload, vec![Offload::Enable]); tracked!(on_broken_pipe, OnBrokenPipe::Kill); tracked!(oom, OomStrategy::Panic); tracked!(osx_rpath_install_name, true); diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index d6215e1de043..7bea8685724a 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -226,6 +226,13 @@ pub enum CoverageLevel { Mcdc, } +// The different settings that the `-Z offload` flag can have. +#[derive(Clone, Copy, PartialEq, Hash, Debug)] +pub enum Offload { + /// Enable the llvm offload pipeline + Enable, +} + /// The different settings that the `-Z autodiff` flag can have. #[derive(Clone, PartialEq, Hash, Debug)] pub enum AutoDiff { @@ -2706,6 +2713,15 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M ) } + if !nightly_options::is_unstable_enabled(matches) + && unstable_opts.offload.contains(&Offload::Enable) + { + early_dcx.early_fatal( + "`-Zoffload=Enable` also requires `-Zunstable-options` \ + and a nightly compiler", + ) + } + let target_triple = parse_target_triple(early_dcx, matches); // Ensure `-Z unstable-options` is required when using the unstable `-C link-self-contained` and @@ -3178,7 +3194,7 @@ pub(crate) mod dep_tracking { AutoDiff, BranchProtection, CFGuard, CFProtection, CollapseMacroDebuginfo, CoverageOptions, CrateType, DebugInfo, DebugInfoCompression, ErrorOutputType, FmtDebug, FunctionReturn, InliningThreshold, InstrumentCoverage, InstrumentXRay, LinkerPluginLto, LocationDetail, - LtoCli, MirStripDebugInfo, NextSolverConfig, OomStrategy, OptLevel, OutFileName, + LtoCli, MirStripDebugInfo, NextSolverConfig, Offload, OomStrategy, OptLevel, OutFileName, OutputType, OutputTypes, PatchableFunctionEntry, Polonius, RemapPathScopeComponents, ResolveDocLinks, SourceFileHashAlgorithm, SplitDwarfKind, SwitchWithOptPath, SymbolManglingVersion, WasiExecModel, @@ -3225,6 +3241,7 @@ pub(crate) mod dep_tracking { impl_dep_tracking_hash_via_hash!( (), AutoDiff, + Offload, bool, usize, NonZero, diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 2bdde2f887a3..b33e3815ea44 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -726,6 +726,7 @@ mod desc { pub(crate) const parse_list_with_polarity: &str = "a comma-separated list of strings, with elements beginning with + or -"; pub(crate) const parse_autodiff: &str = "a comma separated list of settings: `Enable`, `PrintSteps`, `PrintTA`, `PrintTAFn`, `PrintAA`, `PrintPerf`, `PrintModBefore`, `PrintModAfter`, `PrintModFinal`, `PrintPasses`, `NoPostopt`, `LooseTypes`, `Inline`"; + pub(crate) const parse_offload: &str = "a comma separated list of settings: `Enable`"; pub(crate) const parse_comma_list: &str = "a comma-separated list of strings"; pub(crate) const parse_opt_comma_list: &str = parse_comma_list; pub(crate) const parse_number: &str = "a number"; @@ -1357,6 +1358,27 @@ pub mod parse { } } + pub(crate) fn parse_offload(slot: &mut Vec, v: Option<&str>) -> bool { + let Some(v) = v else { + *slot = vec![]; + return true; + }; + let mut v: Vec<&str> = v.split(",").collect(); + v.sort_unstable(); + for &val in v.iter() { + let variant = match val { + "Enable" => Offload::Enable, + _ => { + // FIXME(ZuseZ4): print an error saying which value is not recognized + return false; + } + }; + slot.push(variant); + } + + true + } + pub(crate) fn parse_autodiff(slot: &mut Vec, v: Option<&str>) -> bool { let Some(v) = v else { *slot = vec![]; @@ -2401,6 +2423,11 @@ options! { "do not use unique names for text and data sections when -Z function-sections is used"), normalize_docs: bool = (false, parse_bool, [TRACKED], "normalize associated items in rustdoc when generating documentation"), + offload: Vec = (Vec::new(), parse_offload, [TRACKED], + "a list of offload flags to enable + Mandatory setting: + `=Enable` + Currently the only option available"), on_broken_pipe: OnBrokenPipe = (OnBrokenPipe::Default, parse_on_broken_pipe, [TRACKED], "behavior of std::io::ErrorKind::BrokenPipe (SIGPIPE)"), oom: OomStrategy = (OomStrategy::Abort, parse_oom_strategy, [TRACKED], From 5958ebe829429e3595e8211e6cb1b0328d515ab7 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Wed, 2 Jul 2025 16:35:57 -0700 Subject: [PATCH 086/183] add various wrappers for gpu code generation --- compiler/rustc_codegen_llvm/src/builder.rs | 69 +++++++++++++++++++ compiler/rustc_codegen_llvm/src/context.rs | 18 ++++- .../rustc_codegen_llvm/src/llvm/enzyme_ffi.rs | 10 ++- compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 8 +++ .../rustc_llvm/llvm-wrapper/RustWrapper.cpp | 37 ++++++++++ 5 files changed, 140 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 514923ad6f37..0ade9edb0d2e 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -3,6 +3,7 @@ use std::ops::Deref; use std::{iter, ptr}; pub(crate) mod autodiff; +pub(crate) mod gpu_offload; use libc::{c_char, c_uint, size_t}; use rustc_abi as abi; @@ -117,6 +118,74 @@ impl<'a, 'll, CX: Borrow>> GenericBuilder<'a, 'll, CX> { } bx } + + // The generic builder has less functionality and thus (unlike the other alloca) we can not + // easily jump to the beginning of the function to place our allocas there. We trust the user + // to manually do that. FIXME(offload): improve the genericCx and add more llvm wrappers to + // handle this. + pub(crate) fn direct_alloca(&mut self, ty: &'ll Type, align: Align, name: &str) -> &'ll Value { + let val = unsafe { + let alloca = llvm::LLVMBuildAlloca(self.llbuilder, ty, UNNAMED); + llvm::LLVMSetAlignment(alloca, align.bytes() as c_uint); + // Cast to default addrspace if necessary + llvm::LLVMBuildPointerCast(self.llbuilder, alloca, self.cx.type_ptr(), UNNAMED) + }; + if name != "" { + let name = std::ffi::CString::new(name).unwrap(); + llvm::set_value_name(val, &name.as_bytes()); + } + val + } + + pub(crate) fn inbounds_gep( + &mut self, + ty: &'ll Type, + ptr: &'ll Value, + indices: &[&'ll Value], + ) -> &'ll Value { + unsafe { + llvm::LLVMBuildGEPWithNoWrapFlags( + self.llbuilder, + ty, + ptr, + indices.as_ptr(), + indices.len() as c_uint, + UNNAMED, + GEPNoWrapFlags::InBounds, + ) + } + } + + pub(crate) fn store(&mut self, val: &'ll Value, ptr: &'ll Value, align: Align) -> &'ll Value { + debug!("Store {:?} -> {:?}", val, ptr); + assert_eq!(self.cx.type_kind(self.cx.val_ty(ptr)), TypeKind::Pointer); + unsafe { + let store = llvm::LLVMBuildStore(self.llbuilder, val, ptr); + llvm::LLVMSetAlignment(store, align.bytes() as c_uint); + store + } + } + + pub(crate) fn load(&mut self, ty: &'ll Type, ptr: &'ll Value, align: Align) -> &'ll Value { + unsafe { + let load = llvm::LLVMBuildLoad2(self.llbuilder, ty, ptr, UNNAMED); + llvm::LLVMSetAlignment(load, align.bytes() as c_uint); + load + } + } + + fn memset(&mut self, ptr: &'ll Value, fill_byte: &'ll Value, size: &'ll Value, align: Align) { + unsafe { + llvm::LLVMRustBuildMemSet( + self.llbuilder, + ptr, + align.bytes() as c_uint, + fill_byte, + size, + false, + ); + } + } } /// Empty string, to be used where LLVM expects an instruction name, indicating diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 6a23becaa96f..afbc2971dd78 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -211,7 +211,7 @@ pub(crate) unsafe fn create_module<'ll>( // Ensure the data-layout values hardcoded remain the defaults. { - let tm = crate::back::write::create_informational_target_machine(tcx.sess, false); + let tm = crate::back::write::create_informational_target_machine(sess, false); unsafe { llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, tm.raw()); } @@ -680,6 +680,22 @@ impl<'ll, CX: Borrow>> GenericCx<'ll, CX> { unsafe { llvm::LLVMConstInt(ty, val, llvm::False) } } + pub(crate) fn get_const_i64(&self, n: u64) -> &'ll Value { + self.get_const_int(self.type_i64(), n) + } + + pub(crate) fn get_const_i32(&self, n: u64) -> &'ll Value { + self.get_const_int(self.type_i32(), n) + } + + pub(crate) fn get_const_i16(&self, n: u64) -> &'ll Value { + self.get_const_int(self.type_i16(), n) + } + + pub(crate) fn get_const_i8(&self, n: u64) -> &'ll Value { + self.get_const_int(self.type_i8(), n) + } + pub(crate) fn get_function(&self, name: &str) -> Option<&'ll Value> { let name = SmallCStr::new(name); unsafe { llvm::LLVMGetNamedFunction((**self).borrow().llmod, name.as_ptr()) } diff --git a/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs index c696b8d8ff25..56d756e52cce 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs @@ -4,7 +4,7 @@ use libc::{c_char, c_uint}; use super::MetadataKindId; use super::ffi::{AttributeKind, BasicBlock, Metadata, Module, Type, Value}; -use crate::llvm::Bool; +use crate::llvm::{Bool, Builder}; #[link(name = "llvm-wrapper", kind = "static")] unsafe extern "C" { @@ -31,6 +31,14 @@ unsafe extern "C" { index: c_uint, kind: AttributeKind, ); + pub(crate) fn LLVMRustPositionBefore<'a>(B: &'a Builder<'_>, I: &'a Value); + pub(crate) fn LLVMRustPositionAfter<'a>(B: &'a Builder<'_>, I: &'a Value); + pub(crate) fn LLVMRustGetFunctionCall( + F: &Value, + name: *const c_char, + NameLen: libc::size_t, + ) -> Option<&Value>; + } unsafe extern "C" { diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 0b1e632cbc42..c2dd29334cd5 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -1138,6 +1138,11 @@ unsafe extern "C" { Count: c_uint, Packed: Bool, ) -> &'a Value; + pub(crate) fn LLVMConstNamedStruct<'a>( + StructTy: &'a Type, + ConstantVals: *const &'a Value, + Count: c_uint, + ) -> &'a Value; pub(crate) fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value; // Constant expressions @@ -1217,6 +1222,8 @@ unsafe extern "C" { ) -> &'a BasicBlock; // Operations on instructions + pub(crate) fn LLVMGetInstructionParent(Inst: &Value) -> &BasicBlock; + pub(crate) fn LLVMGetCalledValue(CallInst: &Value) -> Option<&Value>; pub(crate) fn LLVMIsAInstruction(Val: &Value) -> Option<&Value>; pub(crate) fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock; pub(crate) fn LLVMGetOperand(Val: &Value, Index: c_uint) -> Option<&Value>; @@ -2556,6 +2563,7 @@ unsafe extern "C" { pub(crate) fn LLVMRustSetDataLayoutFromTargetMachine<'a>(M: &'a Module, TM: &'a TargetMachine); + pub(crate) fn LLVMRustPositionBuilderPastAllocas<'a>(B: &Builder<'a>, Fn: &'a Value); pub(crate) fn LLVMRustPositionBuilderAtStart<'a>(B: &Builder<'a>, BB: &'a BasicBlock); pub(crate) fn LLVMRustSetModulePICLevel(M: &Module); diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 90aa9188c830..82568ed4ae17 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1591,12 +1591,49 @@ extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B, LLVMValueRef Dst, MaybeAlign(DstAlign), IsVolatile)); } +extern "C" void LLVMRustPositionBuilderPastAllocas(LLVMBuilderRef B, + LLVMValueRef Fn) { + Function *F = unwrap(Fn); + unwrap(B)->SetInsertPointPastAllocas(F); +} extern "C" void LLVMRustPositionBuilderAtStart(LLVMBuilderRef B, LLVMBasicBlockRef BB) { auto Point = unwrap(BB)->getFirstInsertionPt(); unwrap(B)->SetInsertPoint(unwrap(BB), Point); } +extern "C" void LLVMRustPositionBefore(LLVMBuilderRef B, LLVMValueRef Instr) { + if (auto I = dyn_cast(unwrap(Instr))) { + unwrap(B)->SetInsertPoint(I); + } +} + +extern "C" void LLVMRustPositionAfter(LLVMBuilderRef B, LLVMValueRef Instr) { + if (auto I = dyn_cast(unwrap(Instr))) { + auto J = I->getNextNonDebugInstruction(); + unwrap(B)->SetInsertPoint(J); + } +} + +extern "C" LLVMValueRef +LLVMRustGetFunctionCall(LLVMValueRef Fn, const char *Name, size_t NameLen) { + auto targetName = StringRef(Name, NameLen); + Function *F = unwrap(Fn); + for (auto &BB : *F) { + for (auto &I : BB) { + if (auto *callInst = llvm::dyn_cast(&I)) { + const llvm::Function *calledFunc = callInst->getCalledFunction(); + if (calledFunc && calledFunc->getName() == targetName) { + // Found a call to the target function + return wrap(callInst); + } + } + } + } + + return nullptr; +} + extern "C" bool LLVMRustConstIntGetZExtValue(LLVMValueRef CV, uint64_t *value) { auto C = unwrap(CV); if (C->getBitWidth() > 64) From 4a1a5a42952d05533fd4309ad0f3fe290abbf57c Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Wed, 2 Jul 2025 16:36:30 -0700 Subject: [PATCH 087/183] gpu host code generation --- compiler/rustc_codegen_llvm/src/back/lto.rs | 1 + .../src/builder/gpu_offload.rs | 439 ++++++++++++++++++ compiler/rustc_codegen_llvm/src/common.rs | 9 + compiler/rustc_codegen_llvm/src/lib.rs | 22 +- 4 files changed, 464 insertions(+), 7 deletions(-) create mode 100644 compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs index b050a69eece9..84302009da99 100644 --- a/compiler/rustc_codegen_llvm/src/back/lto.rs +++ b/compiler/rustc_codegen_llvm/src/back/lto.rs @@ -654,6 +654,7 @@ pub(crate) fn run_pass_manager( // We then run the llvm_optimize function a second time, to optimize the code which we generated // in the enzyme differentiation pass. let enable_ad = config.autodiff.contains(&config::AutoDiff::Enable); + let enable_gpu = config.offload.contains(&config::Offload::Enable); let stage = if thin { write::AutodiffStage::PreAD } else { diff --git a/compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs b/compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs new file mode 100644 index 000000000000..1280ab1442a0 --- /dev/null +++ b/compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs @@ -0,0 +1,439 @@ +use std::ffi::CString; + +use llvm::Linkage::*; +use rustc_abi::Align; +use rustc_codegen_ssa::back::write::CodegenContext; +use rustc_codegen_ssa::traits::BaseTypeCodegenMethods; + +use crate::builder::SBuilder; +use crate::common::AsCCharPtr; +use crate::llvm::AttributePlace::Function; +use crate::llvm::{self, Linkage, Type, Value}; +use crate::{LlvmCodegenBackend, SimpleCx, attributes}; + +pub(crate) fn handle_gpu_code<'ll>( + _cgcx: &CodegenContext, + cx: &'ll SimpleCx<'_>, +) { + // The offload memory transfer type for each kernel + let mut o_types = vec![]; + let mut kernels = vec![]; + let offload_entry_ty = add_tgt_offload_entry(&cx); + for num in 0..9 { + let kernel = cx.get_function(&format!("kernel_{num}")); + if let Some(kernel) = kernel { + o_types.push(gen_define_handling(&cx, kernel, offload_entry_ty, num)); + kernels.push(kernel); + } + } + + gen_call_handling(&cx, &kernels, &o_types); +} + +// What is our @1 here? A magic global, used in our data_{begin/update/end}_mapper: +// @0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1 +// @1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 22, ptr @0 }, align 8 +fn generate_at_one<'ll>(cx: &'ll SimpleCx<'_>) -> &'ll llvm::Value { + // @0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1 + let unknown_txt = ";unknown;unknown;0;0;;"; + let c_entry_name = CString::new(unknown_txt).unwrap(); + let c_val = c_entry_name.as_bytes_with_nul(); + let initializer = crate::common::bytes_in_context(cx.llcx, c_val); + let at_zero = add_unnamed_global(&cx, &"", initializer, PrivateLinkage); + llvm::set_alignment(at_zero, Align::ONE); + + // @1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 22, ptr @0 }, align 8 + let struct_ident_ty = cx.type_named_struct("struct.ident_t"); + let struct_elems = vec![ + cx.get_const_i32(0), + cx.get_const_i32(2), + cx.get_const_i32(0), + cx.get_const_i32(22), + at_zero, + ]; + let struct_elems_ty: Vec<_> = struct_elems.iter().map(|&x| cx.val_ty(x)).collect(); + let initializer = crate::common::named_struct(struct_ident_ty, &struct_elems); + cx.set_struct_body(struct_ident_ty, &struct_elems_ty, false); + let at_one = add_unnamed_global(&cx, &"", initializer, PrivateLinkage); + llvm::set_alignment(at_one, Align::EIGHT); + at_one +} + +pub(crate) fn add_tgt_offload_entry<'ll>(cx: &'ll SimpleCx<'_>) -> &'ll llvm::Type { + let offload_entry_ty = cx.type_named_struct("struct.__tgt_offload_entry"); + let tptr = cx.type_ptr(); + let ti64 = cx.type_i64(); + let ti32 = cx.type_i32(); + let ti16 = cx.type_i16(); + // For each kernel to run on the gpu, we will later generate one entry of this type. + // copied from LLVM + // typedef struct { + // uint64_t Reserved; + // uint16_t Version; + // uint16_t Kind; + // uint32_t Flags; Flags associated with the entry (see Target Region Entry Flags) + // void *Address; Address of global symbol within device image (function or global) + // char *SymbolName; + // uint64_t Size; Size of the entry info (0 if it is a function) + // uint64_t Data; + // void *AuxAddr; + // } __tgt_offload_entry; + let entry_elements = vec![ti64, ti16, ti16, ti32, tptr, tptr, ti64, ti64, tptr]; + cx.set_struct_body(offload_entry_ty, &entry_elements, false); + offload_entry_ty +} + +fn gen_tgt_kernel_global<'ll>(cx: &'ll SimpleCx<'_>) { + let kernel_arguments_ty = cx.type_named_struct("struct.__tgt_kernel_arguments"); + let tptr = cx.type_ptr(); + let ti64 = cx.type_i64(); + let ti32 = cx.type_i32(); + let tarr = cx.type_array(ti32, 3); + + // Taken from the LLVM APITypes.h declaration: + //struct KernelArgsTy { + // uint32_t Version = 0; // Version of this struct for ABI compatibility. + // uint32_t NumArgs = 0; // Number of arguments in each input pointer. + // void **ArgBasePtrs = + // nullptr; // Base pointer of each argument (e.g. a struct). + // void **ArgPtrs = nullptr; // Pointer to the argument data. + // int64_t *ArgSizes = nullptr; // Size of the argument data in bytes. + // int64_t *ArgTypes = nullptr; // Type of the data (e.g. to / from). + // void **ArgNames = nullptr; // Name of the data for debugging, possibly null. + // void **ArgMappers = nullptr; // User-defined mappers, possibly null. + // uint64_t Tripcount = + // 0; // Tripcount for the teams / distribute loop, 0 otherwise. + // struct { + // uint64_t NoWait : 1; // Was this kernel spawned with a `nowait` clause. + // uint64_t IsCUDA : 1; // Was this kernel spawned via CUDA. + // uint64_t Unused : 62; + // } Flags = {0, 0, 0}; + // // The number of teams (for x,y,z dimension). + // uint32_t NumTeams[3] = {0, 0, 0}; + // // The number of threads (for x,y,z dimension). + // uint32_t ThreadLimit[3] = {0, 0, 0}; + // uint32_t DynCGroupMem = 0; // Amount of dynamic cgroup memory requested. + //}; + let kernel_elements = + vec![ti32, ti32, tptr, tptr, tptr, tptr, tptr, tptr, ti64, ti64, tarr, tarr, ti32]; + + cx.set_struct_body(kernel_arguments_ty, &kernel_elements, false); + // For now we don't handle kernels, so for now we just add a global dummy + // to make sure that the __tgt_offload_entry is defined and handled correctly. + cx.declare_global("my_struct_global2", kernel_arguments_ty); +} + +fn gen_tgt_data_mappers<'ll>( + cx: &'ll SimpleCx<'_>, +) -> (&'ll llvm::Value, &'ll llvm::Value, &'ll llvm::Value, &'ll llvm::Type) { + let tptr = cx.type_ptr(); + let ti64 = cx.type_i64(); + let ti32 = cx.type_i32(); + + let args = vec![tptr, ti64, ti32, tptr, tptr, tptr, tptr, tptr, tptr]; + let mapper_fn_ty = cx.type_func(&args, cx.type_void()); + let mapper_begin = "__tgt_target_data_begin_mapper"; + let mapper_update = "__tgt_target_data_update_mapper"; + let mapper_end = "__tgt_target_data_end_mapper"; + let begin_mapper_decl = declare_offload_fn(&cx, mapper_begin, mapper_fn_ty); + let update_mapper_decl = declare_offload_fn(&cx, mapper_update, mapper_fn_ty); + let end_mapper_decl = declare_offload_fn(&cx, mapper_end, mapper_fn_ty); + + let nounwind = llvm::AttributeKind::NoUnwind.create_attr(cx.llcx); + attributes::apply_to_llfn(begin_mapper_decl, Function, &[nounwind]); + attributes::apply_to_llfn(update_mapper_decl, Function, &[nounwind]); + attributes::apply_to_llfn(end_mapper_decl, Function, &[nounwind]); + + (begin_mapper_decl, update_mapper_decl, end_mapper_decl, mapper_fn_ty) +} + +fn add_priv_unnamed_arr<'ll>(cx: &SimpleCx<'ll>, name: &str, vals: &[u64]) -> &'ll llvm::Value { + let ti64 = cx.type_i64(); + let mut size_val = Vec::with_capacity(vals.len()); + for &val in vals { + size_val.push(cx.get_const_i64(val)); + } + let initializer = cx.const_array(ti64, &size_val); + add_unnamed_global(cx, name, initializer, PrivateLinkage) +} + +pub(crate) fn add_unnamed_global<'ll>( + cx: &SimpleCx<'ll>, + name: &str, + initializer: &'ll llvm::Value, + l: Linkage, +) -> &'ll llvm::Value { + let llglobal = add_global(cx, name, initializer, l); + llvm::LLVMSetUnnamedAddress(llglobal, llvm::UnnamedAddr::Global); + llglobal +} + +pub(crate) fn add_global<'ll>( + cx: &SimpleCx<'ll>, + name: &str, + initializer: &'ll llvm::Value, + l: Linkage, +) -> &'ll llvm::Value { + let c_name = CString::new(name).unwrap(); + let llglobal: &'ll llvm::Value = llvm::add_global(cx.llmod, cx.val_ty(initializer), &c_name); + llvm::set_global_constant(llglobal, true); + llvm::set_linkage(llglobal, l); + llvm::set_initializer(llglobal, initializer); + llglobal +} + +fn gen_define_handling<'ll>( + cx: &'ll SimpleCx<'_>, + kernel: &'ll llvm::Value, + offload_entry_ty: &'ll llvm::Type, + num: i64, +) -> &'ll llvm::Value { + let types = cx.func_params_types(cx.get_type_of_global(kernel)); + // It seems like non-pointer values are automatically mapped. So here, we focus on pointer (or + // reference) types. + let num_ptr_types = types + .iter() + .map(|&x| matches!(cx.type_kind(x), rustc_codegen_ssa::common::TypeKind::Pointer)) + .count(); + + // We do not know their size anymore at this level, so hardcode a placeholder. + // A follow-up pr will track these from the frontend, where we still have Rust types. + // Then, we will be able to figure out that e.g. `&[f32;256]` will result in 4*256 bytes. + // I decided that 1024 bytes is a great placeholder value for now. + add_priv_unnamed_arr(&cx, &format!(".offload_sizes.{num}"), &vec![1024; num_ptr_types]); + // Here we figure out whether something needs to be copied to the gpu (=1), from the gpu (=2), + // or both to and from the gpu (=3). Other values shouldn't affect us for now. + // A non-mutable reference or pointer will be 1, an array that's not read, but fully overwritten + // will be 2. For now, everything is 3, until we have our frontend set up. + let o_types = + add_priv_unnamed_arr(&cx, &format!(".offload_maptypes.{num}"), &vec![3; num_ptr_types]); + // Next: For each function, generate these three entries. A weak constant, + // the llvm.rodata entry name, and the omp_offloading_entries value + + let name = format!(".kernel_{num}.region_id"); + let initializer = cx.get_const_i8(0); + let region_id = add_unnamed_global(&cx, &name, initializer, WeakAnyLinkage); + + let c_entry_name = CString::new(format!("kernel_{num}")).unwrap(); + let c_val = c_entry_name.as_bytes_with_nul(); + let offload_entry_name = format!(".offloading.entry_name.{num}"); + + let initializer = crate::common::bytes_in_context(cx.llcx, c_val); + let llglobal = add_unnamed_global(&cx, &offload_entry_name, initializer, InternalLinkage); + llvm::set_alignment(llglobal, Align::ONE); + llvm::set_section(llglobal, c".llvm.rodata.offloading"); + + // Not actively used yet, for calling real kernels + let name = format!(".offloading.entry.kernel_{num}"); + + // See the __tgt_offload_entry documentation above. + let reserved = cx.get_const_i64(0); + let version = cx.get_const_i16(1); + let kind = cx.get_const_i16(1); + let flags = cx.get_const_i32(0); + let size = cx.get_const_i64(0); + let data = cx.get_const_i64(0); + let aux_addr = cx.const_null(cx.type_ptr()); + let elems = vec![reserved, version, kind, flags, region_id, llglobal, size, data, aux_addr]; + + let initializer = crate::common::named_struct(offload_entry_ty, &elems); + let c_name = CString::new(name).unwrap(); + let llglobal = llvm::add_global(cx.llmod, offload_entry_ty, &c_name); + llvm::set_global_constant(llglobal, true); + llvm::set_linkage(llglobal, WeakAnyLinkage); + llvm::set_initializer(llglobal, initializer); + llvm::set_alignment(llglobal, Align::ONE); + let c_section_name = CString::new(".omp_offloading_entries").unwrap(); + llvm::set_section(llglobal, &c_section_name); + o_types +} + +fn declare_offload_fn<'ll>( + cx: &'ll SimpleCx<'_>, + name: &str, + ty: &'ll llvm::Type, +) -> &'ll llvm::Value { + crate::declare::declare_simple_fn( + cx, + name, + llvm::CallConv::CCallConv, + llvm::UnnamedAddr::No, + llvm::Visibility::Default, + ty, + ) +} + +// For each kernel *call*, we now use some of our previous declared globals to move data to and from +// the gpu. We don't have a proper frontend yet, so we assume that every call to a kernel function +// from main is intended to run on the GPU. For now, we only handle the data transfer part of it. +// If two consecutive kernels use the same memory, we still move it to the host and back to the gpu. +// Since in our frontend users (by default) don't have to specify data transfer, this is something +// we should optimize in the future! We also assume that everything should be copied back and forth, +// but sometimes we can directly zero-allocate on the device and only move back, or if something is +// immutable, we might only copy it to the device, but not back. +// +// Current steps: +// 0. Alloca some variables for the following steps +// 1. set insert point before kernel call. +// 2. generate all the GEPS and stores, to be used in 3) +// 3. generate __tgt_target_data_begin calls to move data to the GPU +// +// unchanged: keep kernel call. Later move the kernel to the GPU +// +// 4. set insert point after kernel call. +// 5. generate all the GEPS and stores, to be used in 6) +// 6. generate __tgt_target_data_end calls to move data from the GPU +fn gen_call_handling<'ll>( + cx: &'ll SimpleCx<'_>, + _kernels: &[&'ll llvm::Value], + o_types: &[&'ll llvm::Value], +) { + // %struct.__tgt_bin_desc = type { i32, ptr, ptr, ptr } + let tptr = cx.type_ptr(); + let ti32 = cx.type_i32(); + let tgt_bin_desc_ty = vec![ti32, tptr, tptr, tptr]; + let tgt_bin_desc = cx.type_named_struct("struct.__tgt_bin_desc"); + cx.set_struct_body(tgt_bin_desc, &tgt_bin_desc_ty, false); + + gen_tgt_kernel_global(&cx); + let (begin_mapper_decl, _, end_mapper_decl, fn_ty) = gen_tgt_data_mappers(&cx); + + let main_fn = cx.get_function("main"); + let Some(main_fn) = main_fn else { return }; + let kernel_name = "kernel_1"; + let call = unsafe { + llvm::LLVMRustGetFunctionCall(main_fn, kernel_name.as_c_char_ptr(), kernel_name.len()) + }; + let Some(kernel_call) = call else { + return; + }; + let kernel_call_bb = unsafe { llvm::LLVMGetInstructionParent(kernel_call) }; + let called = unsafe { llvm::LLVMGetCalledValue(kernel_call).unwrap() }; + let mut builder = SBuilder::build(cx, kernel_call_bb); + + let types = cx.func_params_types(cx.get_type_of_global(called)); + let num_args = types.len() as u64; + + // Step 0) + // %struct.__tgt_bin_desc = type { i32, ptr, ptr, ptr } + // %6 = alloca %struct.__tgt_bin_desc, align 8 + unsafe { llvm::LLVMRustPositionBuilderPastAllocas(builder.llbuilder, main_fn) }; + + let tgt_bin_desc_alloca = builder.direct_alloca(tgt_bin_desc, Align::EIGHT, "EmptyDesc"); + + let ty = cx.type_array(cx.type_ptr(), num_args); + // Baseptr are just the input pointer to the kernel, stored in a local alloca + let a1 = builder.direct_alloca(ty, Align::EIGHT, ".offload_baseptrs"); + // Ptrs are the result of a gep into the baseptr, at least for our trivial types. + let a2 = builder.direct_alloca(ty, Align::EIGHT, ".offload_ptrs"); + // These represent the sizes in bytes, e.g. the entry for `&[f64; 16]` will be 8*16. + let ty2 = cx.type_array(cx.type_i64(), num_args); + let a4 = builder.direct_alloca(ty2, Align::EIGHT, ".offload_sizes"); + // Now we allocate once per function param, a copy to be passed to one of our maps. + let mut vals = vec![]; + let mut geps = vec![]; + let i32_0 = cx.get_const_i32(0); + for (index, in_ty) in types.iter().enumerate() { + // get function arg, store it into the alloca, and read it. + let p = llvm::get_param(called, index as u32); + let name = llvm::get_value_name(p); + let name = str::from_utf8(&name).unwrap(); + let arg_name = format!("{name}.addr"); + let alloca = builder.direct_alloca(in_ty, Align::EIGHT, &arg_name); + + builder.store(p, alloca, Align::EIGHT); + let val = builder.load(in_ty, alloca, Align::EIGHT); + let gep = builder.inbounds_gep(cx.type_f32(), val, &[i32_0]); + vals.push(val); + geps.push(gep); + } + + // Step 1) + unsafe { llvm::LLVMRustPositionBefore(builder.llbuilder, kernel_call) }; + builder.memset(tgt_bin_desc_alloca, cx.get_const_i8(0), cx.get_const_i64(32), Align::EIGHT); + + let mapper_fn_ty = cx.type_func(&[cx.type_ptr()], cx.type_void()); + let register_lib_decl = declare_offload_fn(&cx, "__tgt_register_lib", mapper_fn_ty); + let unregister_lib_decl = declare_offload_fn(&cx, "__tgt_unregister_lib", mapper_fn_ty); + let init_ty = cx.type_func(&[], cx.type_void()); + let init_rtls_decl = declare_offload_fn(cx, "__tgt_init_all_rtls", init_ty); + + // call void @__tgt_register_lib(ptr noundef %6) + builder.call(mapper_fn_ty, register_lib_decl, &[tgt_bin_desc_alloca], None); + // call void @__tgt_init_all_rtls() + builder.call(init_ty, init_rtls_decl, &[], None); + + for i in 0..num_args { + let idx = cx.get_const_i32(i); + let gep1 = builder.inbounds_gep(ty, a1, &[i32_0, idx]); + builder.store(vals[i as usize], gep1, Align::EIGHT); + let gep2 = builder.inbounds_gep(ty, a2, &[i32_0, idx]); + builder.store(geps[i as usize], gep2, Align::EIGHT); + let gep3 = builder.inbounds_gep(ty2, a4, &[i32_0, idx]); + // As mentioned above, we don't use Rust type information yet. So for now we will just + // assume that we have 1024 bytes, 256 f32 values. + // FIXME(offload): write an offload frontend and handle arbitrary types. + builder.store(cx.get_const_i64(1024), gep3, Align::EIGHT); + } + + // For now we have a very simplistic indexing scheme into our + // offload_{baseptrs,ptrs,sizes}. We will probably improve this along with our gpu frontend pr. + fn get_geps<'a, 'll>( + builder: &mut SBuilder<'a, 'll>, + cx: &'ll SimpleCx<'ll>, + ty: &'ll Type, + ty2: &'ll Type, + a1: &'ll Value, + a2: &'ll Value, + a4: &'ll Value, + ) -> (&'ll Value, &'ll Value, &'ll Value) { + let i32_0 = cx.get_const_i32(0); + + let gep1 = builder.inbounds_gep(ty, a1, &[i32_0, i32_0]); + let gep2 = builder.inbounds_gep(ty, a2, &[i32_0, i32_0]); + let gep3 = builder.inbounds_gep(ty2, a4, &[i32_0, i32_0]); + (gep1, gep2, gep3) + } + + fn generate_mapper_call<'a, 'll>( + builder: &mut SBuilder<'a, 'll>, + cx: &'ll SimpleCx<'ll>, + geps: (&'ll Value, &'ll Value, &'ll Value), + o_type: &'ll Value, + fn_to_call: &'ll Value, + fn_ty: &'ll Type, + num_args: u64, + s_ident_t: &'ll Value, + ) { + let nullptr = cx.const_null(cx.type_ptr()); + let i64_max = cx.get_const_i64(u64::MAX); + let num_args = cx.get_const_i32(num_args); + let args = + vec![s_ident_t, i64_max, num_args, geps.0, geps.1, geps.2, o_type, nullptr, nullptr]; + builder.call(fn_ty, fn_to_call, &args, None); + } + + // Step 2) + let s_ident_t = generate_at_one(&cx); + let o = o_types[0]; + let geps = get_geps(&mut builder, &cx, ty, ty2, a1, a2, a4); + generate_mapper_call(&mut builder, &cx, geps, o, begin_mapper_decl, fn_ty, num_args, s_ident_t); + + // Step 3) + // Here we will add code for the actual kernel launches in a follow-up PR. + // FIXME(offload): launch kernels + + // Step 4) + unsafe { llvm::LLVMRustPositionAfter(builder.llbuilder, kernel_call) }; + + let geps = get_geps(&mut builder, &cx, ty, ty2, a1, a2, a4); + generate_mapper_call(&mut builder, &cx, geps, o, end_mapper_decl, fn_ty, num_args, s_ident_t); + + builder.call(mapper_fn_ty, unregister_lib_decl, &[tgt_bin_desc_alloca], None); + + // With this we generated the following begin and end mappers. We could easily generate the + // update mapper in an update. + // call void @__tgt_target_data_begin_mapper(ptr @1, i64 -1, i32 3, ptr %27, ptr %28, ptr %29, ptr @.offload_maptypes, ptr null, ptr null) + // call void @__tgt_target_data_update_mapper(ptr @1, i64 -1, i32 2, ptr %46, ptr %47, ptr %48, ptr @.offload_maptypes.1, ptr null, ptr null) + // call void @__tgt_target_data_end_mapper(ptr @1, i64 -1, i32 3, ptr %49, ptr %50, ptr %51, ptr @.offload_maptypes, ptr null, ptr null) +} diff --git a/compiler/rustc_codegen_llvm/src/common.rs b/compiler/rustc_codegen_llvm/src/common.rs index f9ab96b57895..f29fefb66f0f 100644 --- a/compiler/rustc_codegen_llvm/src/common.rs +++ b/compiler/rustc_codegen_llvm/src/common.rs @@ -118,6 +118,10 @@ impl<'ll, CX: Borrow>> GenericCx<'ll, CX> { r } } + + pub(crate) fn const_null(&self, t: &'ll Type) -> &'ll Value { + unsafe { llvm::LLVMConstNull(t) } + } } impl<'ll, 'tcx> ConstCodegenMethods for CodegenCx<'ll, 'tcx> { @@ -377,6 +381,11 @@ pub(crate) fn bytes_in_context<'ll>(llcx: &'ll llvm::Context, bytes: &[u8]) -> & } } +pub(crate) fn named_struct<'ll>(ty: &'ll Type, elts: &[&'ll Value]) -> &'ll Value { + let len = c_uint::try_from(elts.len()).expect("LLVMConstStructInContext elements len overflow"); + unsafe { llvm::LLVMConstNamedStruct(ty, elts.as_ptr(), len) } +} + fn struct_in_context<'ll>( llcx: &'ll llvm::Context, elts: &[&'ll Value], diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 6db4e122ad6e..aaf21f9ada9a 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -412,6 +412,20 @@ impl ModuleLlvm { } } + fn tm_from_cgcx( + cgcx: &CodegenContext, + name: &str, + dcx: DiagCtxtHandle<'_>, + ) -> Result { + let tm_factory_config = TargetMachineFactoryConfig::new(cgcx, name); + match (cgcx.tm_factory)(tm_factory_config) { + Ok(m) => Ok(m), + Err(e) => { + return Err(dcx.emit_almost_fatal(ParseTargetMachineConfig(e))); + } + } + } + fn parse( cgcx: &CodegenContext, name: &CStr, @@ -421,13 +435,7 @@ impl ModuleLlvm { unsafe { let llcx = llvm::LLVMRustContextCreate(cgcx.fewer_names); let llmod_raw = back::lto::parse_module(llcx, name, buffer, dcx)?; - let tm_factory_config = TargetMachineFactoryConfig::new(cgcx, name.to_str().unwrap()); - let tm = match (cgcx.tm_factory)(tm_factory_config) { - Ok(m) => m, - Err(e) => { - return Err(dcx.emit_almost_fatal(ParseTargetMachineConfig(e))); - } - }; + let tm = ModuleLlvm::tm_from_cgcx(cgcx, name.to_str().unwrap(), dcx)?; Ok(ModuleLlvm { llmod_raw, llcx, tm: ManuallyDrop::new(tm) }) } From e2ab312c9408761faf64723c77cd4ba4a58792bc Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Fri, 18 Jul 2025 16:00:04 -0700 Subject: [PATCH 088/183] add gpu offload codegen host side test --- tests/codegen/gpu_offload/gpu_host.rs | 80 +++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 tests/codegen/gpu_offload/gpu_host.rs diff --git a/tests/codegen/gpu_offload/gpu_host.rs b/tests/codegen/gpu_offload/gpu_host.rs new file mode 100644 index 000000000000..513e27426bc0 --- /dev/null +++ b/tests/codegen/gpu_offload/gpu_host.rs @@ -0,0 +1,80 @@ +//@ compile-flags: -Zoffload=Enable -Zunstable-options -C opt-level=3 -Clto=fat +//@ no-prefer-dynamic +//@ needs-enzyme + +// This test is verifying that we generate __tgt_target_data_*_mapper before and after a call to the +// kernel_1. Better documentation to what each global or variable means is available in the gpu +// offlaod code, or the LLVM offload documentation. This code does not launch any GPU kernels yet, +// and will be rewritten once a proper offload frontend has landed. +// +// We currently only handle memory transfer for specific calls to functions named `kernel_{num}`, +// when inside of a function called main. This, too, is a temporary workaround for not having a +// frontend. + +#![no_main] + +#[unsafe(no_mangle)] +fn main() { + let mut x = [3.0; 256]; + kernel_1(&mut x); + core::hint::black_box(&x); +} + +// CHECK: %struct.__tgt_offload_entry = type { i64, i16, i16, i32, ptr, ptr, i64, i64, ptr } +// CHECK: %struct.__tgt_kernel_arguments = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, [3 x i32], [3 x i32], i32 } +// CHECK: %struct.ident_t = type { i32, i32, i32, i32, ptr } +// CHECK: %struct.__tgt_bin_desc = type { i32, ptr, ptr, ptr } + +// CHECK: @.offload_sizes.1 = private unnamed_addr constant [1 x i64] [i64 1024] +// CHECK: @.offload_maptypes.1 = private unnamed_addr constant [1 x i64] [i64 3] +// CHECK: @.kernel_1.region_id = weak unnamed_addr constant i8 0 +// CHECK: @.offloading.entry_name.1 = internal unnamed_addr constant [9 x i8] c"kernel_1\00", section ".llvm.rodata.offloading", align 1 +// CHECK: @.offloading.entry.kernel_1 = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @.kernel_1.region_id, ptr @.offloading.entry_name.1, i64 0, i64 0, ptr null }, section ".omp_offloading_entries", align 1 +// CHECK: @my_struct_global2 = external global %struct.__tgt_kernel_arguments +// CHECK: @0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1 +// CHECK: @1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 22, ptr @0 }, align 8 + +// CHECK: Function Attrs: +// CHECK-NEXT: define{{( dso_local)?}} void @main() +// CHECK-NEXT: start: +// CHECK-NEXT: %0 = alloca [8 x i8], align 8 +// CHECK-NEXT: %x = alloca [1024 x i8], align 16 +// CHECK-NEXT: %EmptyDesc = alloca %struct.__tgt_bin_desc, align 8 +// CHECK-NEXT: %.offload_baseptrs = alloca [1 x ptr], align 8 +// CHECK-NEXT: %.offload_ptrs = alloca [1 x ptr], align 8 +// CHECK-NEXT: %.offload_sizes = alloca [1 x i64], align 8 +// CHECK-NEXT: %x.addr = alloca ptr, align 8 +// CHECK-NEXT: store ptr %x, ptr %x.addr, align 8 +// CHECK-NEXT: %1 = load ptr, ptr %x.addr, align 8 +// CHECK-NEXT: %2 = getelementptr inbounds float, ptr %1, i32 0 +// CHECK: call void @llvm.memset.p0.i64(ptr align 8 %EmptyDesc, i8 0, i64 32, i1 false) +// CHECK-NEXT: call void @__tgt_register_lib(ptr %EmptyDesc) +// CHECK-NEXT: call void @__tgt_init_all_rtls() +// CHECK-NEXT: %3 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 +// CHECK-NEXT: store ptr %1, ptr %3, align 8 +// CHECK-NEXT: %4 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 +// CHECK-NEXT: store ptr %2, ptr %4, align 8 +// CHECK-NEXT: %5 = getelementptr inbounds [1 x i64], ptr %.offload_sizes, i32 0, i32 0 +// CHECK-NEXT: store i64 1024, ptr %5, align 8 +// CHECK-NEXT: %6 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 +// CHECK-NEXT: %7 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 +// CHECK-NEXT: %8 = getelementptr inbounds [1 x i64], ptr %.offload_sizes, i32 0, i32 0 +// CHECK-NEXT: call void @__tgt_target_data_begin_mapper(ptr @1, i64 -1, i32 1, ptr %6, ptr %7, ptr %8, ptr @.offload_maptypes.1, ptr null, ptr null) +// CHECK-NEXT: call void @kernel_1(ptr noalias noundef nonnull align 4 dereferenceable(1024) %x) +// CHECK-NEXT: %9 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 +// CHECK-NEXT: %10 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 +// CHECK-NEXT: %11 = getelementptr inbounds [1 x i64], ptr %.offload_sizes, i32 0, i32 0 +// CHECK-NEXT: call void @__tgt_target_data_end_mapper(ptr @1, i64 -1, i32 1, ptr %9, ptr %10, ptr %11, ptr @.offload_maptypes.1, ptr null, ptr null) +// CHECK-NEXT: call void @__tgt_unregister_lib(ptr %EmptyDesc) +// CHECK: store ptr %x, ptr %0, align 8 +// CHECK-NEXT: call void asm sideeffect "", "r,~{memory}"(ptr nonnull %0) +// CHECK: ret void +// CHECK-NEXT: } + +#[unsafe(no_mangle)] +#[inline(never)] +pub fn kernel_1(x: &mut [f32; 256]) { + for i in 0..256 { + x[i] = 21.0; + } +} From c068599173f8670caeeda252f115cc28445f7df0 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Fri, 18 Jul 2025 16:01:05 -0700 Subject: [PATCH 089/183] add unstable-books doc for offload --- src/doc/unstable-book/src/compiler-flags/offload.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/doc/unstable-book/src/compiler-flags/offload.md diff --git a/src/doc/unstable-book/src/compiler-flags/offload.md b/src/doc/unstable-book/src/compiler-flags/offload.md new file mode 100644 index 000000000000..4266e8c11a28 --- /dev/null +++ b/src/doc/unstable-book/src/compiler-flags/offload.md @@ -0,0 +1,8 @@ +# `offload` + +The tracking issue for this feature is: [#131513](https://github.com/rust-lang/rust/issues/131513). + +------------------------ + +This feature will later allow you to run functions on GPUs. It is work in progress. +Set the `-Zoffload=Enable` compiler flag to experiment with it. From 2a037503efef730fd8c62e5145345fcf816b2243 Mon Sep 17 00:00:00 2001 From: beepster4096 <19316085+beepster4096@users.noreply.github.com> Date: Fri, 18 Jul 2025 14:00:00 -0700 Subject: [PATCH 090/183] debug impls for drop elaborators --- compiler/rustc_mir_transform/src/elaborate_drops.rs | 4 ++-- compiler/rustc_mir_transform/src/shim.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_mir_transform/src/elaborate_drops.rs b/compiler/rustc_mir_transform/src/elaborate_drops.rs index b4fa2be1d00e..58dff4514a04 100644 --- a/compiler/rustc_mir_transform/src/elaborate_drops.rs +++ b/compiler/rustc_mir_transform/src/elaborate_drops.rs @@ -253,8 +253,8 @@ struct ElaborateDropsCtxt<'a, 'tcx> { } impl fmt::Debug for ElaborateDropsCtxt<'_, '_> { - fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { - Ok(()) + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ElaborateDropsCtxt").finish_non_exhaustive() } } diff --git a/compiler/rustc_mir_transform/src/shim.rs b/compiler/rustc_mir_transform/src/shim.rs index cdbc74cdfa84..6c65b072bec0 100644 --- a/compiler/rustc_mir_transform/src/shim.rs +++ b/compiler/rustc_mir_transform/src/shim.rs @@ -434,8 +434,8 @@ pub(super) struct DropShimElaborator<'a, 'tcx> { } impl fmt::Debug for DropShimElaborator<'_, '_> { - fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { - Ok(()) + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { + f.debug_struct("DropShimElaborator").finish_non_exhaustive() } } From b8bcb4dd64859a1930238bc9e36ba96be92bd2f3 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Sat, 19 Jul 2025 04:57:12 +0000 Subject: [PATCH 091/183] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index f9457b3e447d..601acc00bd6b 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -e4662966273ed58b51f9ff8d682accc202aa1210 +ebd8557637b33cc09b6ee8273f3154d5d3af6a15 From 196833ccf2742f0975cd084aac4f354c025638d4 Mon Sep 17 00:00:00 2001 From: A4-Tacks Date: Sat, 19 Jul 2025 13:38:01 +0800 Subject: [PATCH 092/183] Fix ide-assist: Deref transtive --- .../src/handlers/generate_deref.rs | 26 +++++++++++++++++-- .../crates/ide-assists/src/utils.rs | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_deref.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_deref.rs index c7b97dcd231d..55a09c5d775d 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_deref.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_deref.rs @@ -10,7 +10,7 @@ use syntax::{ use crate::{ AssistId, assist_context::{AssistContext, Assists, SourceChangeBuilder}, - utils::generate_trait_impl_text, + utils::generate_trait_impl_text_intransitive, }; // Assist: generate_deref @@ -150,7 +150,7 @@ fn generate_edit( ), }; let strukt_adt = ast::Adt::Struct(strukt); - let deref_impl = generate_trait_impl_text( + let deref_impl = generate_trait_impl_text_intransitive( &strukt_adt, &trait_path.display(db, edition).to_string(), &impl_code, @@ -227,6 +227,28 @@ impl core::ops::Deref for B { ); } + #[test] + fn test_generate_record_deref_with_generic() { + check_assist( + generate_deref, + r#" +//- minicore: deref +struct A($0T); +"#, + r#" +struct A(T); + +impl core::ops::Deref for A { + type Target = T; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} +"#, + ); + } + #[test] fn test_generate_record_deref_short_path() { check_assist( diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/utils.rs b/src/tools/rust-analyzer/crates/ide-assists/src/utils.rs index b1606fb7ba74..a302964e17bc 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/utils.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/utils.rs @@ -567,6 +567,7 @@ pub(crate) fn generate_impl_text(adt: &ast::Adt, code: &str) -> String { /// /// This is useful for traits like `PartialEq`, since `impl PartialEq for U` often requires `T: PartialEq`. // FIXME: migrate remaining uses to `generate_trait_impl` +#[allow(dead_code)] pub(crate) fn generate_trait_impl_text(adt: &ast::Adt, trait_text: &str, code: &str) -> String { generate_impl_text_inner(adt, Some(trait_text), true, code) } From 54d974324c9770b9368194ca3c916fb5a5b6c9a4 Mon Sep 17 00:00:00 2001 From: A4-Tacks Date: Sat, 19 Jul 2025 15:00:54 +0800 Subject: [PATCH 093/183] Add Deref -> DerefMut for generate_mut_trait_impl --- .../src/handlers/generate_mut_trait_impl.rs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs index 4ddab2cfad00..dc26ec79a74e 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs @@ -134,6 +134,9 @@ fn get_trait_mut(apply_trait: &hir::Trait, famous: FamousDefs<'_, '_>) -> Option if trait_ == famous.core_borrow_Borrow().as_ref() { return Some("BorrowMut"); } + if trait_ == famous.core_ops_Deref().as_ref() { + return Some("DerefMut"); + } None } @@ -142,6 +145,7 @@ fn process_method_name(name: ast::Name) -> Option<(ast::Name, &'static str)> { "index" => "index_mut", "as_ref" => "as_mut", "borrow" => "borrow_mut", + "deref" => "deref_mut", _ => return None, }; Some((name, new_name)) @@ -258,6 +262,39 @@ impl core::convert::AsRef for Foo { &self.0 } } +"#, + ); + + check_assist( + generate_mut_trait_impl, + r#" +//- minicore: deref +struct Foo(i32); + +impl core::ops::Deref$0 for Foo { + type Target = i32; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} +"#, + r#" +struct Foo(i32); + +$0impl core::ops::DerefMut for Foo { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +impl core::ops::Deref for Foo { + type Target = i32; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} "#, ); } From 2f46cde9a4d23c60a3e79680f917da664064c4e1 Mon Sep 17 00:00:00 2001 From: Young-Flash Date: Sat, 19 Jul 2025 16:19:20 +0800 Subject: [PATCH 094/183] minor: remove unused var --- src/tools/rust-analyzer/crates/ide/src/folding_ranges.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide/src/folding_ranges.rs b/src/tools/rust-analyzer/crates/ide/src/folding_ranges.rs index c081796d078c..698fd147789f 100755 --- a/src/tools/rust-analyzer/crates/ide/src/folding_ranges.rs +++ b/src/tools/rust-analyzer/crates/ide/src/folding_ranges.rs @@ -48,7 +48,6 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec { let mut res = vec![]; let mut visited_comments = FxHashSet::default(); let mut visited_nodes = FxHashSet::default(); - let mut merged_fn_bodies = FxHashSet::default(); // regions can be nested, here is a LIFO buffer let mut region_starts: Vec = vec![]; @@ -73,7 +72,7 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec { continue; } - if let Some(body) = fn_node.body() { + if fn_node.body().is_some() { res.push(Fold { range: TextRange::new( node.text_range().start(), @@ -81,7 +80,6 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec { ), kind: FoldKind::Function, }); - merged_fn_bodies.insert(body.syntax().text_range()); continue; } } From 4aa437600818b515d19ec4967005ad5344062734 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 19 Jul 2025 12:30:42 +0200 Subject: [PATCH 095/183] add -Zmiri-no-extra-rounding-error to specifically disable just that part of float-nondet --- src/tools/miri/README.md | 13 ++++++++----- src/tools/miri/src/bin/miri.rs | 2 ++ src/tools/miri/src/eval.rs | 3 +++ src/tools/miri/src/machine.rs | 4 ++++ src/tools/miri/src/math.rs | 2 +- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/tools/miri/README.md b/src/tools/miri/README.md index 7816ce1ac561..7ccd27d7b83e 100644 --- a/src/tools/miri/README.md +++ b/src/tools/miri/README.md @@ -286,11 +286,6 @@ environment variable. We first document the most relevant and most commonly used specific circumstances, but Miri's behavior will also be more stable across versions and targets. This is equivalent to `-Zmiri-fixed-schedule -Zmiri-compare-exchange-weak-failure-rate=0.0 -Zmiri-address-reuse-cross-thread-rate=0.0 -Zmiri-disable-weak-memory-emulation`. -* `-Zmiri-deterministic-floats` makes Miri's floating-point behavior fully deterministic. This means - that operations will always return the preferred NaN, imprecise operations will not have any - random error applied to them, and `min`/`max` as "maybe fused" multiply-add all behave - deterministically. Note that Miri still uses host floats for some operations, so behavior can - still differ depending on the host target and setup. * `-Zmiri-disable-isolation` disables host isolation. As a consequence, the program has access to host resources such as environment variables, file systems, and randomness. @@ -324,6 +319,8 @@ environment variable. We first document the most relevant and most commonly used Can be used without a value; in that case the range defaults to `0..64`. * `-Zmiri-many-seeds-keep-going` tells Miri to really try all the seeds in the given range, even if a failing seed has already been found. This is useful to determine which fraction of seeds fails. +* `-Zmiri-no-extra-rounding-error` stops Miri from adding extra rounding errors to float operations + that do not have a guaranteed precision. * `-Zmiri-num-cpus` states the number of available CPUs to be reported by miri. By default, the number of available CPUs is `1`. Note that this flag does not affect how miri handles threads in any way. @@ -376,6 +373,12 @@ to Miri failing to detect cases of undefined behavior in a program. will always fail and `0.0` means it will never fail. Note that setting it to `1.0` will likely cause hangs, since it means programs using `compare_exchange_weak` cannot make progress. +* `-Zmiri-deterministic-floats` makes Miri's floating-point behavior fully deterministic. This means + that operations will always return the preferred NaN, imprecise operations will not have any + random error applied to them, and `min`/`max` and "maybe fused" multiply-add all behave + deterministically. Note that Miri still uses host floats for some operations, so behavior can + still differ depending on the host target and setup. See `-Zmiri-no-extra-rounding-error` for + a flag that specifically only disables the random error. * `-Zmiri-disable-alignment-check` disables checking pointer alignment, so you can focus on other failures, but it means Miri can miss bugs in your program. Using this flag is **unsound**. diff --git a/src/tools/miri/src/bin/miri.rs b/src/tools/miri/src/bin/miri.rs index 5d9c05807b89..89fa980ff646 100644 --- a/src/tools/miri/src/bin/miri.rs +++ b/src/tools/miri/src/bin/miri.rs @@ -562,6 +562,8 @@ fn main() { miri_config.force_intrinsic_fallback = true; } else if arg == "-Zmiri-deterministic-floats" { miri_config.float_nondet = false; + } else if arg == "-Zmiri-no-extra-rounding-error" { + miri_config.float_rounding_error = false; } else if arg == "-Zmiri-strict-provenance" { miri_config.provenance_mode = ProvenanceMode::Strict; } else if arg == "-Zmiri-permissive-provenance" { diff --git a/src/tools/miri/src/eval.rs b/src/tools/miri/src/eval.rs index be6404f64e8f..3c80e60b772a 100644 --- a/src/tools/miri/src/eval.rs +++ b/src/tools/miri/src/eval.rs @@ -170,6 +170,8 @@ pub struct MiriConfig { pub force_intrinsic_fallback: bool, /// Whether floating-point operations can behave non-deterministically. pub float_nondet: bool, + /// Whether floating-point operations can have a non-deterministic rounding error. + pub float_rounding_error: bool, } impl Default for MiriConfig { @@ -211,6 +213,7 @@ impl Default for MiriConfig { fixed_scheduling: false, force_intrinsic_fallback: false, float_nondet: true, + float_rounding_error: true, } } } diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs index e3e7b0b88a75..ce33c870b4b5 100644 --- a/src/tools/miri/src/machine.rs +++ b/src/tools/miri/src/machine.rs @@ -617,6 +617,8 @@ pub struct MiriMachine<'tcx> { /// Whether floating-point operations can behave non-deterministically. pub float_nondet: bool, + /// Whether floating-point operations can have a non-deterministic rounding error. + pub float_rounding_error: bool, } impl<'tcx> MiriMachine<'tcx> { @@ -775,6 +777,7 @@ impl<'tcx> MiriMachine<'tcx> { mangle_internal_symbol_cache: Default::default(), force_intrinsic_fallback: config.force_intrinsic_fallback, float_nondet: config.float_nondet, + float_rounding_error: config.float_rounding_error, } } @@ -951,6 +954,7 @@ impl VisitProvenance for MiriMachine<'_> { mangle_internal_symbol_cache: _, force_intrinsic_fallback: _, float_nondet: _, + float_rounding_error: _, } = self; threads.visit_provenance(visit); diff --git a/src/tools/miri/src/math.rs b/src/tools/miri/src/math.rs index cf16a5676d68..e9e5a1070c9e 100644 --- a/src/tools/miri/src/math.rs +++ b/src/tools/miri/src/math.rs @@ -15,7 +15,7 @@ pub(crate) fn apply_random_float_error( val: F, err_scale: i32, ) -> F { - if !ecx.machine.float_nondet { + if !ecx.machine.float_nondet || !ecx.machine.float_rounding_error { return val; } From c1242b794f5ced9f49c069b1f9dcd8b3429103d8 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 19 Jul 2025 13:49:01 +0200 Subject: [PATCH 096/183] cargo update --- src/tools/miri/Cargo.lock | 429 ++++++++++++++------------ src/tools/miri/cargo-miri/Cargo.lock | 309 +++++++++++++------ src/tools/miri/miri-script/Cargo.lock | 256 +++++++++------ 3 files changed, 604 insertions(+), 390 deletions(-) diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock index aa6f059cec2c..93db99f7abc7 100644 --- a/src/tools/miri/Cargo.lock +++ b/src/tools/miri/Cargo.lock @@ -4,18 +4,18 @@ version = 4 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aes" @@ -44,40 +44,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "710e8eae58854cdc1790fcb56cca04d712a17be849eeb81da2a724bf4bae2bc4" dependencies = [ "anstyle", - "unicode-width 0.2.0", + "unicode-width 0.2.1", ] [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anyhow" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -91,15 +91,15 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bstr" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" dependencies = [ "memchr", "regex-automata", @@ -108,15 +108,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] @@ -166,18 +166,18 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.17" +version = "1.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" +checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7" dependencies = [ "shlex", ] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "cfg_aliases" @@ -187,34 +187,23 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "num-traits", ] [[package]] name = "chrono-tz" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efdce149c370f133a071ca8ef6ea340b7b88748ab0810097a9e2976eaa34b4f3" +checksum = "a6139a8597ed92cf816dfb33f5dd6cf0bb93a6adc938f11039f371bc5bcd26c3" dependencies = [ "chrono", - "chrono-tz-build", "phf", ] -[[package]] -name = "chrono-tz-build" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f10f8c9340e31fc120ff885fcdb54a0b48e474bbd77cab557f0c30a3e569402" -dependencies = [ - "parse-zoneinfo", - "phf_codegen", -] - [[package]] name = "cipher" version = "0.4.4" @@ -227,27 +216,27 @@ dependencies = [ [[package]] name = "color-eyre" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" +checksum = "e5920befb47832a6d61ee3a3a846565cfa39b331331e68a3b1d1116630f2f26d" dependencies = [ "backtrace", "color-spantrace", "eyre", "indenter", "once_cell", - "owo-colors", + "owo-colors 4.2.2", "tracing-error", ] [[package]] name = "color-spantrace" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" +checksum = "b8b88ea9df13354b55bc7234ebcce36e6ef896aca2e42a15de9e10edce01b427" dependencies = [ "once_cell", - "owo-colors", + "owo-colors 4.2.2", "tracing-core", "tracing-error", ] @@ -277,7 +266,7 @@ dependencies = [ "encode_unicode", "libc", "once_cell", - "unicode-width 0.2.0", + "unicode-width 0.2.1", "windows-sys 0.59.0", ] @@ -333,7 +322,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -344,12 +333,12 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "errno" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -386,20 +375,20 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", @@ -409,9 +398,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "indenter" @@ -428,7 +417,7 @@ dependencies = [ "console", "number_prefix", "portable-atomic", - "unicode-width 0.2.0", + "unicode-width 0.2.1", "web-time", ] @@ -490,15 +479,15 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libffi" -version = "4.0.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9434b6fc77375fb624698d5f8c49d7e80b10d59eb1219afda27d1f824d4074" +checksum = "e7681c6fab541f799a829e44a445a0666cf8d8a6cfebf89419e6aed52c604e87" dependencies = [ "libc", "libffi-sys", @@ -506,28 +495,28 @@ dependencies = [ [[package]] name = "libffi-sys" -version = "3.2.0" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ead36a2496acfc8edd6cc32352110e9478ac5b9b5f5b9856ebd3d28019addb84" +checksum = "7b0d828d367b4450ed08e7d510dc46636cd660055f50d67ac943bfe788767c29" dependencies = [ "cc", ] [[package]] name = "libloading" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets", + "windows-targets 0.53.2", ] [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" dependencies = [ "bitflags", "libc", @@ -535,15 +524,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -557,9 +546,9 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "measureme" -version = "12.0.1" +version = "12.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570a507d8948a66a97f42cbbaf8a6bb9516a51017d4ee949502ad7a10a864395" +checksum = "6ebd1ebda747ae161a4a377bf93f87e18d46faad2331cc0c7d25b84b1d445f49" dependencies = [ "log", "memmap2", @@ -571,9 +560,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memmap2" @@ -586,23 +575,23 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -616,14 +605,14 @@ dependencies = [ "chrono-tz", "colored", "directories", - "getrandom 0.3.2", + "getrandom 0.3.3", "ipc-channel", "libc", "libffi", "libloading", "measureme", "nix", - "rand 0.9.0", + "rand 0.9.1", "regex", "rustc_version", "serde", @@ -663,9 +652,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.32.2" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -688,6 +677,12 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "owo-colors" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" + [[package]] name = "pad" version = "0.1.6" @@ -699,9 +694,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -709,24 +704,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets", -] - -[[package]] -name = "parse-zoneinfo" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" -dependencies = [ - "regex", + "windows-targets 0.52.6", ] [[package]] @@ -740,38 +726,18 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7" dependencies = [ "phf_shared", ] -[[package]] -name = "phf_codegen" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared", - "rand 0.8.5", -] - [[package]] name = "phf_shared" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981" dependencies = [ "siphasher", ] @@ -784,9 +750,9 @@ checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "portable-atomic" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "ppv-lite86" @@ -803,15 +769,15 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abec3fb083c10660b3854367697da94c674e9e82aa7511014dc958beeb7215e9" dependencies = [ - "owo-colors", + "owo-colors 3.5.0", "pad", ] [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -827,9 +793,9 @@ dependencies = [ [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" @@ -844,13 +810,12 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", - "zerocopy", ] [[package]] @@ -879,7 +844,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] @@ -888,14 +853,14 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.2", + "getrandom 0.3.3", ] [[package]] name = "redox_syscall" -version = "0.5.10" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ "bitflags", ] @@ -906,7 +871,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "libredox", "thiserror 2.0.12", ] @@ -942,9 +907,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustc-hash" @@ -975,17 +940,23 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.5" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + [[package]] name = "ryu" version = "1.0.20" @@ -1029,9 +1000,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3" dependencies = [ "itoa", "memchr", @@ -1062,9 +1033,9 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "spanned" @@ -1078,9 +1049,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.100" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -1089,12 +1060,12 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", - "getrandom 0.3.2", + "getrandom 0.3.3", "once_cell", "rustix", "windows-sys 0.59.0", @@ -1142,12 +1113,11 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -1172,9 +1142,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -1247,17 +1217,19 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "uuid" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" dependencies = [ - "getrandom 0.3.2", + "getrandom 0.3.3", + "js-sys", + "wasm-bindgen", ] [[package]] @@ -1274,9 +1246,9 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -1295,6 +1267,7 @@ checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] @@ -1361,7 +1334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ "windows-core", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -1374,7 +1347,7 @@ dependencies = [ "windows-interface", "windows-result", "windows-strings", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -1405,7 +1378,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -1415,16 +1388,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ "windows-result", - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -1433,7 +1397,16 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", ] [[package]] @@ -1442,14 +1415,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] @@ -1458,48 +1447,96 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "wit-bindgen-rt" version = "0.39.0" @@ -1511,18 +1548,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.24" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.24" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", diff --git a/src/tools/miri/cargo-miri/Cargo.lock b/src/tools/miri/cargo-miri/Cargo.lock index d37f8750bde4..8310dfec9390 100644 --- a/src/tools/miri/cargo-miri/Cargo.lock +++ b/src/tools/miri/cargo-miri/Cargo.lock @@ -2,32 +2,23 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - [[package]] name = "anyhow" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] @@ -70,9 +61,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "directories" @@ -92,17 +83,23 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys", + "windows-sys 0.60.2", ] [[package]] -name = "errno" -version = "0.3.11" +name = "equivalent" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.60.2", ] [[package]] @@ -113,20 +110,20 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", @@ -134,6 +131,22 @@ dependencies = [ "wasi 0.14.2+wasi-0.2.4", ] +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" + +[[package]] +name = "indexmap" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +dependencies = [ + "equivalent", + "hashbrown", +] + [[package]] name = "itoa" version = "1.0.15" @@ -142,15 +155,15 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" dependencies = [ "bitflags", "libc", @@ -158,15 +171,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "once_cell" @@ -182,9 +195,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -200,9 +213,9 @@ dependencies = [ [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "redox_users" @@ -210,50 +223,21 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "libredox", "thiserror", ] -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - [[package]] name = "rustc-build-sysroot" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d115ad7e26e0d1337f64ae6598f758194696afc2e9f34c8a6f24582529c3dc" +checksum = "fdb13874a0e55baf4ac3d49d38206aecb31a55b75d6c4d04fd850b53942c8cc8" dependencies = [ "anyhow", - "regex", "rustc_version", "tempfile", + "toml", "walkdir", ] @@ -274,15 +258,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.5" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.60.2", ] [[package]] @@ -331,9 +315,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3" dependencies = [ "itoa", "memchr", @@ -342,10 +326,19 @@ dependencies = [ ] [[package]] -name = "syn" -version = "2.0.100" +name = "serde_spanned" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -354,15 +347,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", - "getrandom 0.3.2", + "getrandom 0.3.3", "once_cell", "rustix", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -385,6 +378,48 @@ dependencies = [ "syn", ] +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + [[package]] name = "unicode-ident" version = "1.0.18" @@ -403,9 +438,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -422,7 +457,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -431,7 +466,16 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", ] [[package]] @@ -440,14 +484,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] @@ -456,48 +516,105 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" +dependencies = [ + "memchr", +] + [[package]] name = "wit-bindgen-rt" version = "0.39.0" diff --git a/src/tools/miri/miri-script/Cargo.lock b/src/tools/miri/miri-script/Cargo.lock index 3494a241ec50..0e11f6efd100 100644 --- a/src/tools/miri/miri-script/Cargo.lock +++ b/src/tools/miri/miri-script/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" dependencies = [ "anstyle", "anstyle-parse", @@ -19,62 +19,62 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", - "once_cell", - "windows-sys", + "once_cell_polyfill", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "clap" -version = "4.5.35" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" +checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" dependencies = [ "clap_builder", "clap_derive", @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.35" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" +checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" dependencies = [ "anstream", "anstyle", @@ -94,9 +94,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.32" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" dependencies = [ "heck", "proc-macro2", @@ -106,15 +106,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "directories" @@ -134,7 +134,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys", + "windows-sys 0.60.2", ] [[package]] @@ -157,12 +157,12 @@ checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" [[package]] name = "errno" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.60.2", ] [[package]] @@ -173,20 +173,20 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", @@ -223,15 +223,15 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" dependencies = [ "bitflags", "libc", @@ -239,21 +239,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.15" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - -[[package]] -name = "linux-raw-sys" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "miri-script" @@ -282,6 +276,12 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + [[package]] name = "option-ext" version = "0.2.0" @@ -296,9 +296,9 @@ checksum = "a6e819bbd49d5939f682638fa54826bf1650abddcd65d000923de8ad63cc7d15" [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -314,9 +314,9 @@ dependencies = [ [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "redox_users" @@ -324,7 +324,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "libredox", "thiserror", ] @@ -340,28 +340,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.44" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys 0.4.15", - "windows-sys", -] - -[[package]] -name = "rustix" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys 0.9.3", - "windows-sys", + "linux-raw-sys", + "windows-sys 0.60.2", ] [[package]] @@ -407,9 +394,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3" dependencies = [ "itoa", "memchr", @@ -431,9 +418,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.100" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -442,15 +429,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", - "getrandom 0.3.2", + "getrandom 0.3.3", "once_cell", - "rustix 1.0.5", - "windows-sys", + "rustix", + "windows-sys 0.59.0", ] [[package]] @@ -497,9 +484,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -512,13 +499,13 @@ dependencies = [ [[package]] name = "which" -version = "7.0.2" +version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2774c861e1f072b3aadc02f8ba886c26ad6321567ecc294c935434cad06f1283" +checksum = "24d643ce3fd3e5b54854602a080f34fb10ab75e0b813ee32d00ca2b44fa74762" dependencies = [ "either", "env_home", - "rustix 0.38.44", + "rustix", "winsafe", ] @@ -528,7 +515,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -537,7 +524,16 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", ] [[package]] @@ -546,14 +542,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] @@ -562,48 +574,96 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winsafe" version = "0.0.19" From bb79e79cd121e4ccc72720e922aab53ae1350a22 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 19 Jul 2025 13:34:58 +0200 Subject: [PATCH 097/183] bump colored dep --- src/tools/miri/Cargo.lock | 13 +++++++++++-- src/tools/miri/Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock index 93db99f7abc7..fb06fac17ebd 100644 --- a/src/tools/miri/Cargo.lock +++ b/src/tools/miri/Cargo.lock @@ -251,6 +251,15 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "colored" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "comma" version = "1.0.0" @@ -603,7 +612,7 @@ dependencies = [ "capstone", "chrono", "chrono-tz", - "colored", + "colored 3.0.0", "directories", "getrandom 0.3.3", "ipc-channel", @@ -1189,7 +1198,7 @@ dependencies = [ "cargo-platform", "cargo_metadata", "color-eyre", - "colored", + "colored 2.2.0", "comma", "crossbeam-channel", "indicatif", diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index b3503acf0c0e..1e7381461c68 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -50,7 +50,7 @@ capstone = { version = "0.13", optional = true } [dev-dependencies] ui_test = "0.29.1" -colored = "2" +colored = "3" rustc_version = "0.4" regex = "1.5.5" tempfile = "3" From 4bd80887d8025353971c7724b8e526c1e7a66fb9 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 19 Jul 2025 13:51:26 +0200 Subject: [PATCH 098/183] bump ipc-channel --- src/tools/miri/Cargo.lock | 46 ++++++--------------------------------- src/tools/miri/Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 40 deletions(-) diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock index fb06fac17ebd..6aeb5276f61f 100644 --- a/src/tools/miri/Cargo.lock +++ b/src/tools/miri/Cargo.lock @@ -441,17 +441,16 @@ dependencies = [ [[package]] name = "ipc-channel" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8251fb7bcd9ccd3725ed8deae9fe7db8e586495c9eb5b0c52e6233e5e75ea" +checksum = "5b1c98b70019c830a1fc39cecfe1f60ff99c4122f0a189697c810c90ec545c14" dependencies = [ "bincode", "crossbeam-channel", "fnv", - "lazy_static", "libc", "mio", - "rand 0.8.5", + "rand", "serde", "tempfile", "uuid", @@ -598,7 +597,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "log", "wasi 0.11.1+wasi-snapshot-preview1", "windows-sys 0.59.0", ] @@ -621,7 +619,7 @@ dependencies = [ "libloading", "measureme", "nix", - "rand 0.9.1", + "rand", "regex", "rustc_version", "serde", @@ -806,35 +804,14 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - [[package]] name = "rand" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", + "rand_chacha", + "rand_core", ] [[package]] @@ -844,16 +821,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.16", + "rand_core", ] [[package]] diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index 1e7381461c68..6031ea03bbe4 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -45,7 +45,7 @@ serde = { version = "1.0.219", features = ["derive"], optional = true } [target.'cfg(target_os = "linux")'.dependencies] nix = { version = "0.30.1", features = ["mman", "ptrace", "signal"], optional = true } -ipc-channel = { version = "0.19.0", optional = true } +ipc-channel = { version = "0.20.0", optional = true } capstone = { version = "0.13", optional = true } [dev-dependencies] From 0b8f558cc9e79c5a4847cf3326cc9c62cfccc3bb Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 19 Jul 2025 13:53:42 +0200 Subject: [PATCH 099/183] bump ui_test --- src/tools/miri/Cargo.lock | 9 +++++---- src/tools/miri/Cargo.toml | 2 +- src/tools/miri/tests/ui.rs | 8 +++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock index 6aeb5276f61f..0af4181dc154 100644 --- a/src/tools/miri/Cargo.lock +++ b/src/tools/miri/Cargo.lock @@ -1016,10 +1016,11 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "spanned" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86af297923fbcfd107c20a189a6e9c872160df71a7190ae4a7a6c5dce4b2feb6" +checksum = "c92d4b0c055fde758f086eb4a6e73410247df8a3837fd606d2caeeaf72aa566d" dependencies = [ + "anyhow", "bstr", "color-eyre", ] @@ -1156,9 +1157,9 @@ checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "ui_test" -version = "0.29.2" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1211b1111c752c73b33073d2958072be08825fd97c9ab4d83444da361a06634b" +checksum = "b56a6897cc4bb6f8daf1939b0b39cd9645856997f46f4d0b3e3cb7122dfe9251" dependencies = [ "annotate-snippets", "anyhow", diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index 6031ea03bbe4..d293af5cea20 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -49,7 +49,7 @@ ipc-channel = { version = "0.20.0", optional = true } capstone = { version = "0.13", optional = true } [dev-dependencies] -ui_test = "0.29.1" +ui_test = "0.30.2" colored = "3" rustc_version = "0.4" regex = "1.5.5" diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index e521269586de..a4463d69341c 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -13,7 +13,8 @@ use ui_test::custom_flags::edition::Edition; use ui_test::dependencies::DependencyBuilder; use ui_test::per_test_config::TestConfig; use ui_test::spanned::Spanned; -use ui_test::{CommandBuilder, Config, Format, Match, ignore_output_conflict, status_emitter}; +use ui_test::status_emitter::StatusEmitter; +use ui_test::{CommandBuilder, Config, Match, ignore_output_conflict}; #[derive(Copy, Clone, Debug)] enum Mode { @@ -216,10 +217,7 @@ fn run_tests( // This could be used to overwrite the `Config` on a per-test basis. |_, _| {}, // No GHA output as that would also show in the main rustc repo. - match args.format { - Format::Terse => status_emitter::Text::quiet(), - Format::Pretty => status_emitter::Text::verbose(), - }, + Box::::from(args.format), ) } From f32ec588ad3524d5ea3e9145a88e94b0b42df0ed Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 19 Jul 2025 13:54:44 +0200 Subject: [PATCH 100/183] bump cargo-metadata --- src/tools/miri/cargo-miri/Cargo.lock | 376 ++++++++++++++++++++++++++- src/tools/miri/cargo-miri/Cargo.toml | 2 +- 2 files changed, 372 insertions(+), 6 deletions(-) diff --git a/src/tools/miri/cargo-miri/Cargo.lock b/src/tools/miri/cargo-miri/Cargo.lock index 8310dfec9390..b3f5dafab643 100644 --- a/src/tools/miri/cargo-miri/Cargo.lock +++ b/src/tools/miri/cargo-miri/Cargo.lock @@ -8,6 +8,12 @@ version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + [[package]] name = "bitflags" version = "2.9.1" @@ -38,21 +44,38 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.9" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +checksum = "84982c6c0ae343635a3a4ee6dedef965513735c8b183caa7289fa6e27399ebd4" dependencies = [ "serde", ] [[package]] -name = "cargo_metadata" -version = "0.19.2" +name = "cargo-util-schemas" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +checksum = "7dc1a6f7b5651af85774ae5a34b4e8be397d9cf4bc063b7e6dbd99a841837830" +dependencies = [ + "semver", + "serde", + "serde-untagged", + "serde-value", + "thiserror", + "toml", + "unicode-xid", + "url", +] + +[[package]] +name = "cargo_metadata" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cfca2aaa699835ba88faf58a06342a314a950d2b9686165e038286c30316868" dependencies = [ "camino", "cargo-platform", + "cargo-util-schemas", "semver", "serde", "serde_json", @@ -86,12 +109,33 @@ dependencies = [ "windows-sys 0.60.2", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "erased-serde" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] + [[package]] name = "errno" version = "0.3.13" @@ -108,6 +152,15 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + [[package]] name = "getrandom" version = "0.2.16" @@ -137,6 +190,113 @@ version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + [[package]] name = "indexmap" version = "2.10.0" @@ -175,12 +335,27 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + [[package]] name = "memchr" version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + [[package]] name = "once_cell" version = "1.21.3" @@ -193,6 +368,30 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + [[package]] name = "proc-macro2" version = "1.0.95" @@ -302,6 +501,27 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-untagged" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "299d9c19d7d466db4ab10addd5703e4c615dec2a5a16dbbafe191045e87ee66e" +dependencies = [ + "erased-serde", + "serde", + "typeid", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.219" @@ -334,6 +554,18 @@ dependencies = [ "serde", ] +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "syn" version = "2.0.104" @@ -345,6 +577,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tempfile" version = "3.20.0" @@ -378,6 +621,16 @@ dependencies = [ "syn", ] +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "toml" version = "0.8.23" @@ -420,12 +673,41 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + [[package]] name = "unicode-ident" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "walkdir" version = "2.5.0" @@ -623,3 +905,87 @@ checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ "bitflags", ] + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/src/tools/miri/cargo-miri/Cargo.toml b/src/tools/miri/cargo-miri/Cargo.toml index e08733959ccc..77cb1df8e747 100644 --- a/src/tools/miri/cargo-miri/Cargo.toml +++ b/src/tools/miri/cargo-miri/Cargo.toml @@ -17,7 +17,7 @@ doctest = false # and no doc tests directories = "6" rustc_version = "0.4" serde_json = "1.0.40" -cargo_metadata = "0.19" +cargo_metadata = "0.21" rustc-build-sysroot = "0.5.8" # Enable some feature flags that dev-dependencies need but dependencies From 6ce164d1df26b5efd4cdd950e418269480870619 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 19 Jul 2025 13:57:51 +0200 Subject: [PATCH 101/183] ditch which dependency --- src/tools/miri/miri-script/Cargo.lock | 25 ---------------------- src/tools/miri/miri-script/Cargo.toml | 1 - src/tools/miri/miri-script/src/commands.rs | 7 +++--- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/tools/miri/miri-script/Cargo.lock b/src/tools/miri/miri-script/Cargo.lock index 0e11f6efd100..a049bfcbccd6 100644 --- a/src/tools/miri/miri-script/Cargo.lock +++ b/src/tools/miri/miri-script/Cargo.lock @@ -149,12 +149,6 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" -[[package]] -name = "env_home" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" - [[package]] name = "errno" version = "0.3.13" @@ -266,7 +260,6 @@ dependencies = [ "shell-words", "tempfile", "walkdir", - "which", "xshell", ] @@ -497,18 +490,6 @@ dependencies = [ "wit-bindgen-rt", ] -[[package]] -name = "which" -version = "7.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d643ce3fd3e5b54854602a080f34fb10ab75e0b813ee32d00ca2b44fa74762" -dependencies = [ - "either", - "env_home", - "rustix", - "winsafe", -] - [[package]] name = "winapi-util" version = "0.1.9" @@ -664,12 +645,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" -[[package]] -name = "winsafe" -version = "0.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" - [[package]] name = "wit-bindgen-rt" version = "0.39.0" diff --git a/src/tools/miri/miri-script/Cargo.toml b/src/tools/miri/miri-script/Cargo.toml index 9240788d6bce..b3f82cd1d504 100644 --- a/src/tools/miri/miri-script/Cargo.toml +++ b/src/tools/miri/miri-script/Cargo.toml @@ -14,7 +14,6 @@ rust-version = "1.85" # This is needed to make this package build on stable when the parent package uses unstable cargo features. [dependencies] -which = "7" walkdir = "2.3" itertools = "0.14" path_macro = "1.0" diff --git a/src/tools/miri/miri-script/src/commands.rs b/src/tools/miri/miri-script/src/commands.rs index e6ebdf54e385..9aaad9ca04a9 100644 --- a/src/tools/miri/miri-script/src/commands.rs +++ b/src/tools/miri/miri-script/src/commands.rs @@ -198,9 +198,6 @@ impl Command { } fn toolchain(flags: Vec) -> Result<()> { - // Make sure rustup-toolchain-install-master is installed. - which::which("rustup-toolchain-install-master") - .context("Please install rustup-toolchain-install-master by running 'cargo install rustup-toolchain-install-master'")?; let sh = Shell::new()?; sh.change_dir(miri_dir()?); let new_commit = sh.read_file("rust-version")?.trim().to_owned(); @@ -227,7 +224,9 @@ impl Command { // Install and setup new toolchain. cmd!(sh, "rustup toolchain uninstall miri").run()?; - cmd!(sh, "rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy {flags...} -- {new_commit}").run()?; + cmd!(sh, "rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy {flags...} -- {new_commit}") + .run() + .context("Failed to run rustup-toolchain-install-master. If it is not installed, run 'cargo install rustup-toolchain-install-master'.")?; cmd!(sh, "rustup override set miri").run()?; // Cleanup. cmd!(sh, "cargo clean").run()?; From 6a67a34b73ea8660d02d9220c1f4c7435f1f2082 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 19 Jul 2025 14:07:43 +0200 Subject: [PATCH 102/183] move and update test dependencies --- src/tools/miri/cargo-miri/src/util.rs | 7 +- src/tools/miri/miri-script/src/main.rs | 2 +- .../deps}/Cargo.lock | 234 ++++++++++++------ .../deps}/Cargo.toml | 2 +- .../deps}/src/main.rs | 0 src/tools/miri/tests/ui.rs | 2 +- 6 files changed, 170 insertions(+), 77 deletions(-) rename src/tools/miri/{test_dependencies => tests/deps}/Cargo.lock (66%) rename src/tools/miri/{test_dependencies => tests/deps}/Cargo.toml (96%) rename src/tools/miri/{test_dependencies => tests/deps}/src/main.rs (100%) diff --git a/src/tools/miri/cargo-miri/src/util.rs b/src/tools/miri/cargo-miri/src/util.rs index 43b2a1b61733..82c6a9293578 100644 --- a/src/tools/miri/cargo-miri/src/util.rs +++ b/src/tools/miri/cargo-miri/src/util.rs @@ -129,7 +129,8 @@ pub fn exec(mut cmd: Command) -> ! { // On non-Unix imitate POSIX exec as closely as we can #[cfg(not(unix))] { - let exit_status = cmd.status().expect("failed to run command"); + let exit_status = + cmd.status().unwrap_or_else(|err| panic!("failed to run `{cmd:?}`:\n{err}")); std::process::exit(exit_status.code().unwrap_or(-1)) } // On Unix targets, actually exec. @@ -138,8 +139,8 @@ pub fn exec(mut cmd: Command) -> ! { #[cfg(unix)] { use std::os::unix::process::CommandExt; - let error = cmd.exec(); - panic!("failed to run command: {error}") + let err = cmd.exec(); + panic!("failed to run `{cmd:?}`:\n{err}") } } diff --git a/src/tools/miri/miri-script/src/main.rs b/src/tools/miri/miri-script/src/main.rs index 673d658cf1d5..e41df662ca28 100644 --- a/src/tools/miri/miri-script/src/main.rs +++ b/src/tools/miri/miri-script/src/main.rs @@ -75,7 +75,7 @@ pub enum Command { /// /// Also respects MIRIFLAGS environment variable. Run { - /// Build the program with the dependencies declared in `test_dependencies/Cargo.toml`. + /// Build the program with the dependencies declared in `tests/deps/Cargo.toml`. #[arg(long)] dep: bool, /// Show build progress. diff --git a/src/tools/miri/test_dependencies/Cargo.lock b/src/tools/miri/tests/deps/Cargo.lock similarity index 66% rename from src/tools/miri/test_dependencies/Cargo.lock rename to src/tools/miri/tests/deps/Cargo.lock index 276c518e74f3..4b783ebdc4ee 100644 --- a/src/tools/miri/test_dependencies/Cargo.lock +++ b/src/tools/miri/tests/deps/Cargo.lock @@ -13,15 +13,15 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", "cfg-if", @@ -29,20 +29,20 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "bytes" @@ -52,18 +52,18 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "errno" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -85,22 +85,22 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", @@ -116,9 +116,20 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "io-uring" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" +dependencies = [ + "bitflags", + "cfg-if", + "libc", +] [[package]] name = "js-sys" @@ -132,15 +143,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.171" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "log" @@ -150,28 +161,28 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "miniz_oxide" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -180,21 +191,21 @@ version = "0.1.0" dependencies = [ "cfg-if", "getrandom 0.1.16", - "getrandom 0.2.15", - "getrandom 0.3.2", + "getrandom 0.2.16", + "getrandom 0.3.3", "libc", "num_cpus", "page_size", "tempfile", "tokio", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ "hermit-abi", "libc", @@ -233,9 +244,9 @@ checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -251,43 +262,49 @@ dependencies = [ [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustix" -version = "1.0.5" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ "libc", ] [[package]] -name = "socket2" -version = "0.5.9" +name = "slab" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", "windows-sys 0.52.0", @@ -295,9 +312,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.100" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -306,12 +323,12 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", - "getrandom 0.3.2", + "getrandom 0.3.3", "once_cell", "rustix", "windows-sys 0.59.0", @@ -319,16 +336,18 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.2" +version = "1.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" +checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" dependencies = [ "backtrace", "bytes", + "io-uring", "libc", "mio", "pin-project-lite", "signal-hook-registry", + "slab", "socket2", "tokio-macros", "windows-sys 0.52.0", @@ -359,9 +378,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -457,7 +476,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -466,7 +485,16 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", ] [[package]] @@ -475,14 +503,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] @@ -491,48 +535,96 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "wit-bindgen-rt" version = "0.39.0" diff --git a/src/tools/miri/test_dependencies/Cargo.toml b/src/tools/miri/tests/deps/Cargo.toml similarity index 96% rename from src/tools/miri/test_dependencies/Cargo.toml rename to src/tools/miri/tests/deps/Cargo.toml index 35555723f5d6..d85723f0915f 100644 --- a/src/tools/miri/test_dependencies/Cargo.toml +++ b/src/tools/miri/tests/deps/Cargo.toml @@ -25,7 +25,7 @@ page_size = "0.6" tokio = { version = "1", features = ["macros", "rt-multi-thread", "time", "net", "fs", "sync", "signal", "io-util"] } [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.59", features = [ +windows-sys = { version = "0.60", features = [ "Win32_Foundation", "Win32_System_Threading", "Win32_Storage_FileSystem", diff --git a/src/tools/miri/test_dependencies/src/main.rs b/src/tools/miri/tests/deps/src/main.rs similarity index 100% rename from src/tools/miri/test_dependencies/src/main.rs rename to src/tools/miri/tests/deps/src/main.rs diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index a4463d69341c..cb915b11b679 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -142,7 +142,7 @@ fn miri_config( envs: vec![("RUSTFLAGS".into(), None)], ..CommandBuilder::cargo() }, - crate_manifest_path: Path::new("test_dependencies").join("Cargo.toml"), + crate_manifest_path: Path::new("tests/deps").join("Cargo.toml"), build_std: None, bless_lockfile: bless, }, From bb46b8cf6a1683972d0e564494226ef4b60f9619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 11 Jul 2025 15:14:58 +0200 Subject: [PATCH 103/183] Allow selecting check tool `Mode` based on `Builder` --- src/bootstrap/src/core/build_steps/check.rs | 39 +++++++++++++-------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index 1d30886a86aa..01b0915dfaf2 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -494,7 +494,8 @@ macro_rules! tool_check_step { // The part of this path after the final '/' is also used as a display name. path: $path:literal $(, alt_path: $alt_path:literal )* - , mode: $mode:path + // Closure that returns `Mode` based on the passed `&Builder<'_>` + , mode: $mode:expr $(, allow_features: $allow_features:expr )? $(, default: $default:literal )? $( , )? @@ -518,10 +519,13 @@ macro_rules! tool_check_step { fn make_run(run: RunConfig<'_>) { let target = run.target; - let build_compiler = prepare_compiler_for_check(run.builder, target, $mode); + let builder = run.builder; + let mode = $mode(builder); + + let build_compiler = prepare_compiler_for_check(run.builder, target, mode); // It doesn't make sense to cross-check bootstrap tools - if $mode == Mode::ToolBootstrap && target != run.builder.host_target { + if mode == Mode::ToolBootstrap && target != run.builder.host_target { println!("WARNING: not checking bootstrap tool {} for target {target} as it is a bootstrap (host-only) tool", stringify!($path)); return; }; @@ -536,7 +540,8 @@ macro_rules! tool_check_step { $( _value = $allow_features; )? _value }; - run_tool_check_step(builder, build_compiler, target, $path, $mode, allow_features); + let mode = $mode(builder); + run_tool_check_step(builder, build_compiler, target, $path, mode, allow_features); } fn metadata(&self) -> Option { @@ -593,43 +598,47 @@ fn run_tool_check_step( tool_check_step!(Rustdoc { path: "src/tools/rustdoc", alt_path: "src/librustdoc", - mode: Mode::ToolRustc + mode: |_builder| Mode::ToolRustc }); // Clippy, miri and Rustfmt are hybrids. They are external tools, but use a git subtree instead // of a submodule. Since the SourceType only drives the deny-warnings // behavior, treat it as in-tree so that any new warnings in clippy will be // rejected. -tool_check_step!(Clippy { path: "src/tools/clippy", mode: Mode::ToolRustc }); -tool_check_step!(Miri { path: "src/tools/miri", mode: Mode::ToolRustc }); -tool_check_step!(CargoMiri { path: "src/tools/miri/cargo-miri", mode: Mode::ToolRustc }); -tool_check_step!(Rustfmt { path: "src/tools/rustfmt", mode: Mode::ToolRustc }); +tool_check_step!(Clippy { path: "src/tools/clippy", mode: |_builder| Mode::ToolRustc }); +tool_check_step!(Miri { path: "src/tools/miri", mode: |_builder| Mode::ToolRustc }); +tool_check_step!(CargoMiri { path: "src/tools/miri/cargo-miri", mode: |_builder| Mode::ToolRustc }); +tool_check_step!(Rustfmt { path: "src/tools/rustfmt", mode: |_builder| Mode::ToolRustc }); tool_check_step!(MiroptTestTools { path: "src/tools/miropt-test-tools", - mode: Mode::ToolBootstrap + mode: |_builder| Mode::ToolBootstrap }); // We want to test the local std tool_check_step!(TestFloatParse { path: "src/tools/test-float-parse", - mode: Mode::ToolStd, + mode: |_builder| Mode::ToolStd, allow_features: tool::TestFloatParse::ALLOW_FEATURES }); tool_check_step!(FeaturesStatusDump { path: "src/tools/features-status-dump", - mode: Mode::ToolBootstrap + mode: |_builder| Mode::ToolBootstrap }); -tool_check_step!(Bootstrap { path: "src/bootstrap", mode: Mode::ToolBootstrap, default: false }); +tool_check_step!(Bootstrap { + path: "src/bootstrap", + mode: |_builder| Mode::ToolBootstrap, + default: false +}); // `run-make-support` will be built as part of suitable run-make compiletest test steps, but support // check to make it easier to work on. tool_check_step!(RunMakeSupport { path: "src/tools/run-make-support", - mode: Mode::ToolBootstrap, + mode: |_builder| Mode::ToolBootstrap, default: false }); tool_check_step!(CoverageDump { path: "src/tools/coverage-dump", - mode: Mode::ToolBootstrap, + mode: |_builder| Mode::ToolBootstrap, default: false }); From 245d2c95b1791aa8f6abb3fd9b99e39ee7bcd15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 11 Jul 2025 20:14:36 +0200 Subject: [PATCH 104/183] Implement `check::Compiletest` using the `tool_check_step` macro --- src/bootstrap/src/core/build_steps/check.rs | 68 ++++----------------- src/bootstrap/src/core/builder/tests.rs | 4 +- 2 files changed, 15 insertions(+), 57 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index 01b0915dfaf2..2a19e17019e0 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -433,61 +433,6 @@ impl Step for RustAnalyzer { } } -/// Compiletest is implicitly "checked" when it gets built in order to run tests, -/// so this is mainly for people working on compiletest to run locally. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct Compiletest { - pub target: TargetSelection, -} - -impl Step for Compiletest { - type Output = (); - const ONLY_HOSTS: bool = true; - const DEFAULT: bool = false; - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.path("src/tools/compiletest") - } - - fn make_run(run: RunConfig<'_>) { - run.builder.ensure(Compiletest { target: run.target }); - } - - fn run(self, builder: &Builder<'_>) { - let mode = if builder.config.compiletest_use_stage0_libtest { - Mode::ToolBootstrap - } else { - Mode::ToolStd - }; - let build_compiler = prepare_compiler_for_check(builder, self.target, mode); - - let mut cargo = prepare_tool_cargo( - builder, - build_compiler, - mode, - self.target, - builder.kind, - "src/tools/compiletest", - SourceType::InTree, - &[], - ); - - cargo.allow_features(COMPILETEST_ALLOW_FEATURES); - - cargo.arg("--all-targets"); - - let stamp = BuildStamp::new(&builder.cargo_out(build_compiler, mode, self.target)) - .with_prefix("compiletest-check"); - - let _guard = builder.msg_check("compiletest artifacts", self.target, None); - run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false); - } - - fn metadata(&self) -> Option { - Some(StepMetadata::check("compiletest", self.target)) - } -} - macro_rules! tool_check_step { ( $name:ident { @@ -642,3 +587,16 @@ tool_check_step!(CoverageDump { mode: |_builder| Mode::ToolBootstrap, default: false }); + +// Compiletest is implicitly "checked" when it gets built in order to run tests, +// so this is mainly for people working on compiletest to run locally. +tool_check_step!(Compiletest { + path: "src/tools/compiletest", + mode: |builder: &Builder<'_>| if builder.config.compiletest_use_stage0_libtest { + Mode::ToolBootstrap + } else { + Mode::ToolStd + }, + allow_features: COMPILETEST_ALLOW_FEATURES, + default: false, +}); diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 2f8cdd2f8c88..d27a2e65ed17 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -1528,7 +1528,7 @@ mod snapshot { insta::assert_snapshot!( ctx.config("check") .path("compiletest") - .render_steps(), @"[check] compiletest "); + .render_steps(), @"[check] rustc 0 -> Compiletest 1 "); } #[test] @@ -1542,7 +1542,7 @@ mod snapshot { [build] llvm [build] rustc 0 -> rustc 1 [build] rustc 1 -> std 1 - [check] compiletest + [check] rustc 1 -> Compiletest 2 "); } From fc74c2272bc3cf6ee7be23e75808ddf4af0c29ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sat, 19 Jul 2025 12:58:25 +0200 Subject: [PATCH 105/183] Add approval blocking labels for new bors --- rust-bors.toml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rust-bors.toml b/rust-bors.toml index fbfaa980f056..56f48512b06a 100644 --- a/rust-bors.toml +++ b/rust-bors.toml @@ -1,2 +1,19 @@ # 6 hours timeout for CI builds timeout = 21600 + +# Do not allow approving PRs with certain labels +labels_blocking_approval = [ + # Waiting for an FCP to finish + "final-comment-period", + "proposed-final-comment-period", + # PRs that were closed or postponed by an FCP + "disposition-close", + "disposition-postpone", + # Waiting for library ACP + "S-waiting-on-ACP", + "S-waiting-on-concerns", + "S-waiting-on-crater", + "S-waiting-on-fcp", + "S-waiting-on-MCP", + "S-waiting-on-team" +] From a2586f0c801aa52150925b4a66a517b1ffe13ddd Mon Sep 17 00:00:00 2001 From: binarycat Date: Mon, 23 Jun 2025 12:50:18 -0500 Subject: [PATCH 106/183] tidy: running of eslint, tsc, and es-check are now an extra check --- src/bootstrap/src/core/config/flags.rs | 2 +- src/etc/completions/x.fish | 6 +- src/etc/completions/x.ps1 | 6 +- src/etc/completions/x.py.fish | 6 +- src/etc/completions/x.py.ps1 | 6 +- src/etc/completions/x.py.zsh | 6 +- src/etc/completions/x.zsh | 6 +- src/tools/tidy/src/ext_tool_checks.rs | 37 ++++- .../tidy/src/ext_tool_checks/rustdoc_js.rs | 141 ++++++++++++++++++ src/tools/tidy/src/lib.rs | 1 - src/tools/tidy/src/main.rs | 4 +- src/tools/tidy/src/rustdoc_js.rs | 101 ------------- 12 files changed, 211 insertions(+), 111 deletions(-) create mode 100644 src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs delete mode 100644 src/tools/tidy/src/rustdoc_js.rs diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs index 1547ca444943..31a427f9ffaa 100644 --- a/src/bootstrap/src/core/config/flags.rs +++ b/src/bootstrap/src/core/config/flags.rs @@ -386,7 +386,7 @@ pub enum Subcommand { bless: bool, #[arg(long)] /// comma-separated list of other files types to check (accepts py, py:lint, - /// py:fmt, shell, shell:lint, cpp, cpp:fmt, spellcheck) + /// py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck, spellcheck) /// /// Any argument can be prefixed with "auto:" to only run if /// relevant files are modified (eg. "auto:py"). diff --git a/src/etc/completions/x.fish b/src/etc/completions/x.fish index 28a228d54645..f4e7413ca53a 100644 --- a/src/etc/completions/x.fish +++ b/src/etc/completions/x.fish @@ -299,7 +299,11 @@ complete -c x -n "__fish_x_using_subcommand doc" -l skip-std-check-if-no-downloa complete -c x -n "__fish_x_using_subcommand doc" -s h -l help -d 'Print help (see more with \'--help\')' complete -c x -n "__fish_x_using_subcommand test" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r complete -c x -n "__fish_x_using_subcommand test" -l compiletest-rustc-args -d 'extra options to pass the compiler when running compiletest tests' -r -complete -c x -n "__fish_x_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, shell:lint, cpp, cpp:fmt, spellcheck)' -r +<<<<<<< HEAD +complete -c x -n "__fish_x_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck, spellcheck)' -r +======= +complete -c x -n "__fish_x_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck)' -r +>>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) complete -c x -n "__fish_x_using_subcommand test" -l compare-mode -d 'mode describing what file the actual ui output will be compared to' -r complete -c x -n "__fish_x_using_subcommand test" -l pass -d 'force {check,build,run}-pass tests to this mode' -r complete -c x -n "__fish_x_using_subcommand test" -l run -d 'whether to execute run-* tests' -r diff --git a/src/etc/completions/x.ps1 b/src/etc/completions/x.ps1 index 0c9b38282731..fced6587d32a 100644 --- a/src/etc/completions/x.ps1 +++ b/src/etc/completions/x.ps1 @@ -345,7 +345,11 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { 'x;test' { [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)') [CompletionResult]::new('--compiletest-rustc-args', '--compiletest-rustc-args', [CompletionResultType]::ParameterName, 'extra options to pass the compiler when running compiletest tests') - [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, shell:lint, cpp, cpp:fmt, spellcheck)') +<<<<<<< HEAD + [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck, spellcheck)') +======= + [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck)') +>>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) [CompletionResult]::new('--compare-mode', '--compare-mode', [CompletionResultType]::ParameterName, 'mode describing what file the actual ui output will be compared to') [CompletionResult]::new('--pass', '--pass', [CompletionResultType]::ParameterName, 'force {check,build,run}-pass tests to this mode') [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests') diff --git a/src/etc/completions/x.py.fish b/src/etc/completions/x.py.fish index 43ae7424e27b..c80750111f7b 100644 --- a/src/etc/completions/x.py.fish +++ b/src/etc/completions/x.py.fish @@ -299,7 +299,11 @@ complete -c x.py -n "__fish_x.py_using_subcommand doc" -l skip-std-check-if-no-d complete -c x.py -n "__fish_x.py_using_subcommand doc" -s h -l help -d 'Print help (see more with \'--help\')' complete -c x.py -n "__fish_x.py_using_subcommand test" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r complete -c x.py -n "__fish_x.py_using_subcommand test" -l compiletest-rustc-args -d 'extra options to pass the compiler when running compiletest tests' -r -complete -c x.py -n "__fish_x.py_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, shell:lint, cpp, cpp:fmt, spellcheck)' -r +<<<<<<< HEAD +complete -c x.py -n "__fish_x.py_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck, spellcheck)' -r +======= +complete -c x.py -n "__fish_x.py_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck)' -r +>>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) complete -c x.py -n "__fish_x.py_using_subcommand test" -l compare-mode -d 'mode describing what file the actual ui output will be compared to' -r complete -c x.py -n "__fish_x.py_using_subcommand test" -l pass -d 'force {check,build,run}-pass tests to this mode' -r complete -c x.py -n "__fish_x.py_using_subcommand test" -l run -d 'whether to execute run-* tests' -r diff --git a/src/etc/completions/x.py.ps1 b/src/etc/completions/x.py.ps1 index 4311e383d640..dfb6482b41c8 100644 --- a/src/etc/completions/x.py.ps1 +++ b/src/etc/completions/x.py.ps1 @@ -345,7 +345,11 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { 'x.py;test' { [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)') [CompletionResult]::new('--compiletest-rustc-args', '--compiletest-rustc-args', [CompletionResultType]::ParameterName, 'extra options to pass the compiler when running compiletest tests') - [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, shell:lint, cpp, cpp:fmt, spellcheck)') +<<<<<<< HEAD + [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck, spellcheck)') +======= + [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck)') +>>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) [CompletionResult]::new('--compare-mode', '--compare-mode', [CompletionResultType]::ParameterName, 'mode describing what file the actual ui output will be compared to') [CompletionResult]::new('--pass', '--pass', [CompletionResultType]::ParameterName, 'force {check,build,run}-pass tests to this mode') [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests') diff --git a/src/etc/completions/x.py.zsh b/src/etc/completions/x.py.zsh index aff35b31e212..8ccc7a7091ce 100644 --- a/src/etc/completions/x.py.zsh +++ b/src/etc/completions/x.py.zsh @@ -345,7 +345,11 @@ _arguments "${_arguments_options[@]}" : \ _arguments "${_arguments_options[@]}" : \ '*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS:_default' \ '*--compiletest-rustc-args=[extra options to pass the compiler when running compiletest tests]:ARGS:_default' \ -'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, shell\:lint, cpp, cpp\:fmt, spellcheck)]:EXTRA_CHECKS:_default' \ +<<<<<<< HEAD +'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, cpp, cpp\:fmt, js, js\:lint, js\:typecheck, spellcheck)]:EXTRA_CHECKS:_default' \ +======= +'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, cpp, cpp\:fmt, js, js\:lint, js\:typecheck)]:EXTRA_CHECKS:_default' \ +>>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) '--compare-mode=[mode describing what file the actual ui output will be compared to]:COMPARE MODE:_default' \ '--pass=[force {check,build,run}-pass tests to this mode]:check | build | run:_default' \ '--run=[whether to execute run-* tests]:auto | always | never:_default' \ diff --git a/src/etc/completions/x.zsh b/src/etc/completions/x.zsh index 28ad00f3a0de..8c00abb7b21a 100644 --- a/src/etc/completions/x.zsh +++ b/src/etc/completions/x.zsh @@ -345,7 +345,11 @@ _arguments "${_arguments_options[@]}" : \ _arguments "${_arguments_options[@]}" : \ '*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS:_default' \ '*--compiletest-rustc-args=[extra options to pass the compiler when running compiletest tests]:ARGS:_default' \ -'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, shell\:lint, cpp, cpp\:fmt, spellcheck)]:EXTRA_CHECKS:_default' \ +<<<<<<< HEAD +'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, cpp, cpp\:fmt, js, js\:lint, js\:typecheck, spellcheck)]:EXTRA_CHECKS:_default' \ +======= +'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, cpp, cpp\:fmt, js, js\:lint, js\:typecheck)]:EXTRA_CHECKS:_default' \ +>>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) '--compare-mode=[mode describing what file the actual ui output will be compared to]:COMPARE MODE:_default' \ '--pass=[force {check,build,run}-pass tests to this mode]:check | build | run:_default' \ '--run=[whether to execute run-* tests]:auto | always | never:_default' \ diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index 381ea44fd46d..03ed0b00f3ef 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -25,6 +25,8 @@ use std::{fmt, fs, io}; use crate::CiInfo; +mod rustdoc_js; + const MIN_PY_REV: (u32, u32) = (3, 9); const MIN_PY_REV_STR: &str = "≥3.9"; @@ -46,12 +48,25 @@ pub fn check( root_path: &Path, outdir: &Path, ci_info: &CiInfo, + librustdoc_path: &Path, + tools_path: &Path, + src_path: &Path, bless: bool, extra_checks: Option<&str>, pos_args: &[String], bad: &mut bool, ) { - if let Err(e) = check_impl(root_path, outdir, ci_info, bless, extra_checks, pos_args) { + if let Err(e) = check_impl( + root_path, + outdir, + ci_info, + librustdoc_path, + tools_path, + src_path, + bless, + extra_checks, + pos_args, + ) { tidy_error!(bad, "{e}"); } } @@ -60,6 +75,9 @@ fn check_impl( root_path: &Path, outdir: &Path, ci_info: &CiInfo, + librustdoc_path: &Path, + tools_path: &Path, + src_path: &Path, bless: bool, extra_checks: Option<&str>, pos_args: &[String], @@ -108,6 +126,8 @@ fn check_impl( let shell_lint = extra_check!(Shell, Lint); let cpp_fmt = extra_check!(Cpp, Fmt); let spellcheck = extra_check!(Spellcheck, None); + let js_lint = extra_check!(Js, Lint); + let js_typecheck = extra_check!(Js, Typecheck); let mut py_path = None; @@ -275,6 +295,15 @@ fn check_impl( spellcheck_runner(&args)?; } + if js_lint { + rustdoc_js::lint(librustdoc_path, tools_path, src_path)?; + rustdoc_js::es_check(librustdoc_path)?; + } + + if js_typecheck { + rustdoc_js::typecheck(librustdoc_path)?; + } + Ok(()) } @@ -697,6 +726,7 @@ impl ExtraCheckArg { ExtraCheckLang::Py => ".py", ExtraCheckLang::Cpp => ".cpp", ExtraCheckLang::Shell => ".sh", + ExtraCheckLang::Js => ".js", ExtraCheckLang::Spellcheck => { return !crate::files_modified(ci_info, |s| { SPELLCHECK_DIRS.iter().any(|dir| Path::new(s).starts_with(dir)) @@ -717,6 +747,7 @@ impl ExtraCheckArg { ExtraCheckLang::Cpp => &[Fmt], ExtraCheckLang::Shell => &[Lint], ExtraCheckLang::Spellcheck => &[], + ExtraCheckLang::Js => &[Lint, Typecheck], }; supported_kinds.contains(&kind) } @@ -757,6 +788,7 @@ enum ExtraCheckLang { Shell, Cpp, Spellcheck, + Js, } impl FromStr for ExtraCheckLang { @@ -768,6 +800,7 @@ impl FromStr for ExtraCheckLang { "shell" => Self::Shell, "cpp" => Self::Cpp, "spellcheck" => Self::Spellcheck, + "js" => Self::Js, _ => return Err(ExtraCheckParseError::UnknownLang(s.to_string())), }) } @@ -777,6 +810,7 @@ impl FromStr for ExtraCheckLang { enum ExtraCheckKind { Lint, Fmt, + Typecheck, /// Never parsed, but used as a placeholder for /// langs that never have a specific kind. None, @@ -789,6 +823,7 @@ impl FromStr for ExtraCheckKind { Ok(match s { "lint" => Self::Lint, "fmt" => Self::Fmt, + "typecheck" => Self::Typecheck, _ => return Err(ExtraCheckParseError::UnknownKind(s.to_string())), }) } diff --git a/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs b/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs new file mode 100644 index 000000000000..24be26ffbd91 --- /dev/null +++ b/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs @@ -0,0 +1,141 @@ +//! Tidy check to ensure that rustdoc templates didn't forget a `{# #}` to strip extra whitespace +//! characters. + +use std::ffi::OsStr; +use std::path::{Path, PathBuf}; +use std::process::Command; + +use ignore::DirEntry; + +use crate::walk::walk_no_read; + +fn rustdoc_js_files(librustdoc_path: &Path) -> Vec { + let mut files = Vec::new(); + walk_no_read( + &[&librustdoc_path.join("html/static/js")], + |path, is_dir| is_dir || path.extension().is_none_or(|ext| ext != OsStr::new("js")), + &mut |path: &DirEntry| { + files.push(path.path().into()); + }, + ); + return files; +} + +fn run_eslint(args: &[PathBuf], config_folder: PathBuf) -> Result<(), super::Error> { + let mut child = Command::new("npx") + .arg("eslint") + .arg("-c") + .arg(config_folder.join(".eslintrc.js")) + .args(args) + .spawn()?; + match child.wait() { + Ok(exit_status) => { + if exit_status.success() { + return Ok(()); + } + Err(super::Error::FailedCheck("eslint command failed")) + } + Err(error) => Err(super::Error::Generic(format!("eslint command failed: {error:?}"))), + } +} + +fn get_eslint_version_inner(global: bool) -> Option { + let mut command = Command::new("npm"); + command.arg("list").arg("--parseable").arg("--long").arg("--depth=0"); + if global { + command.arg("--global"); + } + let output = command.output().ok()?; + let lines = String::from_utf8_lossy(&output.stdout); + lines.lines().find_map(|l| l.split(':').nth(1)?.strip_prefix("eslint@")).map(|v| v.to_owned()) +} + +fn get_eslint_version() -> Option { + get_eslint_version_inner(false).or_else(|| get_eslint_version_inner(true)) +} + +pub(super) fn lint( + librustdoc_path: &Path, + tools_path: &Path, + src_path: &Path, +) -> Result<(), super::Error> { + let eslint_version_path = src_path.join("ci/docker/host-x86_64/tidy/eslint.version"); + let eslint_version = match std::fs::read_to_string(&eslint_version_path) { + Ok(version) => version.trim().to_string(), + Err(error) => { + eprintln!("failed to read `{}`: {error:?}", eslint_version_path.display()); + return Err(error.into()); + } + }; + // Having the correct `eslint` version installed via `npm` isn't strictly necessary, since we're invoking it via `npx`, + // but this check allows the vast majority that is not working on the rustdoc frontend to avoid the penalty of running + // `eslint` in tidy. See also: https://github.com/rust-lang/rust/pull/142851 + match get_eslint_version() { + Some(version) => { + if version != eslint_version { + // unfortunatly we can't use `Error::Version` here becuse `str::trim` isn't const and + // Version::required must be a static str + return Err(super::Error::Generic(format!( + "⚠️ Installed version of eslint (`{version}`) is different than the \ + one used in the CI (`{eslint_version}`)\n\ + You can install this version using `npm update eslint` or by using \ + `npm install eslint@{eslint_version}`\n +" + ))); + } + } + None => { + //eprintln!("`eslint` doesn't seem to be installed. Skipping tidy check for JS files."); + //eprintln!("You can install it using `npm install eslint@{eslint_version}`"); + return Err(super::Error::MissingReq( + "eslint", + "js lint checks", + Some(format!("You can install it using `npm install eslint@{eslint_version}`")), + )); + } + } + let files_to_check = rustdoc_js_files(librustdoc_path); + println!("Running eslint on rustdoc JS files"); + run_eslint(&files_to_check, librustdoc_path.join("html/static"))?; + + run_eslint(&[tools_path.join("rustdoc-js/tester.js")], tools_path.join("rustdoc-js"))?; + run_eslint(&[tools_path.join("rustdoc-gui/tester.js")], tools_path.join("rustdoc-gui"))?; + Ok(()) +} + +pub(super) fn typecheck(librustdoc_path: &Path) -> Result<(), super::Error> { + // use npx to ensure correct version + let mut child = Command::new("npx") + .arg("tsc") + .arg("-p") + .arg(librustdoc_path.join("html/static/js/tsconfig.json")) + .spawn()?; + match child.wait() { + Ok(exit_status) => { + if exit_status.success() { + return Ok(()); + } + Err(super::Error::FailedCheck("tsc command failed")) + } + Err(error) => Err(super::Error::Generic(format!("tsc command failed: {error:?}"))), + } +} + +pub(super) fn es_check(librustdoc_path: &Path) -> Result<(), super::Error> { + let files_to_check = rustdoc_js_files(librustdoc_path); + // use npx to ensure correct version + let mut cmd = Command::new("npx"); + cmd.arg("es-check").arg("es2019"); + for f in files_to_check { + cmd.arg(f); + } + match cmd.spawn()?.wait() { + Ok(exit_status) => { + if exit_status.success() { + return Ok(()); + } + Err(super::Error::FailedCheck("es-check command failed")) + } + Err(error) => Err(super::Error::Generic(format!("es-check command failed: {error:?}"))), + } +} diff --git a/src/tools/tidy/src/lib.rs b/src/tools/tidy/src/lib.rs index ade4055b5bd1..4db74cbf61c7 100644 --- a/src/tools/tidy/src/lib.rs +++ b/src/tools/tidy/src/lib.rs @@ -178,7 +178,6 @@ pub mod mir_opt_tests; pub mod pal; pub mod rustdoc_css_themes; pub mod rustdoc_gui_tests; -pub mod rustdoc_js; pub mod rustdoc_json; pub mod rustdoc_templates; pub mod style; diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 0f1116a632e2..358a03dd18c1 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -112,7 +112,6 @@ fn main() { check!(rustdoc_gui_tests, &tests_path); check!(rustdoc_css_themes, &librustdoc_path); check!(rustdoc_templates, &librustdoc_path); - check!(rustdoc_js, &librustdoc_path, &tools_path, &src_path); check!(rustdoc_json, &src_path, &ci_info); check!(known_bug, &crashes_path); check!(unknown_revision, &tests_path); @@ -181,6 +180,9 @@ fn main() { &root_path, &output_directory, &ci_info, + &librustdoc_path, + &tools_path, + &src_path, bless, extra_checks, pos_args diff --git a/src/tools/tidy/src/rustdoc_js.rs b/src/tools/tidy/src/rustdoc_js.rs deleted file mode 100644 index 5737fcbafc02..000000000000 --- a/src/tools/tidy/src/rustdoc_js.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tidy check to ensure that rustdoc templates didn't forget a `{# #}` to strip extra whitespace -//! characters. - -use std::ffi::OsStr; -use std::path::{Path, PathBuf}; -use std::process::Command; - -use ignore::DirEntry; - -use crate::walk::walk_no_read; - -fn run_eslint(args: &[PathBuf], config_folder: PathBuf, bad: &mut bool) { - let mut child = match Command::new("npx") - .arg("eslint") - .arg("-c") - .arg(config_folder.join(".eslintrc.js")) - .args(args) - .spawn() - { - Ok(child) => child, - Err(error) => { - *bad = true; - eprintln!("failed to run eslint: {error:?}"); - return; - } - }; - match child.wait() { - Ok(exit_status) => { - if exit_status.success() { - return; - } - eprintln!("eslint command failed"); - } - Err(error) => eprintln!("eslint command failed: {error:?}"), - } - *bad = true; -} - -fn get_eslint_version_inner(global: bool) -> Option { - let mut command = Command::new("npm"); - command.arg("list").arg("--parseable").arg("--long").arg("--depth=0"); - if global { - command.arg("--global"); - } - let output = command.output().ok()?; - let lines = String::from_utf8_lossy(&output.stdout); - lines.lines().find_map(|l| l.split(':').nth(1)?.strip_prefix("eslint@")).map(|v| v.to_owned()) -} - -fn get_eslint_version() -> Option { - get_eslint_version_inner(false).or_else(|| get_eslint_version_inner(true)) -} - -pub fn check(librustdoc_path: &Path, tools_path: &Path, src_path: &Path, bad: &mut bool) { - let eslint_version_path = src_path.join("ci/docker/host-x86_64/tidy/eslint.version"); - let eslint_version = match std::fs::read_to_string(&eslint_version_path) { - Ok(version) => version.trim().to_string(), - Err(error) => { - *bad = true; - eprintln!("failed to read `{}`: {error:?}", eslint_version_path.display()); - return; - } - }; - // Having the correct `eslint` version installed via `npm` isn't strictly necessary, since we're invoking it via `npx`, - // but this check allows the vast majority that is not working on the rustdoc frontend to avoid the penalty of running - // `eslint` in tidy. See also: https://github.com/rust-lang/rust/pull/142851 - match get_eslint_version() { - Some(version) => { - if version != eslint_version { - *bad = true; - eprintln!( - "⚠️ Installed version of eslint (`{version}`) is different than the \ - one used in the CI (`{eslint_version}`)", - ); - eprintln!( - "You can install this version using `npm update eslint` or by using \ - `npm install eslint@{eslint_version}`", - ); - return; - } - } - None => { - eprintln!("`eslint` doesn't seem to be installed. Skipping tidy check for JS files."); - eprintln!("You can install it using `npm install eslint@{eslint_version}`"); - return; - } - } - let mut files_to_check = Vec::new(); - walk_no_read( - &[&librustdoc_path.join("html/static/js")], - |path, is_dir| is_dir || path.extension().is_none_or(|ext| ext != OsStr::new("js")), - &mut |path: &DirEntry| { - files_to_check.push(path.path().into()); - }, - ); - println!("Running eslint on rustdoc JS files"); - run_eslint(&files_to_check, librustdoc_path.join("html/static"), bad); - - run_eslint(&[tools_path.join("rustdoc-js/tester.js")], tools_path.join("rustdoc-js"), bad); - run_eslint(&[tools_path.join("rustdoc-gui/tester.js")], tools_path.join("rustdoc-gui"), bad); -} From 4bd3b74aa9ec4a21507d73f712186619baf93ba0 Mon Sep 17 00:00:00 2001 From: binarycat Date: Mon, 23 Jun 2025 12:57:16 -0500 Subject: [PATCH 107/183] update CI to use new tidy extra checks for rustdoc js --- src/ci/docker/host-x86_64/pr-check-1/Dockerfile | 5 +---- src/ci/docker/host-x86_64/tidy/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ci/docker/host-x86_64/pr-check-1/Dockerfile b/src/ci/docker/host-x86_64/pr-check-1/Dockerfile index 8bbcc18e2bef..e63a383ec997 100644 --- a/src/ci/docker/host-x86_64/pr-check-1/Dockerfile +++ b/src/ci/docker/host-x86_64/pr-check-1/Dockerfile @@ -52,7 +52,4 @@ ENV SCRIPT \ python3 ../x.py check --set build.optimized-compiler-builtins=false core alloc std --target=aarch64-unknown-linux-gnu,i686-pc-windows-msvc,i686-unknown-linux-gnu,x86_64-apple-darwin,x86_64-pc-windows-gnu,x86_64-pc-windows-msvc && \ /scripts/validate-toolstate.sh && \ reuse --include-submodules lint && \ - python3 ../x.py test collect-license-metadata && \ - # Runs checks to ensure that there are no issues in our JS code. - es-check es2019 ../src/librustdoc/html/static/js/*.js && \ - tsc --project ../src/librustdoc/html/static/js/tsconfig.json + python3 ../x.py test collect-license-metadata diff --git a/src/ci/docker/host-x86_64/tidy/Dockerfile b/src/ci/docker/host-x86_64/tidy/Dockerfile index dbb950cbe0cd..ee1ae5410ee8 100644 --- a/src/ci/docker/host-x86_64/tidy/Dockerfile +++ b/src/ci/docker/host-x86_64/tidy/Dockerfile @@ -45,4 +45,4 @@ RUN bash -c 'npm install -g eslint@$(cat /tmp/eslint.version)' # NOTE: intentionally uses python2 for x.py so we can test it still works. # validate-toolstate only runs in our CI, so it's ok for it to only support python3. ENV SCRIPT TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 \ - src/tools/tidy tidyselftest --extra-checks=py,cpp + src/tools/tidy tidyselftest --extra-checks=py,cpp,js From c8e2a65ed16b948819cee23d883d8e598665318b Mon Sep 17 00:00:00 2001 From: binarycat Date: Fri, 27 Jun 2025 14:29:39 -0500 Subject: [PATCH 108/183] tidy: use a lockfile for js tools instead of npx this makes us less vulnerable to MITM and supply chain attacks. it also means that the CI scripts are no longer responsible for tracking the versions of these tools. it should also avoid the situation where local tsc and CI disagree on the presense of errors due to them being different versions. --- .gitignore | 2 - package-lock.json | 3232 +++++++++++++++++ package.json | 9 + .../docker/host-x86_64/pr-check-1/Dockerfile | 4 - src/tools/tidy/src/ext_tool_checks.rs | 13 +- .../tidy/src/ext_tool_checks/rustdoc_js.rs | 148 +- src/tools/tidy/src/main.rs | 1 - 7 files changed, 3323 insertions(+), 86 deletions(-) create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore index a549b6e6e56c..5988a64916ad 100644 --- a/.gitignore +++ b/.gitignore @@ -85,8 +85,6 @@ __pycache__/ ## Node node_modules -package-lock.json -package.json /src/doc/rustc-dev-guide/mermaid.min.js ## Rustdoc GUI tests diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000000..dbdd9c644f14 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3232 @@ +{ + "name": "rust", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "browser-ui-test": "^0.21.1", + "es-check": "^6.2.1", + "eslint": "^8.57.1", + "eslint-js": "github:eslint/js", + "typescript": "^5.8.3" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@caporal/core": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@caporal/core/-/core-2.0.7.tgz", + "integrity": "sha512-OvKBEidoXUGT28RP3USXFdLgiR5kGCHfRXR1uBQznyxBHaWjGcpH+G1chRqyIVT82pQoJiauOZRIGlrpyAbRYQ==", + "license": "MIT", + "dependencies": { + "@types/glob": "^7.1.1", + "@types/lodash": "^4.14.149", + "@types/node": "13.9.3", + "@types/table": "^5.0.0", + "@types/tabtab": "^3.0.1", + "@types/wrap-ansi": "^3.0.0", + "chalk": "^3.0.0", + "glob": "^7.1.6", + "lodash": "^4.17.21", + "table": "^5.4.6", + "tabtab": "^3.0.2", + "winston": "^3.2.1", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@colors/colors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", + "license": "MIT", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@dabh/diagnostics": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", + "license": "MIT", + "dependencies": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", + "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "license": "BSD-3-Clause" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@puppeteer/browsers": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.3.0.tgz", + "integrity": "sha512-ioXoq9gPxkss4MYhD+SFaU9p1IHFUX0ILAWFPyjGaBdjLsYAlZw6j1iLA0N/m12uVHLFDfSYNF7EQccjinIMDA==", + "license": "Apache-2.0", + "dependencies": { + "debug": "^4.3.5", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.4.0", + "semver": "^7.6.3", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "license": "MIT" + }, + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "license": "MIT", + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==", + "license": "MIT" + }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "13.9.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.9.3.tgz", + "integrity": "sha512-01s+ac4qerwd6RHD+mVbOEsraDHSgUaefQlEdBbUolnQFjKwCr7luvAlEwW1RFojh67u0z4OUTjPn9LEl4zIkA==", + "license": "MIT" + }, + "node_modules/@types/table": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/table/-/table-5.0.0.tgz", + "integrity": "sha512-fQLtGLZXor264zUPWI95WNDsZ3QV43/c0lJpR/h1hhLJumXRmHNsrvBfEzW2YMhb0EWCsn4U6h82IgwsajAuTA==", + "license": "MIT" + }, + "node_modules/@types/tabtab": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/tabtab/-/tabtab-3.0.4.tgz", + "integrity": "sha512-gmh8JsmIYPGRqk8Xb4dmulV37TpLwg0Quo3GJ0LgEcl4v0O92F14PGebBd7LHv9GBEw2KbmBSrvU0/NzIy5AoA==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/triple-beam": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", + "license": "MIT" + }, + "node_modules/@types/wrap-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", + "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==", + "license": "MIT" + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "license": "ISC" + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT" + }, + "node_modules/b4a": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", + "license": "Apache-2.0" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/bare-events": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.0.tgz", + "integrity": "sha512-EKZ5BTXYExaNqi3I3f9RtEsaI/xBSGjE0XZCZilPzFAV/goswFHuPd9jEZlPIZ/iNZJwDSao9qRiScySz7MbQg==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-fs": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.1.6.tgz", + "integrity": "sha512-25RsLF33BqooOEFNdMcEhMpJy8EoR88zSMrnOQOaM3USnOK2VmaJ1uaQEwPA6AQjrv1lXChScosN6CzbwbO9OQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-events": "^2.5.4", + "bare-path": "^3.0.0", + "bare-stream": "^2.6.4" + }, + "engines": { + "bare": ">=1.16.0" + }, + "peerDependencies": { + "bare-buffer": "*" + }, + "peerDependenciesMeta": { + "bare-buffer": { + "optional": true + } + } + }, + "node_modules/bare-os": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.1.tgz", + "integrity": "sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "bare": ">=1.14.0" + } + }, + "node_modules/bare-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz", + "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-os": "^3.0.1" + } + }, + "node_modules/bare-stream": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.5.tgz", + "integrity": "sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "streamx": "^2.21.0" + }, + "peerDependencies": { + "bare-buffer": "*", + "bare-events": "*" + }, + "peerDependenciesMeta": { + "bare-buffer": { + "optional": true + }, + "bare-events": { + "optional": true + } + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/basic-ftp": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-ui-test": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/browser-ui-test/-/browser-ui-test-0.21.1.tgz", + "integrity": "sha512-b3a9mhALAmbP+GifoN/c295RPyuyfIUFMz0DtlBHbeDW5PYQTMHZZJtm7R2UyP6JiIQSkR+7227sS3maMGMUTg==", + "license": "MIT", + "dependencies": { + "css-unit-converter": "^1.1.2", + "pngjs": "^3.4.0", + "puppeteer": "^22.15.0", + "readline-sync": "^1.4.10" + }, + "bin": { + "browser-ui-test": "src/index.js" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "license": "MIT" + }, + "node_modules/chromium-bidi": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.6.3.tgz", + "integrity": "sha512-qXlsCmpCZJAnoTYI83Iu6EdYQpMYdVkCfq08KDh2pmlVqK5t5IA9mGs4/LwCwp4fqisSOMXZxP3HIh8w8aRn0A==", + "license": "Apache-2.0", + "dependencies": { + "mitt": "3.0.1", + "urlpattern-polyfill": "10.0.0", + "zod": "3.23.8" + }, + "peerDependencies": { + "devtools-protocol": "*" + } + }, + "node_modules/cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "license": "MIT", + "dependencies": { + "restore-cursor": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "license": "ISC" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/color/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/colorspace": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", + "license": "MIT", + "dependencies": { + "color": "^3.1.3", + "text-hex": "1.0.x" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-unit-converter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.2.tgz", + "integrity": "sha512-IiJwMC8rdZE0+xiEZHeru6YoONC4rfPMqGm2W85jMIbkFvv5nFTwJVFHam2eFrN6txmoUYFAFXiv8ICVeTO0MA==", + "license": "MIT" + }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "license": "MIT" + }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/devtools-protocol": { + "version": "0.0.1312386", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1312386.tgz", + "integrity": "sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA==", + "license": "BSD-3-Clause" + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "license": "MIT" + }, + "node_modules/enabled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-check": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/es-check/-/es-check-6.2.1.tgz", + "integrity": "sha512-IPiRXUlwSTd2yMklIf9yEGe6GK5wCS8Sz1aTNHm1QSiYzI4aiq19giYbLi95tb+e0JJVKmcU0iQXQWW60a8V9A==", + "license": "MIT", + "dependencies": { + "@caporal/core": "^2.0.2", + "acorn": "^8.7.0", + "fast-glob": "^3.2.11" + }, + "bin": { + "es-check": "index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/es6-promisify": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", + "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-js": { + "version": "1.0.0", + "resolved": "git+ssh://git@github.com/eslint/js.git#5bd12e3772d361af2c4bfad774ea7bfd9caae6bc", + "workspaces": [ + "packages/*" + ] + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "license": "BSD-2-Clause", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/fecha": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", + "license": "MIT" + }, + "node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "license": "ISC" + }, + "node_modules/fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", + "license": "MIT" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-uri": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz", + "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==", + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "license": "MIT" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "license": "MIT", + "dependencies": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/inquirer/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/inquirer/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "license": "MIT", + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/string-width/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/inquirer/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "license": "MIT" + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "license": "MIT" + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kuler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", + "license": "MIT" + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "license": "MIT" + }, + "node_modules/logform": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", + "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", + "license": "MIT", + "dependencies": { + "@colors/colors": "1.6.0", + "@types/triple-beam": "^1.3.2", + "fecha": "^4.2.0", + "ms": "^2.1.1", + "safe-stable-stringify": "^2.3.1", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "license": "MIT" + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", + "license": "ISC" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "license": "MIT" + }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/one-time": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "license": "MIT", + "dependencies": { + "fn.name": "1.x.x" + } + }, + "node_modules/onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "license": "MIT", + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pac-proxy-agent": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz", + "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==", + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.6", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pngjs": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", + "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/proxy-agent": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.6", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.1.0", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/puppeteer": { + "version": "22.15.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-22.15.0.tgz", + "integrity": "sha512-XjCY1SiSEi1T7iSYuxS82ft85kwDJUS7wj1Z0eGVXKdtr5g4xnVcbjwxhq5xBnpK/E7x1VZZoJDxpjAOasHT4Q==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@puppeteer/browsers": "2.3.0", + "cosmiconfig": "^9.0.0", + "devtools-protocol": "0.0.1312386", + "puppeteer-core": "22.15.0" + }, + "bin": { + "puppeteer": "lib/esm/puppeteer/node/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/puppeteer-core": { + "version": "22.15.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.15.0.tgz", + "integrity": "sha512-cHArnywCiAAVXa3t4GGL2vttNxh7GqXtIYGym99egkNJ3oG//wL9LkvO4WE8W1TJe95t1F1ocu9X4xWaGsOKOA==", + "license": "Apache-2.0", + "dependencies": { + "@puppeteer/browsers": "2.3.0", + "chromium-bidi": "0.6.3", + "debug": "^4.3.6", + "devtools-protocol": "0.0.1312386", + "ws": "^8.18.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readline-sync": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", + "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", + "license": "MIT", + "dependencies": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/rxjs/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "license": "MIT" + }, + "node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.6.tgz", + "integrity": "sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==", + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause" + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/streamx": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.1.tgz", + "integrity": "sha512-znKXEBxfatz2GBNK02kRnCXjV+AA4kjZIUxeWSr3UGirZMJfTE9uiwKHobnbgxWyL/JWro8tTq+vOqAK1/qbSA==", + "license": "MIT", + "dependencies": { + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "license": "BSD-3-Clause", + "dependencies": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/tabtab": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tabtab/-/tabtab-3.0.2.tgz", + "integrity": "sha512-jANKmUe0sIQc/zTALTBy186PoM/k6aPrh3A7p6AaAfF6WPSbTx1JYeGIGH162btpH+mmVEXln+UxwViZHO2Jhg==", + "license": "MIT", + "dependencies": { + "debug": "^4.0.1", + "es6-promisify": "^6.0.0", + "inquirer": "^6.0.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "untildify": "^3.0.3" + } + }, + "node_modules/tar-fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.0.tgz", + "integrity": "sha512-5Mty5y/sOF1YWj1J6GiBodjlDc05CUR8PKXrsnFAiSG0xA+GHeWLovaZPYUDXkH/1iKRf2+M5+OrRgzC7O9b7w==", + "license": "MIT", + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^4.0.1", + "bare-path": "^3.0.0" + } + }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, + "node_modules/text-hex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", + "license": "MIT" + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "license": "MIT" + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "license": "MIT" + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/triple-beam": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", + "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", + "license": "MIT", + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "license": "MIT", + "dependencies": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, + "node_modules/untildify": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", + "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/urlpattern-polyfill": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", + "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==", + "license": "MIT" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/winston": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz", + "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==", + "license": "MIT", + "dependencies": { + "@colors/colors": "^1.6.0", + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.7.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.9.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/winston-transport": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", + "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", + "license": "MIT", + "dependencies": { + "logform": "^2.7.0", + "readable-stream": "^3.6.2", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/yargs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 000000000000..945f9a3ee87d --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "browser-ui-test": "^0.21.1", + "es-check": "^6.2.1", + "eslint": "^8.57.1", + "eslint-js": "github:eslint/js", + "typescript": "^5.8.3" + } +} diff --git a/src/ci/docker/host-x86_64/pr-check-1/Dockerfile b/src/ci/docker/host-x86_64/pr-check-1/Dockerfile index e63a383ec997..d3c3cd1b63e4 100644 --- a/src/ci/docker/host-x86_64/pr-check-1/Dockerfile +++ b/src/ci/docker/host-x86_64/pr-check-1/Dockerfile @@ -27,10 +27,6 @@ COPY scripts/nodejs.sh /scripts/ RUN sh /scripts/nodejs.sh /node ENV PATH="/node/bin:${PATH}" -# Install es-check -# Pin its version to prevent unrelated CI failures due to future es-check versions. -RUN npm install es-check@6.1.1 eslint@8.6.0 typescript@5.7.3 -g - COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index 03ed0b00f3ef..911d4daae5cd 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -50,7 +50,6 @@ pub fn check( ci_info: &CiInfo, librustdoc_path: &Path, tools_path: &Path, - src_path: &Path, bless: bool, extra_checks: Option<&str>, pos_args: &[String], @@ -62,7 +61,6 @@ pub fn check( ci_info, librustdoc_path, tools_path, - src_path, bless, extra_checks, pos_args, @@ -77,7 +75,6 @@ fn check_impl( ci_info: &CiInfo, librustdoc_path: &Path, tools_path: &Path, - src_path: &Path, bless: bool, extra_checks: Option<&str>, pos_args: &[String], @@ -295,13 +292,17 @@ fn check_impl( spellcheck_runner(&args)?; } + if js_lint || js_typecheck { + rustdoc_js::npm_install(root_path, outdir)?; + } + if js_lint { - rustdoc_js::lint(librustdoc_path, tools_path, src_path)?; - rustdoc_js::es_check(librustdoc_path)?; + rustdoc_js::lint(outdir, librustdoc_path, tools_path)?; + rustdoc_js::es_check(outdir, librustdoc_path)?; } if js_typecheck { - rustdoc_js::typecheck(librustdoc_path)?; + rustdoc_js::typecheck(outdir, librustdoc_path)?; } Ok(()) diff --git a/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs b/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs index 24be26ffbd91..f96c9612a8e1 100644 --- a/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs +++ b/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs @@ -3,12 +3,61 @@ use std::ffi::OsStr; use std::path::{Path, PathBuf}; -use std::process::Command; +use std::process::{Child, Command}; +use std::{fs, io}; +use build_helper::ci::CiEnv; use ignore::DirEntry; use crate::walk::walk_no_read; +fn node_module_bin(outdir: &Path, name: &str) -> PathBuf { + outdir.join("node_modules/.bin").join(name) +} + +fn spawn_cmd(cmd: &mut Command) -> Result { + cmd.spawn().map_err(|err| { + eprintln!("unable to run {cmd:?} due to {err:?}"); + err + }) +} + +/// install all js dependencies from package.json. +pub(super) fn npm_install(root_path: &Path, outdir: &Path) -> Result<(), super::Error> { + let copy_to_build = |p| { + fs::copy(root_path.join(p), outdir.join(p)).map_err(|e| { + eprintln!("unable to copy {p:?} to build directory: {e:?}"); + e + }) + }; + // copy stuff to the output directory to make node_modules get put there. + copy_to_build("package.json")?; + copy_to_build("package-lock.json")?; + + let mut cmd = Command::new("npm"); + if CiEnv::is_ci() { + // `npm ci` redownloads every time and thus is too slow for local development. + cmd.arg("ci"); + } else { + cmd.arg("install"); + } + // disable a bunch of things we don't want. + // this makes tidy output less noisy, and also significantly improves runtime + // of repeated tidy invokations. + cmd.args(&["--audit=false", "--save=false", "--fund=false"]); + cmd.current_dir(outdir); + let mut child = spawn_cmd(&mut cmd)?; + match child.wait() { + Ok(exit_status) => { + if exit_status.success() { + return Ok(()); + } + Err(super::Error::FailedCheck("npm install")) + } + Err(error) => Err(super::Error::Generic(format!("npm install failed: {error:?}"))), + } +} + fn rustdoc_js_files(librustdoc_path: &Path) -> Vec { let mut files = Vec::new(); walk_no_read( @@ -21,13 +70,13 @@ fn rustdoc_js_files(librustdoc_path: &Path) -> Vec { return files; } -fn run_eslint(args: &[PathBuf], config_folder: PathBuf) -> Result<(), super::Error> { - let mut child = Command::new("npx") - .arg("eslint") - .arg("-c") - .arg(config_folder.join(".eslintrc.js")) - .args(args) - .spawn()?; +fn run_eslint(outdir: &Path, args: &[PathBuf], config_folder: PathBuf) -> Result<(), super::Error> { + let mut child = spawn_cmd( + Command::new(node_module_bin(outdir, "eslint")) + .arg("-c") + .arg(config_folder.join(".eslintrc.js")) + .args(args), + )?; match child.wait() { Ok(exit_status) => { if exit_status.success() { @@ -39,77 +88,31 @@ fn run_eslint(args: &[PathBuf], config_folder: PathBuf) -> Result<(), super::Err } } -fn get_eslint_version_inner(global: bool) -> Option { - let mut command = Command::new("npm"); - command.arg("list").arg("--parseable").arg("--long").arg("--depth=0"); - if global { - command.arg("--global"); - } - let output = command.output().ok()?; - let lines = String::from_utf8_lossy(&output.stdout); - lines.lines().find_map(|l| l.split(':').nth(1)?.strip_prefix("eslint@")).map(|v| v.to_owned()) -} - -fn get_eslint_version() -> Option { - get_eslint_version_inner(false).or_else(|| get_eslint_version_inner(true)) -} - pub(super) fn lint( + outdir: &Path, librustdoc_path: &Path, tools_path: &Path, - src_path: &Path, ) -> Result<(), super::Error> { - let eslint_version_path = src_path.join("ci/docker/host-x86_64/tidy/eslint.version"); - let eslint_version = match std::fs::read_to_string(&eslint_version_path) { - Ok(version) => version.trim().to_string(), - Err(error) => { - eprintln!("failed to read `{}`: {error:?}", eslint_version_path.display()); - return Err(error.into()); - } - }; - // Having the correct `eslint` version installed via `npm` isn't strictly necessary, since we're invoking it via `npx`, - // but this check allows the vast majority that is not working on the rustdoc frontend to avoid the penalty of running - // `eslint` in tidy. See also: https://github.com/rust-lang/rust/pull/142851 - match get_eslint_version() { - Some(version) => { - if version != eslint_version { - // unfortunatly we can't use `Error::Version` here becuse `str::trim` isn't const and - // Version::required must be a static str - return Err(super::Error::Generic(format!( - "⚠️ Installed version of eslint (`{version}`) is different than the \ - one used in the CI (`{eslint_version}`)\n\ - You can install this version using `npm update eslint` or by using \ - `npm install eslint@{eslint_version}`\n -" - ))); - } - } - None => { - //eprintln!("`eslint` doesn't seem to be installed. Skipping tidy check for JS files."); - //eprintln!("You can install it using `npm install eslint@{eslint_version}`"); - return Err(super::Error::MissingReq( - "eslint", - "js lint checks", - Some(format!("You can install it using `npm install eslint@{eslint_version}`")), - )); - } - } let files_to_check = rustdoc_js_files(librustdoc_path); println!("Running eslint on rustdoc JS files"); - run_eslint(&files_to_check, librustdoc_path.join("html/static"))?; + run_eslint(outdir, &files_to_check, librustdoc_path.join("html/static"))?; - run_eslint(&[tools_path.join("rustdoc-js/tester.js")], tools_path.join("rustdoc-js"))?; - run_eslint(&[tools_path.join("rustdoc-gui/tester.js")], tools_path.join("rustdoc-gui"))?; + run_eslint(outdir, &[tools_path.join("rustdoc-js/tester.js")], tools_path.join("rustdoc-js"))?; + run_eslint( + outdir, + &[tools_path.join("rustdoc-gui/tester.js")], + tools_path.join("rustdoc-gui"), + )?; Ok(()) } -pub(super) fn typecheck(librustdoc_path: &Path) -> Result<(), super::Error> { +pub(super) fn typecheck(outdir: &Path, librustdoc_path: &Path) -> Result<(), super::Error> { // use npx to ensure correct version - let mut child = Command::new("npx") - .arg("tsc") - .arg("-p") - .arg(librustdoc_path.join("html/static/js/tsconfig.json")) - .spawn()?; + let mut child = spawn_cmd( + Command::new(node_module_bin(outdir, "tsc")) + .arg("-p") + .arg(librustdoc_path.join("html/static/js/tsconfig.json")), + )?; match child.wait() { Ok(exit_status) => { if exit_status.success() { @@ -121,15 +124,14 @@ pub(super) fn typecheck(librustdoc_path: &Path) -> Result<(), super::Error> { } } -pub(super) fn es_check(librustdoc_path: &Path) -> Result<(), super::Error> { +pub(super) fn es_check(outdir: &Path, librustdoc_path: &Path) -> Result<(), super::Error> { let files_to_check = rustdoc_js_files(librustdoc_path); - // use npx to ensure correct version - let mut cmd = Command::new("npx"); - cmd.arg("es-check").arg("es2019"); + let mut cmd = Command::new(node_module_bin(outdir, "es-check")); + cmd.arg("es2019"); for f in files_to_check { cmd.arg(f); } - match cmd.spawn()?.wait() { + match spawn_cmd(&mut cmd)?.wait() { Ok(exit_status) => { if exit_status.success() { return Ok(()); diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 358a03dd18c1..13b20f33bd0f 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -182,7 +182,6 @@ fn main() { &ci_info, &librustdoc_path, &tools_path, - &src_path, bless, extra_checks, pos_args From 2ffa711ea5ad140635042b09eb5b739f90248a67 Mon Sep 17 00:00:00 2001 From: binarycat Date: Thu, 10 Jul 2025 19:36:27 -0500 Subject: [PATCH 109/183] REUSE.toml: add new package.json and package-lock.json --- REUSE.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/REUSE.toml b/REUSE.toml index 027b4ccbe259..13aa3e0a4112 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -37,6 +37,8 @@ path = [ "rust-bors.toml", "triagebot.toml", "typos.toml", + "package.json", + "package-lock.json", "x", "x.ps1", "x.py", From ca39010d3e7d3c512d5d8df8094862ffa146837f Mon Sep 17 00:00:00 2001 From: binarycat Date: Sat, 19 Jul 2025 14:52:31 -0500 Subject: [PATCH 110/183] update completions --- src/etc/completions/x.fish | 4 ---- src/etc/completions/x.ps1 | 4 ---- src/etc/completions/x.py.fish | 4 ---- src/etc/completions/x.py.ps1 | 4 ---- src/etc/completions/x.py.zsh | 4 ---- src/etc/completions/x.zsh | 4 ---- 6 files changed, 24 deletions(-) diff --git a/src/etc/completions/x.fish b/src/etc/completions/x.fish index f4e7413ca53a..a5e5bb8f09e8 100644 --- a/src/etc/completions/x.fish +++ b/src/etc/completions/x.fish @@ -299,11 +299,7 @@ complete -c x -n "__fish_x_using_subcommand doc" -l skip-std-check-if-no-downloa complete -c x -n "__fish_x_using_subcommand doc" -s h -l help -d 'Print help (see more with \'--help\')' complete -c x -n "__fish_x_using_subcommand test" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r complete -c x -n "__fish_x_using_subcommand test" -l compiletest-rustc-args -d 'extra options to pass the compiler when running compiletest tests' -r -<<<<<<< HEAD complete -c x -n "__fish_x_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck, spellcheck)' -r -======= -complete -c x -n "__fish_x_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck)' -r ->>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) complete -c x -n "__fish_x_using_subcommand test" -l compare-mode -d 'mode describing what file the actual ui output will be compared to' -r complete -c x -n "__fish_x_using_subcommand test" -l pass -d 'force {check,build,run}-pass tests to this mode' -r complete -c x -n "__fish_x_using_subcommand test" -l run -d 'whether to execute run-* tests' -r diff --git a/src/etc/completions/x.ps1 b/src/etc/completions/x.ps1 index fced6587d32a..4fee3bc0a869 100644 --- a/src/etc/completions/x.ps1 +++ b/src/etc/completions/x.ps1 @@ -345,11 +345,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { 'x;test' { [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)') [CompletionResult]::new('--compiletest-rustc-args', '--compiletest-rustc-args', [CompletionResultType]::ParameterName, 'extra options to pass the compiler when running compiletest tests') -<<<<<<< HEAD [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck, spellcheck)') -======= - [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck)') ->>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) [CompletionResult]::new('--compare-mode', '--compare-mode', [CompletionResultType]::ParameterName, 'mode describing what file the actual ui output will be compared to') [CompletionResult]::new('--pass', '--pass', [CompletionResultType]::ParameterName, 'force {check,build,run}-pass tests to this mode') [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests') diff --git a/src/etc/completions/x.py.fish b/src/etc/completions/x.py.fish index c80750111f7b..e2e6ae05ee03 100644 --- a/src/etc/completions/x.py.fish +++ b/src/etc/completions/x.py.fish @@ -299,11 +299,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand doc" -l skip-std-check-if-no-d complete -c x.py -n "__fish_x.py_using_subcommand doc" -s h -l help -d 'Print help (see more with \'--help\')' complete -c x.py -n "__fish_x.py_using_subcommand test" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r complete -c x.py -n "__fish_x.py_using_subcommand test" -l compiletest-rustc-args -d 'extra options to pass the compiler when running compiletest tests' -r -<<<<<<< HEAD complete -c x.py -n "__fish_x.py_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck, spellcheck)' -r -======= -complete -c x.py -n "__fish_x.py_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck)' -r ->>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) complete -c x.py -n "__fish_x.py_using_subcommand test" -l compare-mode -d 'mode describing what file the actual ui output will be compared to' -r complete -c x.py -n "__fish_x.py_using_subcommand test" -l pass -d 'force {check,build,run}-pass tests to this mode' -r complete -c x.py -n "__fish_x.py_using_subcommand test" -l run -d 'whether to execute run-* tests' -r diff --git a/src/etc/completions/x.py.ps1 b/src/etc/completions/x.py.ps1 index dfb6482b41c8..ea3aacc21c7a 100644 --- a/src/etc/completions/x.py.ps1 +++ b/src/etc/completions/x.py.ps1 @@ -345,11 +345,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { 'x.py;test' { [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)') [CompletionResult]::new('--compiletest-rustc-args', '--compiletest-rustc-args', [CompletionResultType]::ParameterName, 'extra options to pass the compiler when running compiletest tests') -<<<<<<< HEAD [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck, spellcheck)') -======= - [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, cpp, cpp:fmt, js, js:lint, js:typecheck)') ->>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) [CompletionResult]::new('--compare-mode', '--compare-mode', [CompletionResultType]::ParameterName, 'mode describing what file the actual ui output will be compared to') [CompletionResult]::new('--pass', '--pass', [CompletionResultType]::ParameterName, 'force {check,build,run}-pass tests to this mode') [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests') diff --git a/src/etc/completions/x.py.zsh b/src/etc/completions/x.py.zsh index 8ccc7a7091ce..32e986ad141f 100644 --- a/src/etc/completions/x.py.zsh +++ b/src/etc/completions/x.py.zsh @@ -345,11 +345,7 @@ _arguments "${_arguments_options[@]}" : \ _arguments "${_arguments_options[@]}" : \ '*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS:_default' \ '*--compiletest-rustc-args=[extra options to pass the compiler when running compiletest tests]:ARGS:_default' \ -<<<<<<< HEAD '--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, cpp, cpp\:fmt, js, js\:lint, js\:typecheck, spellcheck)]:EXTRA_CHECKS:_default' \ -======= -'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, cpp, cpp\:fmt, js, js\:lint, js\:typecheck)]:EXTRA_CHECKS:_default' \ ->>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) '--compare-mode=[mode describing what file the actual ui output will be compared to]:COMPARE MODE:_default' \ '--pass=[force {check,build,run}-pass tests to this mode]:check | build | run:_default' \ '--run=[whether to execute run-* tests]:auto | always | never:_default' \ diff --git a/src/etc/completions/x.zsh b/src/etc/completions/x.zsh index 8c00abb7b21a..65995553276d 100644 --- a/src/etc/completions/x.zsh +++ b/src/etc/completions/x.zsh @@ -345,11 +345,7 @@ _arguments "${_arguments_options[@]}" : \ _arguments "${_arguments_options[@]}" : \ '*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS:_default' \ '*--compiletest-rustc-args=[extra options to pass the compiler when running compiletest tests]:ARGS:_default' \ -<<<<<<< HEAD '--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, cpp, cpp\:fmt, js, js\:lint, js\:typecheck, spellcheck)]:EXTRA_CHECKS:_default' \ -======= -'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, cpp, cpp\:fmt, js, js\:lint, js\:typecheck)]:EXTRA_CHECKS:_default' \ ->>>>>>> 98204a1f527 (bootstrap: js:es-lint was removed, remove it from the docs) '--compare-mode=[mode describing what file the actual ui output will be compared to]:COMPARE MODE:_default' \ '--pass=[force {check,build,run}-pass tests to this mode]:check | build | run:_default' \ '--run=[whether to execute run-* tests]:auto | always | never:_default' \ From c6d50eaa497ef0c3013d21f23cd85e6e97c32c2c Mon Sep 17 00:00:00 2001 From: binarycat Date: Sat, 19 Jul 2025 14:56:42 -0500 Subject: [PATCH 111/183] integrate build_helper::npm into js checks and package.json usage --- src/build_helper/src/npm.rs | 43 ++++++++++++------- src/tools/rustdoc-gui-test/src/main.rs | 6 +-- .../tidy/src/ext_tool_checks/rustdoc_js.rs | 39 +++-------------- 3 files changed, 34 insertions(+), 54 deletions(-) diff --git a/src/build_helper/src/npm.rs b/src/build_helper/src/npm.rs index dedef40978dd..86cf6183bd04 100644 --- a/src/build_helper/src/npm.rs +++ b/src/build_helper/src/npm.rs @@ -3,23 +3,34 @@ use std::path::{Path, PathBuf}; use std::process::Command; use std::{fs, io}; -/// Install an exact package version, and return the path of `node_modules`. -pub fn install_one( - out_dir: &Path, - npm_bin: &Path, - pkg_name: &str, - pkg_version: &str, -) -> Result { +use crate::ci::CiEnv; + +/// Install all the npm deps, and return the path of `node_modules`. +pub fn install(src_root_path: &Path, out_dir: &Path, npm: &Path) -> Result { let nm_path = out_dir.join("node_modules"); - let _ = fs::create_dir(&nm_path); - let mut child = Command::new(npm_bin) - .arg("install") - .arg("--audit=false") - .arg("--fund=false") - .arg(format!("{pkg_name}@{pkg_version}")) - .current_dir(out_dir) - .spawn()?; - let exit_status = child.wait()?; + let copy_to_build = |p| { + fs::copy(src_root_path.join(p), out_dir.join(p)).map_err(|e| { + eprintln!("unable to copy {p:?} to build directory: {e:?}"); + e + }) + }; + // copy stuff to the output directory to make node_modules get put there. + copy_to_build("package.json")?; + copy_to_build("package-lock.json")?; + + let mut cmd = Command::new(npm); + if CiEnv::is_ci() { + // `npm ci` redownloads every time and thus is too slow for local development. + cmd.arg("ci"); + } else { + cmd.arg("install"); + } + // disable a bunch of things we don't want. + // this makes tidy output less noisy, and also significantly improves runtime + // of repeated tidy invokations. + cmd.args(&["--audit=false", "--save=false", "--fund=false"]); + cmd.current_dir(out_dir); + let exit_status = cmd.spawn()?.wait()?; if !exit_status.success() { eprintln!("npm install did not exit successfully"); return Err(io::Error::other(Box::::from(format!( diff --git a/src/tools/rustdoc-gui-test/src/main.rs b/src/tools/rustdoc-gui-test/src/main.rs index 5b86bea89329..42feae8c2080 100644 --- a/src/tools/rustdoc-gui-test/src/main.rs +++ b/src/tools/rustdoc-gui-test/src/main.rs @@ -65,10 +65,8 @@ fn main() -> Result<(), ()> { } } - // FIXME(binarycat): once we get package.json in version control, this should be updated to install via that instead - let local_node_modules = - npm::install_one(&config.out_dir, &config.npm, "browser-ui-test", "0.21.1") - .expect("unable to install browser-ui-test"); + let local_node_modules = npm::install(&config.rust_src, &config.out_dir, &config.npm) + .expect("unable to install browser-ui-test"); let mut command = Command::new(&config.nodejs); diff --git a/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs b/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs index f96c9612a8e1..c1a62cedd331 100644 --- a/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs +++ b/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs @@ -2,11 +2,11 @@ //! characters. use std::ffi::OsStr; +use std::io; use std::path::{Path, PathBuf}; use std::process::{Child, Command}; -use std::{fs, io}; -use build_helper::ci::CiEnv; +use build_helper::npm; use ignore::DirEntry; use crate::walk::walk_no_read; @@ -24,38 +24,9 @@ fn spawn_cmd(cmd: &mut Command) -> Result { /// install all js dependencies from package.json. pub(super) fn npm_install(root_path: &Path, outdir: &Path) -> Result<(), super::Error> { - let copy_to_build = |p| { - fs::copy(root_path.join(p), outdir.join(p)).map_err(|e| { - eprintln!("unable to copy {p:?} to build directory: {e:?}"); - e - }) - }; - // copy stuff to the output directory to make node_modules get put there. - copy_to_build("package.json")?; - copy_to_build("package-lock.json")?; - - let mut cmd = Command::new("npm"); - if CiEnv::is_ci() { - // `npm ci` redownloads every time and thus is too slow for local development. - cmd.arg("ci"); - } else { - cmd.arg("install"); - } - // disable a bunch of things we don't want. - // this makes tidy output less noisy, and also significantly improves runtime - // of repeated tidy invokations. - cmd.args(&["--audit=false", "--save=false", "--fund=false"]); - cmd.current_dir(outdir); - let mut child = spawn_cmd(&mut cmd)?; - match child.wait() { - Ok(exit_status) => { - if exit_status.success() { - return Ok(()); - } - Err(super::Error::FailedCheck("npm install")) - } - Err(error) => Err(super::Error::Generic(format!("npm install failed: {error:?}"))), - } + // FIXME(lolbinarycat): make this obey build.npm bootstrap option + npm::install(root_path, outdir, Path::new("npm"))?; + Ok(()) } fn rustdoc_js_files(librustdoc_path: &Path) -> Vec { From 8f77d5463a7e6906b7ac44ee235969a7758ef1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sat, 19 Jul 2025 19:39:27 +0000 Subject: [PATCH 112/183] add non-regression test for issue 144168 --- .../underscore-bindings-disambiguators.rs | 27 +++++++ .../underscore-bindings-disambiguators.stderr | 70 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 tests/ui/resolve/underscore-bindings-disambiguators.rs create mode 100644 tests/ui/resolve/underscore-bindings-disambiguators.stderr diff --git a/tests/ui/resolve/underscore-bindings-disambiguators.rs b/tests/ui/resolve/underscore-bindings-disambiguators.rs new file mode 100644 index 000000000000..8c89b39f8590 --- /dev/null +++ b/tests/ui/resolve/underscore-bindings-disambiguators.rs @@ -0,0 +1,27 @@ +// Regression test for issue #144168 where some `_` bindings were incorrectly only allowed once per +// module, failing with "error[E0428]: the name `_` is defined multiple times". + +// This weird/complex setup is reduced from `zerocopy-0.8.25` where the issue was encountered. + +#![crate_type = "lib"] + +macro_rules! impl_for_transmute_from { + () => { + const _: () = {}; + }; +} + +mod impls { + use super::*; + impl_for_transmute_from!(); + impl_for_transmute_from!(); + const _: () = todo!(); //~ ERROR: evaluation panicked + const _: () = todo!(); //~ ERROR: evaluation panicked + const _: () = todo!(); //~ ERROR: evaluation panicked + const _: () = todo!(); //~ ERROR: evaluation panicked + const _: () = todo!(); //~ ERROR: evaluation panicked +} +use X as Y; //~ ERROR: unresolved import +use Z as W; //~ ERROR: unresolved import + +const _: () = todo!(); //~ ERROR: evaluation panicked diff --git a/tests/ui/resolve/underscore-bindings-disambiguators.stderr b/tests/ui/resolve/underscore-bindings-disambiguators.stderr new file mode 100644 index 000000000000..0c8081a0c564 --- /dev/null +++ b/tests/ui/resolve/underscore-bindings-disambiguators.stderr @@ -0,0 +1,70 @@ +error[E0432]: unresolved import `X` + --> $DIR/underscore-bindings-disambiguators.rs:24:5 + | +LL | use X as Y; + | -^^^^^ + | | + | no `X` in the root + | help: a similar name exists in the module: `_` + +error[E0432]: unresolved import `Z` + --> $DIR/underscore-bindings-disambiguators.rs:25:5 + | +LL | use Z as W; + | -^^^^^ + | | + | no `Z` in the root + | help: a similar name exists in the module: `_` + +error[E0080]: evaluation panicked: not yet implemented + --> $DIR/underscore-bindings-disambiguators.rs:18:19 + | +LL | const _: () = todo!(); + | ^^^^^^^ evaluation of `impls::_` failed here + | + = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation panicked: not yet implemented + --> $DIR/underscore-bindings-disambiguators.rs:19:19 + | +LL | const _: () = todo!(); + | ^^^^^^^ evaluation of `impls::_` failed here + | + = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation panicked: not yet implemented + --> $DIR/underscore-bindings-disambiguators.rs:20:19 + | +LL | const _: () = todo!(); + | ^^^^^^^ evaluation of `impls::_` failed here + | + = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation panicked: not yet implemented + --> $DIR/underscore-bindings-disambiguators.rs:21:19 + | +LL | const _: () = todo!(); + | ^^^^^^^ evaluation of `impls::_` failed here + | + = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation panicked: not yet implemented + --> $DIR/underscore-bindings-disambiguators.rs:22:19 + | +LL | const _: () = todo!(); + | ^^^^^^^ evaluation of `impls::_` failed here + | + = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation panicked: not yet implemented + --> $DIR/underscore-bindings-disambiguators.rs:27:15 + | +LL | const _: () = todo!(); + | ^^^^^^^ evaluation of `_` failed here + | + = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 8 previous errors + +Some errors have detailed explanations: E0080, E0432. +For more information about an error, try `rustc --explain E0080`. From a6c7ceaae3a918caf7b2e4443441e781405af926 Mon Sep 17 00:00:00 2001 From: Chayim Refael Friedman Date: Sun, 20 Jul 2025 01:20:09 +0300 Subject: [PATCH 113/183] Fix search of raw labels and lifetimes It used to search for `'foo` which won't find `'r#foo`, now we search for `foo` instead. --- .../rust-analyzer/crates/ide-db/src/search.rs | 9 ++++- .../crates/ide/src/references.rs | 38 +++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide-db/src/search.rs b/src/tools/rust-analyzer/crates/ide-db/src/search.rs index 4efb83ba3235..9cf0bcf91901 100644 --- a/src/tools/rust-analyzer/crates/ide-db/src/search.rs +++ b/src/tools/rust-analyzer/crates/ide-db/src/search.rs @@ -531,7 +531,7 @@ impl<'a> FindUsages<'a> { node.token_at_offset(offset) .find(|it| { // `name` is stripped of raw ident prefix. See the comment on name retrieval below. - it.text().trim_start_matches("r#") == name + it.text().trim_start_matches('\'').trim_start_matches("r#") == name }) .into_iter() .flat_map(move |token| { @@ -938,7 +938,12 @@ impl<'a> FindUsages<'a> { }) }; // We need to search without the `r#`, hence `as_str` access. - self.def.name(sema.db).or_else(self_kw_refs).map(|it| it.as_str().to_smolstr()) + // We strip `'` from lifetimes and labels as otherwise they may not match with raw-escaped ones, + // e.g. if we search `'foo` we won't find `'r#foo`. + self.def + .name(sema.db) + .or_else(self_kw_refs) + .map(|it| it.as_str().trim_start_matches('\'').to_smolstr()) } }; let name = match &name { diff --git a/src/tools/rust-analyzer/crates/ide/src/references.rs b/src/tools/rust-analyzer/crates/ide/src/references.rs index fe874bc99b40..86b88a17c75f 100644 --- a/src/tools/rust-analyzer/crates/ide/src/references.rs +++ b/src/tools/rust-analyzer/crates/ide/src/references.rs @@ -3088,4 +3088,42 @@ fn main() { "#]], ); } + + #[test] + fn raw_labels_and_lifetimes() { + check( + r#" +fn foo<'r#fn>(s: &'r#fn str) { + let _a: &'r#fn str = s; + let _b: &'r#fn str; + 'r#break$0: { + break 'r#break; + } +} + "#, + expect![[r#" + 'r#break Label FileId(0) 87..96 87..95 + + FileId(0) 113..121 + "#]], + ); + check( + r#" +fn foo<'r#fn$0>(s: &'r#fn str) { + let _a: &'r#fn str = s; + let _b: &'r#fn str; + 'r#break: { + break 'r#break; + } +} + "#, + expect![[r#" + 'r#fn LifetimeParam FileId(0) 7..12 + + FileId(0) 18..23 + FileId(0) 44..49 + FileId(0) 72..77 + "#]], + ); + } } From 329fda0bc9be49a2107023ccca58fc67cd3d18b4 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Sun, 20 Jul 2025 05:00:42 +0000 Subject: [PATCH 114/183] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 601acc00bd6b..d734ec333a5c 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -ebd8557637b33cc09b6ee8273f3154d5d3af6a15 +6707bf0f59485cf054ac1095725df43220e4be20 From 8b6559b05b5c9c94888b6db2bc89b3da975578c5 Mon Sep 17 00:00:00 2001 From: Chayim Refael Friedman Date: Sun, 20 Jul 2025 11:56:45 +0300 Subject: [PATCH 115/183] Support `cfg_select!` --- .../rust-analyzer/crates/cfg/src/cfg_expr.rs | 14 +++- .../macro_expansion_tests/builtin_fn_macro.rs | 48 ++++++++++++++ .../crates/hir-expand/src/builtin/fn_macro.rs | 66 +++++++++++++++++++ .../crates/intern/src/symbol/symbols.rs | 1 + src/tools/rust-analyzer/crates/tt/src/iter.rs | 11 ++++ 5 files changed, 139 insertions(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs b/src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs index 0ec082dfa7fc..aed00aa9fc44 100644 --- a/src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs +++ b/src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs @@ -68,6 +68,11 @@ impl CfgExpr { next_cfg_expr(&mut tt.iter()).unwrap_or(CfgExpr::Invalid) } + #[cfg(feature = "tt")] + pub fn parse_from_iter(tt: &mut tt::iter::TtIter<'_, S>) -> CfgExpr { + next_cfg_expr(tt).unwrap_or(CfgExpr::Invalid) + } + /// Fold the cfg by querying all basic `Atom` and `KeyValue` predicates. pub fn fold(&self, query: &dyn Fn(&CfgAtom) -> bool) -> Option { match self { @@ -96,7 +101,14 @@ fn next_cfg_expr(it: &mut tt::iter::TtIter<'_, S>) -> Option { }; let ret = match it.peek() { - Some(TtElement::Leaf(tt::Leaf::Punct(punct))) if punct.char == '=' => { + Some(TtElement::Leaf(tt::Leaf::Punct(punct))) + // Don't consume on e.g. `=>`. + if punct.char == '=' + && (punct.spacing == tt::Spacing::Alone + || it.remaining().flat_tokens().get(1).is_none_or(|peek2| { + !matches!(peek2, tt::TokenTree::Leaf(tt::Leaf::Punct(_))) + })) => + { match it.remaining().flat_tokens().get(1) { Some(tt::TokenTree::Leaf(tt::Leaf::Literal(literal))) => { it.next(); diff --git a/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs b/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs index 1c3af47d522c..eeaf865338bd 100644 --- a/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs +++ b/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs @@ -550,3 +550,51 @@ fn main() { "\"hello\""; } "##]], ); } + +#[test] +fn cfg_select() { + check( + r#" +#[rustc_builtin_macro] +pub macro cfg_select($($tt:tt)*) {} + +cfg_select! { + false => { fn false_1() {} } + any(false, true) => { fn true_1() {} } +} + +cfg_select! { + false => { fn false_2() {} } + _ => { fn true_2() {} } +} + +cfg_select! { + false => { fn false_3() {} } +} + +cfg_select! { + false +} + +cfg_select! { + false => +} + + "#, + expect![[r#" +#[rustc_builtin_macro] +pub macro cfg_select($($tt:tt)*) {} + +fn true_1() {} + +fn true_2() {} + +/* error: none of the predicates in this `cfg_select` evaluated to true */ + +/* error: expected `=>` after cfg expression */ + +/* error: expected a token tree after `=>` */ + + "#]], + ); +} diff --git a/src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs b/src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs index 60fbc660652f..4a9af01091f2 100644 --- a/src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs +++ b/src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs @@ -127,6 +127,7 @@ register_builtin! { (asm, Asm) => asm_expand, (global_asm, GlobalAsm) => global_asm_expand, (naked_asm, NakedAsm) => naked_asm_expand, + (cfg_select, CfgSelect) => cfg_select_expand, (cfg, Cfg) => cfg_expand, (core_panic, CorePanic) => panic_expand, (std_panic, StdPanic) => panic_expand, @@ -355,6 +356,71 @@ fn naked_asm_expand( ExpandResult::ok(expanded) } +fn cfg_select_expand( + db: &dyn ExpandDatabase, + id: MacroCallId, + tt: &tt::TopSubtree, + span: Span, +) -> ExpandResult { + let loc = db.lookup_intern_macro_call(id); + let cfg_options = loc.krate.cfg_options(db); + + let mut iter = tt.iter(); + let mut expand_to = None; + while let Some(next) = iter.peek() { + let active = if let tt::TtElement::Leaf(tt::Leaf::Ident(ident)) = next + && ident.sym == sym::underscore + { + iter.next(); + true + } else { + cfg_options.check(&CfgExpr::parse_from_iter(&mut iter)) != Some(false) + }; + match iter.expect_glued_punct() { + Ok(it) if it.len() == 2 && it[0].char == '=' && it[1].char == '>' => {} + _ => { + let err_span = iter.peek().map(|it| it.first_span()).unwrap_or(span); + return ExpandResult::new( + tt::TopSubtree::empty(tt::DelimSpan::from_single(span)), + ExpandError::other(err_span, "expected `=>` after cfg expression"), + ); + } + } + let expand_to_if_active = match iter.next() { + Some(tt::TtElement::Subtree(_, tt)) => tt.remaining(), + _ => { + let err_span = iter.peek().map(|it| it.first_span()).unwrap_or(span); + return ExpandResult::new( + tt::TopSubtree::empty(tt::DelimSpan::from_single(span)), + ExpandError::other(err_span, "expected a token tree after `=>`"), + ); + } + }; + + if expand_to.is_none() && active { + expand_to = Some(expand_to_if_active); + } + } + match expand_to { + Some(expand_to) => { + let mut builder = tt::TopSubtreeBuilder::new(tt::Delimiter { + kind: tt::DelimiterKind::Invisible, + open: span, + close: span, + }); + builder.extend_with_tt(expand_to); + ExpandResult::ok(builder.build()) + } + None => ExpandResult::new( + tt::TopSubtree::empty(tt::DelimSpan::from_single(span)), + ExpandError::other( + span, + "none of the predicates in this `cfg_select` evaluated to true", + ), + ), + } +} + fn cfg_expand( db: &dyn ExpandDatabase, id: MacroCallId, diff --git a/src/tools/rust-analyzer/crates/intern/src/symbol/symbols.rs b/src/tools/rust-analyzer/crates/intern/src/symbol/symbols.rs index 1ccd20c25e90..4780743c4d92 100644 --- a/src/tools/rust-analyzer/crates/intern/src/symbol/symbols.rs +++ b/src/tools/rust-analyzer/crates/intern/src/symbol/symbols.rs @@ -156,6 +156,7 @@ define_symbols! { cfg_attr, cfg_eval, cfg, + cfg_select, char, clone, Clone, diff --git a/src/tools/rust-analyzer/crates/tt/src/iter.rs b/src/tools/rust-analyzer/crates/tt/src/iter.rs index 3246156f1cb7..2e89d762a0e4 100644 --- a/src/tools/rust-analyzer/crates/tt/src/iter.rs +++ b/src/tools/rust-analyzer/crates/tt/src/iter.rs @@ -217,6 +217,17 @@ pub enum TtElement<'a, S> { Subtree(&'a Subtree, TtIter<'a, S>), } +impl fmt::Debug for TtElement<'_, S> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Leaf(leaf) => f.debug_tuple("Leaf").field(leaf).finish(), + Self::Subtree(subtree, inner) => { + f.debug_tuple("Subtree").field(subtree).field(inner).finish() + } + } + } +} + impl TtElement<'_, S> { #[inline] pub fn first_span(&self) -> S { From fdf8bdb7a2a8c9a06045d9648ce0ab6bcf117a6d Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 20 Jul 2025 09:50:58 +0000 Subject: [PATCH 116/183] Remove the ptr_unique lang item Miri no longer uses it. --- compiler/rustc_hir/src/lang_items.rs | 3 --- compiler/rustc_span/src/symbol.rs | 1 - library/core/src/ptr/unique.rs | 2 -- 3 files changed, 6 deletions(-) diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs index 6347f1bfa714..75c04b23ed6e 100644 --- a/compiler/rustc_hir/src/lang_items.rs +++ b/compiler/rustc_hir/src/lang_items.rs @@ -345,9 +345,6 @@ language_item_table! { OwnedBox, sym::owned_box, owned_box, Target::Struct, GenericRequirement::Minimum(1); GlobalAlloc, sym::global_alloc_ty, global_alloc_ty, Target::Struct, GenericRequirement::None; - // Experimental lang item for Miri - PtrUnique, sym::ptr_unique, ptr_unique, Target::Struct, GenericRequirement::Exact(1); - PhantomData, sym::phantom_data, phantom_data, Target::Struct, GenericRequirement::Exact(1); ManuallyDrop, sym::manually_drop, manually_drop, Target::Struct, GenericRequirement::None; diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index d28a73bc1397..d0d09862ade2 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1698,7 +1698,6 @@ symbols! { ptr_slice_from_raw_parts_mut, ptr_swap, ptr_swap_nonoverlapping, - ptr_unique, ptr_write, ptr_write_bytes, ptr_write_unaligned, diff --git a/library/core/src/ptr/unique.rs b/library/core/src/ptr/unique.rs index c069314ff7d2..e9e13f9e97f8 100644 --- a/library/core/src/ptr/unique.rs +++ b/library/core/src/ptr/unique.rs @@ -32,8 +32,6 @@ use crate::ptr::NonNull; )] #[doc(hidden)] #[repr(transparent)] -// Lang item used experimentally by Miri to define the semantics of `Unique`. -#[lang = "ptr_unique"] pub struct Unique { pointer: NonNull, // NOTE: this marker has no consequences for variance, but is necessary From e9fb744207b64ff60e7f3dcec3897d76131b165a Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 20 Jul 2025 14:41:27 +0200 Subject: [PATCH 117/183] Add test --- tests/ui/uninhabited/auxiliary/staged-api.rs | 6 +++++ .../uninhabited-unstable-field.current.stderr | 25 +++++++++++++++++-- ...inhabited-unstable-field.exhaustive.stderr | 25 +++++++++++++++++-- .../uninhabited/uninhabited-unstable-field.rs | 23 ++++++++++++++--- 4 files changed, 71 insertions(+), 8 deletions(-) diff --git a/tests/ui/uninhabited/auxiliary/staged-api.rs b/tests/ui/uninhabited/auxiliary/staged-api.rs index 342ecf020ea5..925bb1e0c65a 100644 --- a/tests/ui/uninhabited/auxiliary/staged-api.rs +++ b/tests/ui/uninhabited/auxiliary/staged-api.rs @@ -6,3 +6,9 @@ pub struct Foo { #[unstable(feature = "unstable", issue = "none")] pub field: T, } + +#[unstable(feature = "my_coro_state", issue = "none")] +pub enum MyCoroutineState { + Yielded(Y), + Complete(R), +} diff --git a/tests/ui/uninhabited/uninhabited-unstable-field.current.stderr b/tests/ui/uninhabited/uninhabited-unstable-field.current.stderr index 9e0feb4c473f..704475ece484 100644 --- a/tests/ui/uninhabited/uninhabited-unstable-field.current.stderr +++ b/tests/ui/uninhabited/uninhabited-unstable-field.current.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: type `Foo` is non-empty - --> $DIR/uninhabited-unstable-field.rs:13:11 + --> $DIR/uninhabited-unstable-field.rs:15:11 | LL | match x {} | ^ @@ -17,6 +17,27 @@ LL + _ => todo!(), LL ~ } | -error: aborting due to 1 previous error +error[E0004]: non-exhaustive patterns: `MyCoroutineState::Complete(_)` not covered + --> $DIR/uninhabited-unstable-field.rs:34:11 + | +LL | match x { + | ^ pattern `MyCoroutineState::Complete(_)` not covered + | +note: `MyCoroutineState` defined here + --> $DIR/auxiliary/staged-api.rs:11:1 + | +LL | pub enum MyCoroutineState { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Yielded(Y), +LL | Complete(R), + | -------- not covered + = note: the matched value is of type `MyCoroutineState` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ MyCoroutineState::Yielded(_) => {}, +LL + MyCoroutineState::Complete(_) => todo!() + | + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0004`. diff --git a/tests/ui/uninhabited/uninhabited-unstable-field.exhaustive.stderr b/tests/ui/uninhabited/uninhabited-unstable-field.exhaustive.stderr index 9e0feb4c473f..704475ece484 100644 --- a/tests/ui/uninhabited/uninhabited-unstable-field.exhaustive.stderr +++ b/tests/ui/uninhabited/uninhabited-unstable-field.exhaustive.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: type `Foo` is non-empty - --> $DIR/uninhabited-unstable-field.rs:13:11 + --> $DIR/uninhabited-unstable-field.rs:15:11 | LL | match x {} | ^ @@ -17,6 +17,27 @@ LL + _ => todo!(), LL ~ } | -error: aborting due to 1 previous error +error[E0004]: non-exhaustive patterns: `MyCoroutineState::Complete(_)` not covered + --> $DIR/uninhabited-unstable-field.rs:34:11 + | +LL | match x { + | ^ pattern `MyCoroutineState::Complete(_)` not covered + | +note: `MyCoroutineState` defined here + --> $DIR/auxiliary/staged-api.rs:11:1 + | +LL | pub enum MyCoroutineState { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Yielded(Y), +LL | Complete(R), + | -------- not covered + = note: the matched value is of type `MyCoroutineState` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ MyCoroutineState::Yielded(_) => {}, +LL + MyCoroutineState::Complete(_) => todo!() + | + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0004`. diff --git a/tests/ui/uninhabited/uninhabited-unstable-field.rs b/tests/ui/uninhabited/uninhabited-unstable-field.rs index 9b507c518ab6..44527319ffd8 100644 --- a/tests/ui/uninhabited/uninhabited-unstable-field.rs +++ b/tests/ui/uninhabited/uninhabited-unstable-field.rs @@ -1,11 +1,13 @@ //@ aux-build: staged-api.rs //@ revisions: current exhaustive - -#![feature(exhaustive_patterns)] +#![cfg_attr(exhaustive, feature(exhaustive_patterns))] +#![feature(never_type)] +#![feature(my_coro_state)] // Custom feature from `staged-api.rs` +#![deny(unreachable_patterns)] extern crate staged_api; -use staged_api::Foo; +use staged_api::{Foo, MyCoroutineState}; enum Void {} @@ -23,7 +25,20 @@ fn demo2(x: Foo) { // Same as above, but for wildcard. fn demo3(x: Foo) { - match x { _ => {} } + match x { + _ => {} + } +} + +fn unstable_enum(x: MyCoroutineState) { + match x { + //~^ ERROR non-exhaustive patterns + MyCoroutineState::Yielded(_) => {} + } + match x { + MyCoroutineState::Yielded(_) => {} + MyCoroutineState::Complete(_) => {} + } } fn main() {} From 258e410feb78aaa2cc897f80124bc67c949df93b Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Thu, 3 Jul 2025 13:37:41 +0000 Subject: [PATCH 118/183] Unquerify maybe_unused_trait_imports. --- compiler/rustc_hir_analysis/src/check_unused.rs | 2 +- compiler/rustc_middle/src/query/mod.rs | 3 --- compiler/rustc_middle/src/ty/context.rs | 2 -- src/tools/clippy/clippy_lints/src/unused_trait_names.rs | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/check_unused.rs b/compiler/rustc_hir_analysis/src/check_unused.rs index 0133b1e8fcd3..3fb33c741c9d 100644 --- a/compiler/rustc_hir_analysis/src/check_unused.rs +++ b/compiler/rustc_hir_analysis/src/check_unused.rs @@ -18,7 +18,7 @@ pub(super) fn check_unused_traits(tcx: TyCtxt<'_>, (): ()) { used_trait_imports.extend_unord(imports.items().copied()); } - for &id in tcx.maybe_unused_trait_imports(()) { + for &id in tcx.resolutions(()).maybe_unused_trait_imports.iter() { debug_assert_eq!(tcx.def_kind(id), DefKind::Use); if tcx.visibility(id).is_public() { continue; diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index ae8c8259be4c..ad7f4973e235 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -2285,9 +2285,6 @@ rustc_queries! { query upvars_mentioned(def_id: DefId) -> Option<&'tcx FxIndexMap> { desc { |tcx| "collecting upvars mentioned in `{}`", tcx.def_path_str(def_id) } } - query maybe_unused_trait_imports(_: ()) -> &'tcx FxIndexSet { - desc { "fetching potentially unused trait imports" } - } /// All available crates in the graph, including those that should not be user-facing /// (such as private crates). diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 7e6bcfee0254..51db92ecd78f 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -3428,8 +3428,6 @@ pub struct DeducedParamAttrs { } pub fn provide(providers: &mut Providers) { - providers.maybe_unused_trait_imports = - |tcx, ()| &tcx.resolutions(()).maybe_unused_trait_imports; providers.extern_mod_stmt_cnum = |tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned(); providers.is_panic_runtime = diff --git a/src/tools/clippy/clippy_lints/src/unused_trait_names.rs b/src/tools/clippy/clippy_lints/src/unused_trait_names.rs index 610cec7b8c8d..b7a1d5b2123e 100644 --- a/src/tools/clippy/clippy_lints/src/unused_trait_names.rs +++ b/src/tools/clippy/clippy_lints/src/unused_trait_names.rs @@ -65,7 +65,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedTraitNames { && ident.name != kw::Underscore // Only check traits && let Some(Res::Def(DefKind::Trait, _)) = path.res.type_ns - && cx.tcx.maybe_unused_trait_imports(()).contains(&item.owner_id.def_id) + && cx.tcx.resolutions(()).maybe_unused_trait_imports.contains(&item.owner_id.def_id) // Only check this import if it is visible to its module only (no pub, pub(crate), ...) && let module = cx.tcx.parent_module_from_def_id(item.owner_id.def_id) && cx.tcx.visibility(item.owner_id.def_id) == Visibility::Restricted(module.to_def_id()) From 313dff14b93beab9d526e41563eb99135e96060c Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Fri, 4 Jul 2025 16:08:36 +0000 Subject: [PATCH 119/183] Add test. --- .../lifetimes/elided-lifetime-in-const-param-type.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs diff --git a/tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs new file mode 100644 index 000000000000..cdfd1327eaed --- /dev/null +++ b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs @@ -0,0 +1,12 @@ +//! Regression test for +//! The anonymous lifetime in `c(&())` is desugared by the resolver as an extra lifetime parameter +//! at the end of the `for` binder. Verify that lowering creates the definition for that extra +//! lifetime parameter before lowering `c(&())`. + +trait D {} + +type A = dyn for D; +//~^ ERROR cannot find type `c` in this scope +//~| ERROR only lifetime parameters can be used in this context + +fn main() {} From 7da6fd1221636354139fb92297788b0b5d6b9ca2 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Fri, 4 Jul 2025 16:43:20 +0000 Subject: [PATCH 120/183] Lower extra lifetimes before normal generic params. --- compiler/rustc_ast_lowering/src/lib.rs | 29 ++++++++++++------- ...elided-lifetime-in-const-param-type.stderr | 20 +++++++++++++ 2 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 tests/ui/lifetimes/elided-lifetime-in-const-param-type.stderr diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 1c96a375035a..1f377b81770a 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -856,25 +856,32 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { /// name resolver owing to lifetime elision; this also populates the resolver's node-id->def-id /// map, so that later calls to `opt_node_id_to_def_id` that refer to these extra lifetime /// parameters will be successful. - #[instrument(level = "debug", skip(self))] + #[instrument(level = "debug", skip(self), ret)] #[inline] fn lower_lifetime_binder( &mut self, binder: NodeId, generic_params: &[GenericParam], ) -> &'hir [hir::GenericParam<'hir>] { - let mut generic_params: Vec<_> = self - .lower_generic_params_mut(generic_params, hir::GenericParamSource::Binder) - .collect(); + // Start by creating params for extra lifetimes params, as this creates the definitions + // that may be referred to by the AST inside `generic_params`. let extra_lifetimes = self.resolver.extra_lifetime_params(binder); debug!(?extra_lifetimes); - generic_params.extend(extra_lifetimes.into_iter().filter_map(|(ident, node_id, res)| { - self.lifetime_res_to_generic_param(ident, node_id, res, hir::GenericParamSource::Binder) - })); - let generic_params = self.arena.alloc_from_iter(generic_params); - debug!(?generic_params); - - generic_params + let extra_lifetimes: Vec<_> = extra_lifetimes + .into_iter() + .filter_map(|(ident, node_id, res)| { + self.lifetime_res_to_generic_param( + ident, + node_id, + res, + hir::GenericParamSource::Binder, + ) + }) + .collect(); + let arena = self.arena; + let explicit_generic_params = + self.lower_generic_params_mut(generic_params, hir::GenericParamSource::Binder); + arena.alloc_from_iter(explicit_generic_params.chain(extra_lifetimes.into_iter())) } fn with_dyn_type_scope(&mut self, in_scope: bool, f: impl FnOnce(&mut Self) -> T) -> T { diff --git a/tests/ui/lifetimes/elided-lifetime-in-const-param-type.stderr b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.stderr new file mode 100644 index 000000000000..c7f3c0cc0cd6 --- /dev/null +++ b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.stderr @@ -0,0 +1,20 @@ +error[E0412]: cannot find type `c` in this scope + --> $DIR/elided-lifetime-in-const-param-type.rs:8:27 + | +LL | type A = dyn for D; + | ^ not found in this scope + +error[E0658]: only lifetime parameters can be used in this context + --> $DIR/elided-lifetime-in-const-param-type.rs:8:24 + | +LL | type A = dyn for D; + | ^ + | + = note: see issue #108185 for more information + = help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0412, E0658. +For more information about an error, try `rustc --explain E0412`. From 3567ab19a0edb4f6c7ca88157d84caa3e1564326 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 20 Jul 2025 14:28:58 +0200 Subject: [PATCH 121/183] Don't consider unstable fields always-inhabited This reverts the hack in https://github.com/rust-lang/rust/pull/133889 now that `Pin`'s field is no longer public. --- .../rustc_middle/src/ty/inhabitedness/mod.rs | 16 ------- compiler/rustc_pattern_analysis/src/rustc.rs | 7 +-- .../uninhabited-unstable-field.current.stderr | 43 ------------------- ...inhabited-unstable-field.exhaustive.stderr | 43 ------------------- .../uninhabited/uninhabited-unstable-field.rs | 17 ++++---- .../uninhabited-unstable-field.stderr | 40 +++++++++++++++++ 6 files changed, 51 insertions(+), 115 deletions(-) delete mode 100644 tests/ui/uninhabited/uninhabited-unstable-field.current.stderr delete mode 100644 tests/ui/uninhabited/uninhabited-unstable-field.exhaustive.stderr create mode 100644 tests/ui/uninhabited/uninhabited-unstable-field.stderr diff --git a/compiler/rustc_middle/src/ty/inhabitedness/mod.rs b/compiler/rustc_middle/src/ty/inhabitedness/mod.rs index 2a336cc21f49..7eb74b52b44c 100644 --- a/compiler/rustc_middle/src/ty/inhabitedness/mod.rs +++ b/compiler/rustc_middle/src/ty/inhabitedness/mod.rs @@ -43,7 +43,6 @@ //! This code should only compile in modules where the uninhabitedness of `Foo` //! is visible. -use rustc_span::sym; use rustc_type_ir::TyKind::*; use tracing::instrument; @@ -85,21 +84,6 @@ impl<'tcx> VariantDef { InhabitedPredicate::all( tcx, self.fields.iter().map(|field| { - // Unstable fields are always considered to be inhabited. In the future, - // this could be extended to be conditional on the field being unstable - // only within the module that's querying the inhabitedness, like: - // `let pred = pred.or(InhabitedPredicate::IsUnstable(field.did));` - // but this is unnecessary for now, since it would only affect nightly-only - // code or code within the standard library itself. - // HACK: We filter out `rustc_private` fields since with the flag - // `-Zforce-unstable-if-unmarked` we consider all unmarked fields to be - // unstable when building the compiler. - if tcx - .lookup_stability(field.did) - .is_some_and(|stab| stab.is_unstable() && stab.feature != sym::rustc_private) - { - return InhabitedPredicate::True; - } let pred = tcx.type_of(field.did).instantiate_identity().inhabited_predicate(tcx); if adt.is_enum() { return pred; diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index ee72b676b38e..0c1b0d622f22 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -16,7 +16,7 @@ use rustc_middle::ty::{ }; use rustc_middle::{bug, span_bug}; use rustc_session::lint; -use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, sym}; +use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span}; use crate::constructor::Constructor::*; use crate::constructor::{ @@ -238,10 +238,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { let is_visible = adt.is_enum() || field.vis.is_accessible_from(cx.module, cx.tcx); let is_uninhabited = cx.is_uninhabited(*ty); - let is_unstable = cx.tcx.lookup_stability(field.did).is_some_and(|stab| { - stab.is_unstable() && stab.feature != sym::rustc_private - }); - let skip = is_uninhabited && (!is_visible || is_unstable); + let skip = is_uninhabited && !is_visible; (ty, PrivateUninhabitedField(skip)) }); cx.dropless_arena.alloc_from_iter(tys) diff --git a/tests/ui/uninhabited/uninhabited-unstable-field.current.stderr b/tests/ui/uninhabited/uninhabited-unstable-field.current.stderr deleted file mode 100644 index 704475ece484..000000000000 --- a/tests/ui/uninhabited/uninhabited-unstable-field.current.stderr +++ /dev/null @@ -1,43 +0,0 @@ -error[E0004]: non-exhaustive patterns: type `Foo` is non-empty - --> $DIR/uninhabited-unstable-field.rs:15:11 - | -LL | match x {} - | ^ - | -note: `Foo` defined here - --> $DIR/auxiliary/staged-api.rs:5:1 - | -LL | pub struct Foo { - | ^^^^^^^^^^^^^^^^^ - = note: the matched value is of type `Foo` -help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown - | -LL ~ match x { -LL + _ => todo!(), -LL ~ } - | - -error[E0004]: non-exhaustive patterns: `MyCoroutineState::Complete(_)` not covered - --> $DIR/uninhabited-unstable-field.rs:34:11 - | -LL | match x { - | ^ pattern `MyCoroutineState::Complete(_)` not covered - | -note: `MyCoroutineState` defined here - --> $DIR/auxiliary/staged-api.rs:11:1 - | -LL | pub enum MyCoroutineState { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | Yielded(Y), -LL | Complete(R), - | -------- not covered - = note: the matched value is of type `MyCoroutineState` -help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown - | -LL ~ MyCoroutineState::Yielded(_) => {}, -LL + MyCoroutineState::Complete(_) => todo!() - | - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0004`. diff --git a/tests/ui/uninhabited/uninhabited-unstable-field.exhaustive.stderr b/tests/ui/uninhabited/uninhabited-unstable-field.exhaustive.stderr deleted file mode 100644 index 704475ece484..000000000000 --- a/tests/ui/uninhabited/uninhabited-unstable-field.exhaustive.stderr +++ /dev/null @@ -1,43 +0,0 @@ -error[E0004]: non-exhaustive patterns: type `Foo` is non-empty - --> $DIR/uninhabited-unstable-field.rs:15:11 - | -LL | match x {} - | ^ - | -note: `Foo` defined here - --> $DIR/auxiliary/staged-api.rs:5:1 - | -LL | pub struct Foo { - | ^^^^^^^^^^^^^^^^^ - = note: the matched value is of type `Foo` -help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown - | -LL ~ match x { -LL + _ => todo!(), -LL ~ } - | - -error[E0004]: non-exhaustive patterns: `MyCoroutineState::Complete(_)` not covered - --> $DIR/uninhabited-unstable-field.rs:34:11 - | -LL | match x { - | ^ pattern `MyCoroutineState::Complete(_)` not covered - | -note: `MyCoroutineState` defined here - --> $DIR/auxiliary/staged-api.rs:11:1 - | -LL | pub enum MyCoroutineState { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | Yielded(Y), -LL | Complete(R), - | -------- not covered - = note: the matched value is of type `MyCoroutineState` -help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown - | -LL ~ MyCoroutineState::Yielded(_) => {}, -LL + MyCoroutineState::Complete(_) => todo!() - | - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0004`. diff --git a/tests/ui/uninhabited/uninhabited-unstable-field.rs b/tests/ui/uninhabited/uninhabited-unstable-field.rs index 44527319ffd8..321b864aa27d 100644 --- a/tests/ui/uninhabited/uninhabited-unstable-field.rs +++ b/tests/ui/uninhabited/uninhabited-unstable-field.rs @@ -1,6 +1,9 @@ //@ aux-build: staged-api.rs -//@ revisions: current exhaustive -#![cfg_attr(exhaustive, feature(exhaustive_patterns))] +//! The field of `Pin` used to be public, which would cause `Pin` to be uninhabited. To remedy +//! this, we temporarily made it so unstable fields are always considered inhabited. This has now +//! been reverted, and this file ensures that we don't special-case unstable fields wrt +//! inhabitedness anymore. +#![feature(exhaustive_patterns)] #![feature(never_type)] #![feature(my_coro_state)] // Custom feature from `staged-api.rs` #![deny(unreachable_patterns)] @@ -13,31 +16,29 @@ enum Void {} fn demo(x: Foo) { match x {} - //~^ ERROR non-exhaustive patterns } -// Ensure that the pattern is not considered unreachable. +// Ensure that the pattern is considered unreachable. fn demo2(x: Foo) { match x { - Foo { .. } => {} + Foo { .. } => {} //~ ERROR unreachable } } // Same as above, but for wildcard. fn demo3(x: Foo) { match x { - _ => {} + _ => {} //~ ERROR unreachable } } fn unstable_enum(x: MyCoroutineState) { match x { - //~^ ERROR non-exhaustive patterns MyCoroutineState::Yielded(_) => {} } match x { MyCoroutineState::Yielded(_) => {} - MyCoroutineState::Complete(_) => {} + MyCoroutineState::Complete(_) => {} //~ ERROR unreachable } } diff --git a/tests/ui/uninhabited/uninhabited-unstable-field.stderr b/tests/ui/uninhabited/uninhabited-unstable-field.stderr new file mode 100644 index 000000000000..a0c9f9366a6b --- /dev/null +++ b/tests/ui/uninhabited/uninhabited-unstable-field.stderr @@ -0,0 +1,40 @@ +error: unreachable pattern + --> $DIR/uninhabited-unstable-field.rs:24:9 + | +LL | Foo { .. } => {} + | ^^^^^^^^^^------ + | | + | matches no values because `Foo` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types +note: the lint level is defined here + --> $DIR/uninhabited-unstable-field.rs:9:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/uninhabited-unstable-field.rs:31:9 + | +LL | _ => {} + | ^------ + | | + | matches no values because `Foo` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types + +error: unreachable pattern + --> $DIR/uninhabited-unstable-field.rs:41:9 + | +LL | MyCoroutineState::Complete(_) => {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------ + | | + | matches no values because `!` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types + +error: aborting due to 3 previous errors + From 08b816ff18347031b1160f1257cde2008c3c366e Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sat, 12 Jul 2025 02:33:42 -0700 Subject: [PATCH 122/183] So many test updates x_x --- tests/auxiliary/minisimd.rs | 160 ++++++++++++++ tests/codegen/const-vector.rs | 38 ++-- .../simd-intrinsic-float-abs.rs | 32 +-- .../simd-intrinsic-float-ceil.rs | 32 +-- .../simd-intrinsic-float-cos.rs | 32 +-- .../simd-intrinsic-float-exp.rs | 32 +-- .../simd-intrinsic-float-exp2.rs | 32 +-- .../simd-intrinsic-float-floor.rs | 32 +-- .../simd-intrinsic-float-fma.rs | 32 +-- .../simd-intrinsic-float-fsqrt.rs | 32 +-- .../simd-intrinsic-float-log.rs | 32 +-- .../simd-intrinsic-float-log10.rs | 32 +-- .../simd-intrinsic-float-log2.rs | 32 +-- .../simd-intrinsic-float-minmax.rs | 8 +- .../simd-intrinsic-float-sin.rs | 32 +-- ...intrinsic-generic-arithmetic-saturating.rs | 63 +----- .../simd-intrinsic-generic-bitmask.rs | 16 +- .../simd-intrinsic-generic-gather.rs | 13 +- .../simd-intrinsic-generic-masked-load.rs | 13 +- .../simd-intrinsic-generic-masked-store.rs | 13 +- .../simd-intrinsic-generic-scatter.rs | 13 +- .../simd-intrinsic-generic-select.rs | 24 +- .../simd-intrinsic-mask-reduce.rs | 13 +- .../simd-intrinsic-transmute-array.rs | 15 +- tests/codegen/simd/aggregate-simd.rs | 10 +- tests/codegen/simd/packed-simd.rs | 12 +- tests/codegen/simd/simd_arith_offset.rs | 12 +- tests/ui/simd/generics.rs | 60 ++--- tests/ui/simd/intrinsic/float-math-pass.rs | 22 +- tests/ui/simd/intrinsic/float-minmax-pass.rs | 16 +- .../simd/intrinsic/generic-arithmetic-pass.rs | 206 ++++++++++-------- .../generic-arithmetic-saturating-pass.rs | 82 ++++--- tests/ui/simd/intrinsic/generic-as.rs | 38 ++-- tests/ui/simd/intrinsic/generic-bswap-byte.rs | 16 +- tests/ui/simd/intrinsic/generic-cast-pass.rs | 38 ++-- .../intrinsic/generic-cast-pointer-width.rs | 16 +- .../simd/intrinsic/generic-comparison-pass.rs | 43 ++-- .../simd/intrinsic/generic-elements-pass.rs | 112 +++++----- .../intrinsic/generic-gather-scatter-pass.rs | 34 +-- .../ui/simd/intrinsic/generic-select-pass.rs | 94 ++++---- .../ui/simd/intrinsic/inlining-issue67557.rs | 20 +- tests/ui/simd/intrinsic/ptr-cast.rs | 16 +- tests/ui/simd/issue-39720.rs | 14 +- tests/ui/simd/issue-85915-simd-ptrs.rs | 32 +-- tests/ui/simd/issue-89193.rs | 22 +- tests/ui/simd/masked-load-store.rs | 10 +- tests/ui/simd/monomorphize-shuffle-index.rs | 12 +- tests/ui/simd/repr_packed.rs | 28 ++- tests/ui/simd/shuffle.rs | 10 +- tests/ui/simd/simd-bitmask-notpow2.rs | 21 +- tests/ui/simd/simd-bitmask.rs | 16 +- tests/ui/simd/target-feature-mixup.rs | 41 ++-- 52 files changed, 797 insertions(+), 1029 deletions(-) create mode 100644 tests/auxiliary/minisimd.rs diff --git a/tests/auxiliary/minisimd.rs b/tests/auxiliary/minisimd.rs new file mode 100644 index 000000000000..ff0c996de1c8 --- /dev/null +++ b/tests/auxiliary/minisimd.rs @@ -0,0 +1,160 @@ +//! Auxiliary crate for tests that need SIMD types. +//! +//! Historically the tests just made their own, but projections into simd types +//! was banned by , which +//! breaks `derive(Clone)`, so this exists to give easily-usable types that can +//! be used without copy-pasting the definitions of the helpers everywhere. +//! +//! This makes no attempt to guard against ICEs. Using it with proper types +//! and such is your responsibility in the tests you write. + +#![allow(unused)] +#![allow(non_camel_case_types)] + +// The field is currently left `pub` for convenience in porting tests, many of +// which attempt to just construct it directly. That still works; it's just the +// `.0` projection that doesn't. +#[repr(simd)] +#[derive(Copy, Eq)] +pub struct Simd(pub [T; N]); + +impl Clone for Simd { + fn clone(&self) -> Self { + *self + } +} + +impl PartialEq for Simd { + fn eq(&self, other: &Self) -> bool { + self.as_array() == other.as_array() + } +} + +impl core::fmt::Debug for Simd { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> { + <[T; N] as core::fmt::Debug>::fmt(self.as_array(), f) + } +} + +impl core::ops::Index for Simd { + type Output = T; + fn index(&self, i: usize) -> &T { + &self.as_array()[i] + } +} + +impl Simd { + pub const fn from_array(a: [T; N]) -> Self { + Simd(a) + } + pub fn as_array(&self) -> &[T; N] { + let p: *const Self = self; + unsafe { &*p.cast::<[T; N]>() } + } + pub fn into_array(self) -> [T; N] + where + T: Copy, + { + *self.as_array() + } +} + +pub type u8x2 = Simd; +pub type u8x4 = Simd; +pub type u8x8 = Simd; +pub type u8x16 = Simd; +pub type u8x32 = Simd; +pub type u8x64 = Simd; + +pub type u16x2 = Simd; +pub type u16x4 = Simd; +pub type u16x8 = Simd; +pub type u16x16 = Simd; +pub type u16x32 = Simd; + +pub type u32x2 = Simd; +pub type u32x4 = Simd; +pub type u32x8 = Simd; +pub type u32x16 = Simd; + +pub type u64x2 = Simd; +pub type u64x4 = Simd; +pub type u64x8 = Simd; + +pub type u128x2 = Simd; +pub type u128x4 = Simd; + +pub type i8x2 = Simd; +pub type i8x4 = Simd; +pub type i8x8 = Simd; +pub type i8x16 = Simd; +pub type i8x32 = Simd; +pub type i8x64 = Simd; + +pub type i16x2 = Simd; +pub type i16x4 = Simd; +pub type i16x8 = Simd; +pub type i16x16 = Simd; +pub type i16x32 = Simd; + +pub type i32x2 = Simd; +pub type i32x4 = Simd; +pub type i32x8 = Simd; +pub type i32x16 = Simd; + +pub type i64x2 = Simd; +pub type i64x4 = Simd; +pub type i64x8 = Simd; + +pub type i128x2 = Simd; +pub type i128x4 = Simd; + +pub type f32x2 = Simd; +pub type f32x4 = Simd; +pub type f32x8 = Simd; +pub type f32x16 = Simd; + +pub type f64x2 = Simd; +pub type f64x4 = Simd; +pub type f64x8 = Simd; + +// The field is currently left `pub` for convenience in porting tests, many of +// which attempt to just construct it directly. That still works; it's just the +// `.0` projection that doesn't. +#[repr(simd, packed)] +#[derive(Copy)] +pub struct PackedSimd(pub [T; N]); + +impl Clone for PackedSimd { + fn clone(&self) -> Self { + *self + } +} + +impl PartialEq for PackedSimd { + fn eq(&self, other: &Self) -> bool { + self.as_array() == other.as_array() + } +} + +impl core::fmt::Debug for PackedSimd { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> { + <[T; N] as core::fmt::Debug>::fmt(self.as_array(), f) + } +} + +impl PackedSimd { + pub const fn from_array(a: [T; N]) -> Self { + PackedSimd(a) + } + pub fn as_array(&self) -> &[T; N] { + let p: *const Self = self; + unsafe { &*p.cast::<[T; N]>() } + } + pub fn into_array(self) -> [T; N] + where + T: Copy, + { + *self.as_array() + } +} diff --git a/tests/codegen/const-vector.rs b/tests/codegen/const-vector.rs index 42921442e039..a2249f4fff7b 100644 --- a/tests/codegen/const-vector.rs +++ b/tests/codegen/const-vector.rs @@ -16,18 +16,9 @@ #![feature(mips_target_feature)] #![allow(non_camel_case_types)] -// Setting up structs that can be used as const vectors -#[repr(simd)] -#[derive(Clone)] -pub struct i8x2([i8; 2]); - -#[repr(simd)] -#[derive(Clone)] -pub struct f32x2([f32; 2]); - -#[repr(simd, packed)] -#[derive(Copy, Clone)] -pub struct Simd([T; N]); +#[path = "../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::{PackedSimd as Simd, f32x2, i8x2}; // The following functions are required for the tests to ensure // that they are called with a const vector @@ -45,7 +36,7 @@ extern "unadjusted" { // Ensure the packed variant of the simd struct does not become a const vector // if the size is not a power of 2 -// CHECK: %"Simd" = type { [3 x i32] } +// CHECK: %"minisimd::PackedSimd" = type { [3 x i32] } #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))] #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))] @@ -54,27 +45,34 @@ extern "unadjusted" { pub fn do_call() { unsafe { // CHECK: call void @test_i8x2(<2 x i8> - test_i8x2(const { i8x2([32, 64]) }); + test_i8x2(const { i8x2::from_array([32, 64]) }); // CHECK: call void @test_i8x2_two_args(<2 x i8> , <2 x i8> - test_i8x2_two_args(const { i8x2([32, 64]) }, const { i8x2([8, 16]) }); + test_i8x2_two_args( + const { i8x2::from_array([32, 64]) }, + const { i8x2::from_array([8, 16]) }, + ); // CHECK: call void @test_i8x2_mixed_args(<2 x i8> , i32 43, <2 x i8> - test_i8x2_mixed_args(const { i8x2([32, 64]) }, 43, const { i8x2([8, 16]) }); + test_i8x2_mixed_args( + const { i8x2::from_array([32, 64]) }, + 43, + const { i8x2::from_array([8, 16]) }, + ); // CHECK: call void @test_i8x2_arr(<2 x i8> - test_i8x2_arr(const { i8x2([32, 64]) }); + test_i8x2_arr(const { i8x2::from_array([32, 64]) }); // CHECK: call void @test_f32x2(<2 x float> - test_f32x2(const { f32x2([0.32, 0.64]) }); + test_f32x2(const { f32x2::from_array([0.32, 0.64]) }); // CHECK: void @test_f32x2_arr(<2 x float> - test_f32x2_arr(const { f32x2([0.32, 0.64]) }); + test_f32x2_arr(const { f32x2::from_array([0.32, 0.64]) }); // CHECK: call void @test_simd(<4 x i32> test_simd(const { Simd::([2, 4, 6, 8]) }); - // CHECK: call void @test_simd_unaligned(%"Simd" %1 + // CHECK: call void @test_simd_unaligned(%"minisimd::PackedSimd" %1 test_simd_unaligned(const { Simd::([2, 4, 6]) }); } } diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs index 485ba92272dd..baf445d0a1b3 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_fabs; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @fabs_32x2 #[no_mangle] pub unsafe fn fabs_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn fabs_32x16(a: f32x16) -> f32x16 { simd_fabs(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @fabs_64x4 #[no_mangle] pub unsafe fn fabs_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs index e8bda7c29c4b..096de5692742 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_ceil; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @ceil_32x2 #[no_mangle] pub unsafe fn ceil_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn ceil_32x16(a: f32x16) -> f32x16 { simd_ceil(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @ceil_64x4 #[no_mangle] pub unsafe fn ceil_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs index 8dc967bc3adc..5b2197924bc7 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_fcos; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @fcos_32x2 #[no_mangle] pub unsafe fn fcos_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn fcos_32x16(a: f32x16) -> f32x16 { simd_fcos(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @fcos_64x4 #[no_mangle] pub unsafe fn fcos_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs index 00caca2f2949..d4eadb36c65f 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_fexp; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @exp_32x2 #[no_mangle] pub unsafe fn exp_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn exp_32x16(a: f32x16) -> f32x16 { simd_fexp(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @exp_64x4 #[no_mangle] pub unsafe fn exp_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs index eda4053189cb..d32015b79901 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_fexp2; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @exp2_32x2 #[no_mangle] pub unsafe fn exp2_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn exp2_32x16(a: f32x16) -> f32x16 { simd_fexp2(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @exp2_64x4 #[no_mangle] pub unsafe fn exp2_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs index ad69d4cdd88c..1e1c8ce0c352 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_floor; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @floor_32x2 #[no_mangle] pub unsafe fn floor_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn floor_32x16(a: f32x16) -> f32x16 { simd_floor(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @floor_64x4 #[no_mangle] pub unsafe fn floor_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs index cbeefdc31c0d..982077d81f9a 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_fma; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @fma_32x2 #[no_mangle] pub unsafe fn fma_32x2(a: f32x2, b: f32x2, c: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn fma_32x16(a: f32x16, b: f32x16, c: f32x16) -> f32x16 { simd_fma(a, b, c) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @fma_64x4 #[no_mangle] pub unsafe fn fma_64x4(a: f64x4, b: f64x4, c: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs index 618daa4b44d0..e20a591f573b 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_fsqrt; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @fsqrt_32x2 #[no_mangle] pub unsafe fn fsqrt_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn fsqrt_32x16(a: f32x16) -> f32x16 { simd_fsqrt(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @fsqrt_64x4 #[no_mangle] pub unsafe fn fsqrt_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs index 98a481e4004e..bf1ffc763309 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_flog; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @log_32x2 #[no_mangle] pub unsafe fn log_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn log_32x16(a: f32x16) -> f32x16 { simd_flog(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @log_64x4 #[no_mangle] pub unsafe fn log_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs index 9108cd963f02..ccf484e0e415 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_flog10; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @log10_32x2 #[no_mangle] pub unsafe fn log10_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn log10_32x16(a: f32x16) -> f32x16 { simd_flog10(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @log10_64x4 #[no_mangle] pub unsafe fn log10_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs index 2b20850dbd9a..677d8b01e848 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_flog2; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @log2_32x2 #[no_mangle] pub unsafe fn log2_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn log2_32x16(a: f32x16) -> f32x16 { simd_flog2(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @log2_64x4 #[no_mangle] pub unsafe fn log2_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs index ce07b212e846..8dd464a1bffb 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs @@ -4,11 +4,11 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] -use std::intrinsics::simd::{simd_fmax, simd_fmin}; +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); +use std::intrinsics::simd::{simd_fmax, simd_fmin}; // CHECK-LABEL: @fmin #[no_mangle] diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs index 7de26b415bbb..48becc72c0be 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs @@ -4,24 +4,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_fsin; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x2(pub [f32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8(pub [f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x16(pub [f32; 16]); - // CHECK-LABEL: @fsin_32x2 #[no_mangle] pub unsafe fn fsin_32x2(a: f32x2) -> f32x2 { @@ -50,18 +38,6 @@ pub unsafe fn fsin_32x16(a: f32x16) -> f32x16 { simd_fsin(a) } -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x2(pub [f64; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x4(pub [f64; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f64x8(pub [f64; 8]); - // CHECK-LABEL: @fsin_64x4 #[no_mangle] pub unsafe fn fsin_64x4(a: f64x4) -> f64x4 { diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs index ecf5eb24ee5b..06d468897152 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs @@ -5,67 +5,12 @@ #![allow(non_camel_case_types)] #![deny(unused)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::{simd_saturating_add, simd_saturating_sub}; -#[rustfmt::skip] -mod types { - // signed integer types - - #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x2([i8; 2]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x4([i8; 4]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x8([i8; 8]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x16([i8; 16]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x32([i8; 32]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x64([i8; 64]); - - #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x2([i16; 2]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x4([i16; 4]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x8([i16; 8]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x16([i16; 16]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x32([i16; 32]); - - #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x2([i32; 2]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x4([i32; 4]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x8([i32; 8]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x16([i32; 16]); - - #[repr(simd)] #[derive(Copy, Clone)] pub struct i64x2([i64; 2]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i64x4([i64; 4]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i64x8([i64; 8]); - - #[repr(simd)] #[derive(Copy, Clone)] pub struct i128x2([i128; 2]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct i128x4([i128; 4]); - - // unsigned integer types - - #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x2([u8; 2]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x4([u8; 4]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x8([u8; 8]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x16([u8; 16]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x32([u8; 32]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x64([u8; 64]); - - #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x2([u16; 2]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x4([u16; 4]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x8([u16; 8]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x16([u16; 16]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x32([u16; 32]); - - #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x2([u32; 2]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x4([u32; 4]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x8([u32; 8]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x16([u32; 16]); - - #[repr(simd)] #[derive(Copy, Clone)] pub struct u64x2([u64; 2]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u64x4([u64; 4]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u64x8([u64; 8]); - - #[repr(simd)] #[derive(Copy, Clone)] pub struct u128x2([u128; 2]); - #[repr(simd)] #[derive(Copy, Clone)] pub struct u128x4([u128; 4]); -} - -use types::*; - // NOTE(eddyb) `%{{x|0}}` is used because on some targets (e.g. WASM) // SIMD vectors are passed directly, resulting in `%x` being a vector, // while on others they're passed indirectly, resulting in `%x` being diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs index a2c40aa91b51..294262d81526 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs @@ -5,20 +5,12 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_bitmask; -#[repr(simd)] -#[derive(Copy, Clone)] -pub struct u32x2([u32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone)] -pub struct i32x2([i32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone)] -pub struct i8x16([i8; 16]); - // NOTE(eddyb) `%{{x|1}}` is used because on some targets (e.g. WASM) // SIMD vectors are passed directly, resulting in `%x` being a vector, // while on others they're passed indirectly, resulting in `%x` being diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs index c06b36d68b90..690bfb432f9b 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs @@ -6,15 +6,14 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_gather; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct Vec2(pub [T; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct Vec4(pub [T; 4]); +pub type Vec2 = Simd; +pub type Vec4 = Simd; // CHECK-LABEL: @gather_f32x2 #[no_mangle] diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs index 21578e67cffc..fda315dc66ca 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs @@ -4,15 +4,14 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_masked_load; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct Vec2(pub [T; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct Vec4(pub [T; 4]); +pub type Vec2 = Simd; +pub type Vec4 = Simd; // CHECK-LABEL: @load_f32x2 #[no_mangle] diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs index 22a8f7e54bd3..6ca7388d464b 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs @@ -4,15 +4,14 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_masked_store; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct Vec2(pub [T; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct Vec4(pub [T; 4]); +pub type Vec2 = Simd; +pub type Vec4 = Simd; // CHECK-LABEL: @store_f32x2 #[no_mangle] diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs index 0cc9e6ae59ad..743652966e16 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs @@ -6,15 +6,14 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_scatter; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct Vec2(pub [T; 2]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct Vec4(pub [T; 4]); +pub type Vec2 = Simd; +pub type Vec4 = Simd; // CHECK-LABEL: @scatter_f32x2 #[no_mangle] diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs index f6531c1b23ae..2c0bad21f44b 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs @@ -4,27 +4,13 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::{simd_select, simd_select_bitmask}; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct f32x8([f32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct b8x4(pub [i8; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct i32x4([i32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -pub struct u32x4([u32; 4]); +pub type b8x4 = i8x4; // CHECK-LABEL: @select_m8 #[no_mangle] diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs index 269fe41225ef..79f00a6ed603 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs @@ -4,15 +4,14 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::{simd_reduce_all, simd_reduce_any}; -#[repr(simd)] -#[derive(Copy, Clone)] -pub struct mask32x2([i32; 2]); - -#[repr(simd)] -#[derive(Copy, Clone)] -pub struct mask8x16([i8; 16]); +pub type mask32x2 = Simd; +pub type mask8x16 = Simd; // NOTE(eddyb) `%{{x|1}}` is used because on some targets (e.g. WASM) // SIMD vectors are passed directly, resulting in `%x` being a vector, diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs index 301f06c2d74a..05c2f7e1bdfc 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs @@ -8,13 +8,12 @@ #![allow(non_camel_case_types)] #![feature(repr_simd, core_intrinsics)] -#[repr(simd)] -#[derive(Copy, Clone)] -pub struct S([f32; N]); +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; -#[repr(simd)] -#[derive(Copy, Clone)] -pub struct T([f32; 4]); +pub type S = Simd; +pub type T = Simd; // CHECK-LABEL: @array_align( #[no_mangle] @@ -34,7 +33,7 @@ pub fn vector_align() -> usize { #[no_mangle] pub fn build_array_s(x: [f32; 4]) -> S<4> { // CHECK: call void @llvm.memcpy.{{.+}}({{.*}} align [[VECTOR_ALIGN]] {{.*}} align [[ARRAY_ALIGN]] {{.*}}, [[USIZE]] 16, i1 false) - S::<4>(x) + Simd(x) } // CHECK-LABEL: @build_array_transmute_s @@ -48,7 +47,7 @@ pub fn build_array_transmute_s(x: [f32; 4]) -> S<4> { #[no_mangle] pub fn build_array_t(x: [f32; 4]) -> T { // CHECK: call void @llvm.memcpy.{{.+}}({{.*}} align [[VECTOR_ALIGN]] {{.*}} align [[ARRAY_ALIGN]] {{.*}}, [[USIZE]] 16, i1 false) - T(x) + Simd(x) } // CHECK-LABEL: @build_array_transmute_t diff --git a/tests/codegen/simd/aggregate-simd.rs b/tests/codegen/simd/aggregate-simd.rs index 065e429a4c78..57a301d634c8 100644 --- a/tests/codegen/simd/aggregate-simd.rs +++ b/tests/codegen/simd/aggregate-simd.rs @@ -5,15 +5,11 @@ #![no_std] #![crate_type = "lib"] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; use core::intrinsics::simd::{simd_add, simd_extract}; -#[repr(simd)] -#[derive(Clone, Copy)] -pub struct Simd([T; N]); - -#[repr(simd, packed)] -#[derive(Clone, Copy)] -pub struct PackedSimd([T; N]); +use minisimd::*; #[repr(transparent)] pub struct Transparent(T); diff --git a/tests/codegen/simd/packed-simd.rs b/tests/codegen/simd/packed-simd.rs index 73e0d29d7d67..70c03fcc9557 100644 --- a/tests/codegen/simd/packed-simd.rs +++ b/tests/codegen/simd/packed-simd.rs @@ -9,18 +9,14 @@ use core::intrinsics::simd as intrinsics; use core::{mem, ptr}; +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::{PackedSimd, Simd as FullSimd}; + // Test codegen for not only "packed" but also "fully aligned" SIMD types, and conversion between // them. A repr(packed,simd) type with 3 elements can't exceed its element alignment, whereas the // same type as repr(simd) will instead have padding. -#[repr(simd, packed)] -#[derive(Copy, Clone)] -pub struct PackedSimd([T; N]); - -#[repr(simd)] -#[derive(Copy, Clone)] -pub struct FullSimd([T; N]); - // non-powers-of-two have padding and need to be expanded to full vectors fn load(v: PackedSimd) -> FullSimd { unsafe { diff --git a/tests/codegen/simd/simd_arith_offset.rs b/tests/codegen/simd/simd_arith_offset.rs index b8af6fce3326..210b4e9bb50e 100644 --- a/tests/codegen/simd/simd_arith_offset.rs +++ b/tests/codegen/simd/simd_arith_offset.rs @@ -5,16 +5,14 @@ #![crate_type = "lib"] #![feature(repr_simd, core_intrinsics)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; use std::intrinsics::simd::simd_arith_offset; -/// A vector of *const T. -#[derive(Debug, Copy, Clone)] -#[repr(simd)] -pub struct SimdConstPtr([*const T; LANES]); +use minisimd::*; -#[derive(Debug, Copy, Clone)] -#[repr(simd)] -pub struct Simd([T; LANES]); +/// A vector of *const T. +pub type SimdConstPtr = Simd<*const T, LANES>; // CHECK-LABEL: smoke #[no_mangle] diff --git a/tests/ui/simd/generics.rs b/tests/ui/simd/generics.rs index 1ae08fef7cdf..54e76f7bc5d8 100644 --- a/tests/ui/simd/generics.rs +++ b/tests/ui/simd/generics.rs @@ -2,24 +2,18 @@ #![allow(non_camel_case_types)] #![feature(repr_simd, core_intrinsics)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_add; use std::ops; -#[repr(simd)] -#[derive(Copy, Clone)] -struct f32x4([f32; 4]); +type A = Simd; -#[repr(simd)] -#[derive(Copy, Clone)] -struct A([f32; N]); +type B = Simd; -#[repr(simd)] -#[derive(Copy, Clone)] -struct B([T; 4]); - -#[repr(simd)] -#[derive(Copy, Clone)] -struct C([T; N]); +type C = Simd; fn add>(lhs: T, rhs: T) -> T { lhs + rhs @@ -33,48 +27,24 @@ impl ops::Add for f32x4 { } } -impl ops::Add for A<4> { - type Output = Self; - - fn add(self, rhs: Self) -> Self { - unsafe { simd_add(self, rhs) } - } -} - -impl ops::Add for B { - type Output = Self; - - fn add(self, rhs: Self) -> Self { - unsafe { simd_add(self, rhs) } - } -} - -impl ops::Add for C { - type Output = Self; - - fn add(self, rhs: Self) -> Self { - unsafe { simd_add(self, rhs) } - } -} - pub fn main() { let x = [1.0f32, 2.0f32, 3.0f32, 4.0f32]; let y = [2.0f32, 4.0f32, 6.0f32, 8.0f32]; // lame-o - let a = f32x4([1.0f32, 2.0f32, 3.0f32, 4.0f32]); - let f32x4([a0, a1, a2, a3]) = add(a, a); + let a = f32x4::from_array([1.0f32, 2.0f32, 3.0f32, 4.0f32]); + let [a0, a1, a2, a3] = add(a, a).into_array(); assert_eq!(a0, 2.0f32); assert_eq!(a1, 4.0f32); assert_eq!(a2, 6.0f32); assert_eq!(a3, 8.0f32); - let a = A(x); - assert_eq!(add(a, a).0, y); + let a = A::from_array(x); + assert_eq!(add(a, a).into_array(), y); - let b = B(x); - assert_eq!(add(b, b).0, y); + let b = B::from_array(x); + assert_eq!(add(b, b).into_array(), y); - let c = C(x); - assert_eq!(add(c, c).0, y); + let c = C::from_array(x); + assert_eq!(add(c, c).into_array(), y); } diff --git a/tests/ui/simd/intrinsic/float-math-pass.rs b/tests/ui/simd/intrinsic/float-math-pass.rs index 01fed8537d0b..743aae8d1c31 100644 --- a/tests/ui/simd/intrinsic/float-math-pass.rs +++ b/tests/ui/simd/intrinsic/float-math-pass.rs @@ -11,9 +11,9 @@ #![feature(repr_simd, intrinsics, core_intrinsics)] #![allow(non_camel_case_types)] -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct f32x4(pub [f32; 4]); +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; use std::intrinsics::simd::*; @@ -27,19 +27,19 @@ macro_rules! assert_approx_eq { ($a:expr, $b:expr) => {{ let a = $a; let b = $b; - assert_approx_eq_f32!(a.0[0], b.0[0]); - assert_approx_eq_f32!(a.0[1], b.0[1]); - assert_approx_eq_f32!(a.0[2], b.0[2]); - assert_approx_eq_f32!(a.0[3], b.0[3]); + assert_approx_eq_f32!(a[0], b[0]); + assert_approx_eq_f32!(a[1], b[1]); + assert_approx_eq_f32!(a[2], b[2]); + assert_approx_eq_f32!(a[3], b[3]); }}; } fn main() { - let x = f32x4([1.0, 1.0, 1.0, 1.0]); - let y = f32x4([-1.0, -1.0, -1.0, -1.0]); - let z = f32x4([0.0, 0.0, 0.0, 0.0]); + let x = f32x4::from_array([1.0, 1.0, 1.0, 1.0]); + let y = f32x4::from_array([-1.0, -1.0, -1.0, -1.0]); + let z = f32x4::from_array([0.0, 0.0, 0.0, 0.0]); - let h = f32x4([0.5, 0.5, 0.5, 0.5]); + let h = f32x4::from_array([0.5, 0.5, 0.5, 0.5]); unsafe { let r = simd_fabs(y); diff --git a/tests/ui/simd/intrinsic/float-minmax-pass.rs b/tests/ui/simd/intrinsic/float-minmax-pass.rs index 00c0d8cea3fa..12210ba0ad12 100644 --- a/tests/ui/simd/intrinsic/float-minmax-pass.rs +++ b/tests/ui/simd/intrinsic/float-minmax-pass.rs @@ -6,15 +6,15 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct f32x4(pub [f32; 4]); +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; use std::intrinsics::simd::*; fn main() { - let x = f32x4([1.0, 2.0, 3.0, 4.0]); - let y = f32x4([2.0, 1.0, 4.0, 3.0]); + let x = f32x4::from_array([1.0, 2.0, 3.0, 4.0]); + let y = f32x4::from_array([2.0, 1.0, 4.0, 3.0]); #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))] let nan = f32::NAN; @@ -23,13 +23,13 @@ fn main() { #[cfg(any(target_arch = "mips", target_arch = "mips64"))] let nan = f32::from_bits(f32::NAN.to_bits() - 1); - let n = f32x4([nan, nan, nan, nan]); + let n = f32x4::from_array([nan, nan, nan, nan]); unsafe { let min0 = simd_fmin(x, y); let min1 = simd_fmin(y, x); assert_eq!(min0, min1); - let e = f32x4([1.0, 1.0, 3.0, 3.0]); + let e = f32x4::from_array([1.0, 1.0, 3.0, 3.0]); assert_eq!(min0, e); let minn = simd_fmin(x, n); assert_eq!(minn, x); @@ -39,7 +39,7 @@ fn main() { let max0 = simd_fmax(x, y); let max1 = simd_fmax(y, x); assert_eq!(max0, max1); - let e = f32x4([2.0, 2.0, 4.0, 4.0]); + let e = f32x4::from_array([2.0, 2.0, 4.0, 4.0]); assert_eq!(max0, e); let maxn = simd_fmax(x, n); assert_eq!(maxn, x); diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs b/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs index 4c97fb2141d0..bf38a8b17202 100644 --- a/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs +++ b/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs @@ -2,80 +2,77 @@ #![allow(non_camel_case_types)] #![feature(repr_simd, core_intrinsics)] -#[repr(simd)] -#[derive(Copy, Clone)] -struct i32x4(pub [i32; 4]); +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; -#[repr(simd)] -#[derive(Copy, Clone)] -struct U32([u32; N]); - -#[repr(simd)] -#[derive(Copy, Clone)] -struct f32x4(pub [f32; 4]); +type U32 = Simd; macro_rules! all_eq { - ($a: expr, $b: expr) => {{ + ($a: expr, $b: expr $(,)?) => {{ let a = $a; let b = $b; - assert!(a.0 == b.0); + assert!(a == b); }}; } use std::intrinsics::simd::*; fn main() { - let x1 = i32x4([1, 2, 3, 4]); - let y1 = U32::<4>([1, 2, 3, 4]); - let z1 = f32x4([1.0, 2.0, 3.0, 4.0]); - let x2 = i32x4([2, 3, 4, 5]); - let y2 = U32::<4>([2, 3, 4, 5]); - let z2 = f32x4([2.0, 3.0, 4.0, 5.0]); - let x3 = i32x4([0, i32::MAX, i32::MIN, -1_i32]); - let y3 = U32::<4>([0, i32::MAX as _, i32::MIN as _, -1_i32 as _]); + let x1 = i32x4::from_array([1, 2, 3, 4]); + let y1 = U32::<4>::from_array([1, 2, 3, 4]); + let z1 = f32x4::from_array([1.0, 2.0, 3.0, 4.0]); + let x2 = i32x4::from_array([2, 3, 4, 5]); + let y2 = U32::<4>::from_array([2, 3, 4, 5]); + let z2 = f32x4::from_array([2.0, 3.0, 4.0, 5.0]); + let x3 = i32x4::from_array([0, i32::MAX, i32::MIN, -1_i32]); + let y3 = U32::<4>::from_array([0, i32::MAX as _, i32::MIN as _, -1_i32 as _]); unsafe { - all_eq!(simd_add(x1, x2), i32x4([3, 5, 7, 9])); - all_eq!(simd_add(x2, x1), i32x4([3, 5, 7, 9])); - all_eq!(simd_add(y1, y2), U32::<4>([3, 5, 7, 9])); - all_eq!(simd_add(y2, y1), U32::<4>([3, 5, 7, 9])); - all_eq!(simd_add(z1, z2), f32x4([3.0, 5.0, 7.0, 9.0])); - all_eq!(simd_add(z2, z1), f32x4([3.0, 5.0, 7.0, 9.0])); + all_eq!(simd_add(x1, x2), i32x4::from_array([3, 5, 7, 9])); + all_eq!(simd_add(x2, x1), i32x4::from_array([3, 5, 7, 9])); + all_eq!(simd_add(y1, y2), U32::<4>::from_array([3, 5, 7, 9])); + all_eq!(simd_add(y2, y1), U32::<4>::from_array([3, 5, 7, 9])); + all_eq!(simd_add(z1, z2), f32x4::from_array([3.0, 5.0, 7.0, 9.0])); + all_eq!(simd_add(z2, z1), f32x4::from_array([3.0, 5.0, 7.0, 9.0])); - all_eq!(simd_mul(x1, x2), i32x4([2, 6, 12, 20])); - all_eq!(simd_mul(x2, x1), i32x4([2, 6, 12, 20])); - all_eq!(simd_mul(y1, y2), U32::<4>([2, 6, 12, 20])); - all_eq!(simd_mul(y2, y1), U32::<4>([2, 6, 12, 20])); - all_eq!(simd_mul(z1, z2), f32x4([2.0, 6.0, 12.0, 20.0])); - all_eq!(simd_mul(z2, z1), f32x4([2.0, 6.0, 12.0, 20.0])); + all_eq!(simd_mul(x1, x2), i32x4::from_array([2, 6, 12, 20])); + all_eq!(simd_mul(x2, x1), i32x4::from_array([2, 6, 12, 20])); + all_eq!(simd_mul(y1, y2), U32::<4>::from_array([2, 6, 12, 20])); + all_eq!(simd_mul(y2, y1), U32::<4>::from_array([2, 6, 12, 20])); + all_eq!(simd_mul(z1, z2), f32x4::from_array([2.0, 6.0, 12.0, 20.0])); + all_eq!(simd_mul(z2, z1), f32x4::from_array([2.0, 6.0, 12.0, 20.0])); - all_eq!(simd_sub(x2, x1), i32x4([1, 1, 1, 1])); - all_eq!(simd_sub(x1, x2), i32x4([-1, -1, -1, -1])); - all_eq!(simd_sub(y2, y1), U32::<4>([1, 1, 1, 1])); - all_eq!(simd_sub(y1, y2), U32::<4>([!0, !0, !0, !0])); - all_eq!(simd_sub(z2, z1), f32x4([1.0, 1.0, 1.0, 1.0])); - all_eq!(simd_sub(z1, z2), f32x4([-1.0, -1.0, -1.0, -1.0])); + all_eq!(simd_sub(x2, x1), i32x4::from_array([1, 1, 1, 1])); + all_eq!(simd_sub(x1, x2), i32x4::from_array([-1, -1, -1, -1])); + all_eq!(simd_sub(y2, y1), U32::<4>::from_array([1, 1, 1, 1])); + all_eq!(simd_sub(y1, y2), U32::<4>::from_array([!0, !0, !0, !0])); + all_eq!(simd_sub(z2, z1), f32x4::from_array([1.0, 1.0, 1.0, 1.0])); + all_eq!(simd_sub(z1, z2), f32x4::from_array([-1.0, -1.0, -1.0, -1.0])); - all_eq!(simd_div(x1, x1), i32x4([1, 1, 1, 1])); - all_eq!(simd_div(i32x4([2, 4, 6, 8]), i32x4([2, 2, 2, 2])), x1); - all_eq!(simd_div(y1, y1), U32::<4>([1, 1, 1, 1])); - all_eq!(simd_div(U32::<4>([2, 4, 6, 8]), U32::<4>([2, 2, 2, 2])), y1); - all_eq!(simd_div(z1, z1), f32x4([1.0, 1.0, 1.0, 1.0])); - all_eq!(simd_div(z1, z2), f32x4([1.0 / 2.0, 2.0 / 3.0, 3.0 / 4.0, 4.0 / 5.0])); - all_eq!(simd_div(z2, z1), f32x4([2.0 / 1.0, 3.0 / 2.0, 4.0 / 3.0, 5.0 / 4.0])); + all_eq!(simd_div(x1, x1), i32x4::from_array([1, 1, 1, 1])); + all_eq!(simd_div(i32x4::from_array([2, 4, 6, 8]), i32x4::from_array([2, 2, 2, 2])), x1); + all_eq!(simd_div(y1, y1), U32::<4>::from_array([1, 1, 1, 1])); + all_eq!( + simd_div(U32::<4>::from_array([2, 4, 6, 8]), U32::<4>::from_array([2, 2, 2, 2])), + y1, + ); + all_eq!(simd_div(z1, z1), f32x4::from_array([1.0, 1.0, 1.0, 1.0])); + all_eq!(simd_div(z1, z2), f32x4::from_array([1.0 / 2.0, 2.0 / 3.0, 3.0 / 4.0, 4.0 / 5.0])); + all_eq!(simd_div(z2, z1), f32x4::from_array([2.0 / 1.0, 3.0 / 2.0, 4.0 / 3.0, 5.0 / 4.0])); - all_eq!(simd_rem(x1, x1), i32x4([0, 0, 0, 0])); - all_eq!(simd_rem(x2, x1), i32x4([0, 1, 1, 1])); - all_eq!(simd_rem(y1, y1), U32::<4>([0, 0, 0, 0])); - all_eq!(simd_rem(y2, y1), U32::<4>([0, 1, 1, 1])); - all_eq!(simd_rem(z1, z1), f32x4([0.0, 0.0, 0.0, 0.0])); + all_eq!(simd_rem(x1, x1), i32x4::from_array([0, 0, 0, 0])); + all_eq!(simd_rem(x2, x1), i32x4::from_array([0, 1, 1, 1])); + all_eq!(simd_rem(y1, y1), U32::<4>::from_array([0, 0, 0, 0])); + all_eq!(simd_rem(y2, y1), U32::<4>::from_array([0, 1, 1, 1])); + all_eq!(simd_rem(z1, z1), f32x4::from_array([0.0, 0.0, 0.0, 0.0])); all_eq!(simd_rem(z1, z2), z1); - all_eq!(simd_rem(z2, z1), f32x4([0.0, 1.0, 1.0, 1.0])); + all_eq!(simd_rem(z2, z1), f32x4::from_array([0.0, 1.0, 1.0, 1.0])); - all_eq!(simd_shl(x1, x2), i32x4([1 << 2, 2 << 3, 3 << 4, 4 << 5])); - all_eq!(simd_shl(x2, x1), i32x4([2 << 1, 3 << 2, 4 << 3, 5 << 4])); - all_eq!(simd_shl(y1, y2), U32::<4>([1 << 2, 2 << 3, 3 << 4, 4 << 5])); - all_eq!(simd_shl(y2, y1), U32::<4>([2 << 1, 3 << 2, 4 << 3, 5 << 4])); + all_eq!(simd_shl(x1, x2), i32x4::from_array([1 << 2, 2 << 3, 3 << 4, 4 << 5])); + all_eq!(simd_shl(x2, x1), i32x4::from_array([2 << 1, 3 << 2, 4 << 3, 5 << 4])); + all_eq!(simd_shl(y1, y2), U32::<4>::from_array([1 << 2, 2 << 3, 3 << 4, 4 << 5])); + all_eq!(simd_shl(y2, y1), U32::<4>::from_array([2 << 1, 3 << 2, 4 << 3, 5 << 4])); // test right-shift by assuming left-shift is correct all_eq!(simd_shr(simd_shl(x1, x2), x2), x1); @@ -85,7 +82,7 @@ fn main() { all_eq!( simd_funnel_shl(x1, x2, x1), - i32x4([ + i32x4::from_array([ (1 << 1) | (2 >> 31), (2 << 2) | (3 >> 30), (3 << 3) | (4 >> 29), @@ -94,7 +91,7 @@ fn main() { ); all_eq!( simd_funnel_shl(x2, x1, x1), - i32x4([ + i32x4::from_array([ (2 << 1) | (1 >> 31), (3 << 2) | (2 >> 30), (4 << 3) | (3 >> 29), @@ -103,7 +100,7 @@ fn main() { ); all_eq!( simd_funnel_shl(y1, y2, y1), - U32::<4>([ + U32::<4>::from_array([ (1 << 1) | (2 >> 31), (2 << 2) | (3 >> 30), (3 << 3) | (4 >> 29), @@ -112,7 +109,7 @@ fn main() { ); all_eq!( simd_funnel_shl(y2, y1, y1), - U32::<4>([ + U32::<4>::from_array([ (2 << 1) | (1 >> 31), (3 << 2) | (2 >> 30), (4 << 3) | (3 >> 29), @@ -122,7 +119,7 @@ fn main() { all_eq!( simd_funnel_shr(x1, x2, x1), - i32x4([ + i32x4::from_array([ (1 << 31) | (2 >> 1), (2 << 30) | (3 >> 2), (3 << 29) | (4 >> 3), @@ -131,7 +128,7 @@ fn main() { ); all_eq!( simd_funnel_shr(x2, x1, x1), - i32x4([ + i32x4::from_array([ (2 << 31) | (1 >> 1), (3 << 30) | (2 >> 2), (4 << 29) | (3 >> 3), @@ -140,7 +137,7 @@ fn main() { ); all_eq!( simd_funnel_shr(y1, y2, y1), - U32::<4>([ + U32::<4>::from_array([ (1 << 31) | (2 >> 1), (2 << 30) | (3 >> 2), (3 << 29) | (4 >> 3), @@ -149,7 +146,7 @@ fn main() { ); all_eq!( simd_funnel_shr(y2, y1, y1), - U32::<4>([ + U32::<4>::from_array([ (2 << 31) | (1 >> 1), (3 << 30) | (2 >> 2), (4 << 29) | (3 >> 3), @@ -159,52 +156,69 @@ fn main() { // ensure we get logical vs. arithmetic shifts correct let (a, b, c, d) = (-12, -123, -1234, -12345); - all_eq!(simd_shr(i32x4([a, b, c, d]), x1), i32x4([a >> 1, b >> 2, c >> 3, d >> 4])); all_eq!( - simd_shr(U32::<4>([a as u32, b as u32, c as u32, d as u32]), y1), - U32::<4>([(a as u32) >> 1, (b as u32) >> 2, (c as u32) >> 3, (d as u32) >> 4]) + simd_shr(i32x4::from_array([a, b, c, d]), x1), + i32x4::from_array([a >> 1, b >> 2, c >> 3, d >> 4]), + ); + all_eq!( + simd_shr(U32::<4>::from_array([a as u32, b as u32, c as u32, d as u32]), y1), + U32::<4>::from_array([ + (a as u32) >> 1, + (b as u32) >> 2, + (c as u32) >> 3, + (d as u32) >> 4, + ]), ); - all_eq!(simd_and(x1, x2), i32x4([0, 2, 0, 4])); - all_eq!(simd_and(x2, x1), i32x4([0, 2, 0, 4])); - all_eq!(simd_and(y1, y2), U32::<4>([0, 2, 0, 4])); - all_eq!(simd_and(y2, y1), U32::<4>([0, 2, 0, 4])); + all_eq!(simd_and(x1, x2), i32x4::from_array([0, 2, 0, 4])); + all_eq!(simd_and(x2, x1), i32x4::from_array([0, 2, 0, 4])); + all_eq!(simd_and(y1, y2), U32::<4>::from_array([0, 2, 0, 4])); + all_eq!(simd_and(y2, y1), U32::<4>::from_array([0, 2, 0, 4])); - all_eq!(simd_or(x1, x2), i32x4([3, 3, 7, 5])); - all_eq!(simd_or(x2, x1), i32x4([3, 3, 7, 5])); - all_eq!(simd_or(y1, y2), U32::<4>([3, 3, 7, 5])); - all_eq!(simd_or(y2, y1), U32::<4>([3, 3, 7, 5])); + all_eq!(simd_or(x1, x2), i32x4::from_array([3, 3, 7, 5])); + all_eq!(simd_or(x2, x1), i32x4::from_array([3, 3, 7, 5])); + all_eq!(simd_or(y1, y2), U32::<4>::from_array([3, 3, 7, 5])); + all_eq!(simd_or(y2, y1), U32::<4>::from_array([3, 3, 7, 5])); - all_eq!(simd_xor(x1, x2), i32x4([3, 1, 7, 1])); - all_eq!(simd_xor(x2, x1), i32x4([3, 1, 7, 1])); - all_eq!(simd_xor(y1, y2), U32::<4>([3, 1, 7, 1])); - all_eq!(simd_xor(y2, y1), U32::<4>([3, 1, 7, 1])); + all_eq!(simd_xor(x1, x2), i32x4::from_array([3, 1, 7, 1])); + all_eq!(simd_xor(x2, x1), i32x4::from_array([3, 1, 7, 1])); + all_eq!(simd_xor(y1, y2), U32::<4>::from_array([3, 1, 7, 1])); + all_eq!(simd_xor(y2, y1), U32::<4>::from_array([3, 1, 7, 1])); - all_eq!(simd_neg(x1), i32x4([-1, -2, -3, -4])); - all_eq!(simd_neg(x2), i32x4([-2, -3, -4, -5])); - all_eq!(simd_neg(z1), f32x4([-1.0, -2.0, -3.0, -4.0])); - all_eq!(simd_neg(z2), f32x4([-2.0, -3.0, -4.0, -5.0])); + all_eq!(simd_neg(x1), i32x4::from_array([-1, -2, -3, -4])); + all_eq!(simd_neg(x2), i32x4::from_array([-2, -3, -4, -5])); + all_eq!(simd_neg(z1), f32x4::from_array([-1.0, -2.0, -3.0, -4.0])); + all_eq!(simd_neg(z2), f32x4::from_array([-2.0, -3.0, -4.0, -5.0])); - all_eq!(simd_bswap(x1), i32x4([0x01000000, 0x02000000, 0x03000000, 0x04000000])); - all_eq!(simd_bswap(y1), U32::<4>([0x01000000, 0x02000000, 0x03000000, 0x04000000])); + all_eq!( + simd_bswap(x1), + i32x4::from_array([0x01000000, 0x02000000, 0x03000000, 0x04000000]), + ); + all_eq!( + simd_bswap(y1), + U32::<4>::from_array([0x01000000, 0x02000000, 0x03000000, 0x04000000]), + ); all_eq!( simd_bitreverse(x1), - i32x4([0x80000000u32 as i32, 0x40000000, 0xc0000000u32 as i32, 0x20000000]) + i32x4::from_array([0x80000000u32 as i32, 0x40000000, 0xc0000000u32 as i32, 0x20000000]) + ); + all_eq!( + simd_bitreverse(y1), + U32::<4>::from_array([0x80000000, 0x40000000, 0xc0000000, 0x20000000]), ); - all_eq!(simd_bitreverse(y1), U32::<4>([0x80000000, 0x40000000, 0xc0000000, 0x20000000])); - all_eq!(simd_ctlz(x1), i32x4([31, 30, 30, 29])); - all_eq!(simd_ctlz(y1), U32::<4>([31, 30, 30, 29])); + all_eq!(simd_ctlz(x1), i32x4::from_array([31, 30, 30, 29])); + all_eq!(simd_ctlz(y1), U32::<4>::from_array([31, 30, 30, 29])); - all_eq!(simd_ctpop(x1), i32x4([1, 1, 2, 1])); - all_eq!(simd_ctpop(y1), U32::<4>([1, 1, 2, 1])); - all_eq!(simd_ctpop(x2), i32x4([1, 2, 1, 2])); - all_eq!(simd_ctpop(y2), U32::<4>([1, 2, 1, 2])); - all_eq!(simd_ctpop(x3), i32x4([0, 31, 1, 32])); - all_eq!(simd_ctpop(y3), U32::<4>([0, 31, 1, 32])); + all_eq!(simd_ctpop(x1), i32x4::from_array([1, 1, 2, 1])); + all_eq!(simd_ctpop(y1), U32::<4>::from_array([1, 1, 2, 1])); + all_eq!(simd_ctpop(x2), i32x4::from_array([1, 2, 1, 2])); + all_eq!(simd_ctpop(y2), U32::<4>::from_array([1, 2, 1, 2])); + all_eq!(simd_ctpop(x3), i32x4::from_array([0, 31, 1, 32])); + all_eq!(simd_ctpop(y3), U32::<4>::from_array([0, 31, 1, 32])); - all_eq!(simd_cttz(x1), i32x4([0, 1, 0, 2])); - all_eq!(simd_cttz(y1), U32::<4>([0, 1, 0, 2])); + all_eq!(simd_cttz(x1), i32x4::from_array([0, 1, 0, 2])); + all_eq!(simd_cttz(y1), U32::<4>::from_array([0, 1, 0, 2])); } } diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs index 4d12a312331a..a997f1237034 100644 --- a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs +++ b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs @@ -4,26 +4,24 @@ #![allow(non_camel_case_types)] #![feature(repr_simd, core_intrinsics)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::{simd_saturating_add, simd_saturating_sub}; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct u32x4(pub [u32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone)] -struct I32([i32; N]); +type I32 = Simd; fn main() { // unsigned { const M: u32 = u32::MAX; - let a = u32x4([1, 2, 3, 4]); - let b = u32x4([2, 4, 6, 8]); - let m = u32x4([M, M, M, M]); - let m1 = u32x4([M - 1, M - 1, M - 1, M - 1]); - let z = u32x4([0, 0, 0, 0]); + let a = u32x4::from_array([1, 2, 3, 4]); + let b = u32x4::from_array([2, 4, 6, 8]); + let m = u32x4::from_array([M, M, M, M]); + let m1 = u32x4::from_array([M - 1, M - 1, M - 1, M - 1]); + let z = u32x4::from_array([0, 0, 0, 0]); unsafe { assert_eq!(simd_saturating_add(z, z), z); @@ -48,41 +46,41 @@ fn main() { const MIN: i32 = i32::MIN; const MAX: i32 = i32::MAX; - let a = I32::<4>([1, 2, 3, 4]); - let b = I32::<4>([2, 4, 6, 8]); - let c = I32::<4>([-1, -2, -3, -4]); - let d = I32::<4>([-2, -4, -6, -8]); + let a = I32::<4>::from_array([1, 2, 3, 4]); + let b = I32::<4>::from_array([2, 4, 6, 8]); + let c = I32::<4>::from_array([-1, -2, -3, -4]); + let d = I32::<4>::from_array([-2, -4, -6, -8]); - let max = I32::<4>([MAX, MAX, MAX, MAX]); - let max1 = I32::<4>([MAX - 1, MAX - 1, MAX - 1, MAX - 1]); - let min = I32::<4>([MIN, MIN, MIN, MIN]); - let min1 = I32::<4>([MIN + 1, MIN + 1, MIN + 1, MIN + 1]); + let max = I32::<4>::from_array([MAX, MAX, MAX, MAX]); + let max1 = I32::<4>::from_array([MAX - 1, MAX - 1, MAX - 1, MAX - 1]); + let min = I32::<4>::from_array([MIN, MIN, MIN, MIN]); + let min1 = I32::<4>::from_array([MIN + 1, MIN + 1, MIN + 1, MIN + 1]); - let z = I32::<4>([0, 0, 0, 0]); + let z = I32::<4>::from_array([0, 0, 0, 0]); unsafe { - assert_eq!(simd_saturating_add(z, z).0, z.0); - assert_eq!(simd_saturating_add(z, a).0, a.0); - assert_eq!(simd_saturating_add(b, z).0, b.0); - assert_eq!(simd_saturating_add(a, a).0, b.0); - assert_eq!(simd_saturating_add(a, max).0, max.0); - assert_eq!(simd_saturating_add(max, b).0, max.0); - assert_eq!(simd_saturating_add(max1, a).0, max.0); - assert_eq!(simd_saturating_add(min1, z).0, min1.0); - assert_eq!(simd_saturating_add(min, z).0, min.0); - assert_eq!(simd_saturating_add(min1, c).0, min.0); - assert_eq!(simd_saturating_add(min, c).0, min.0); - assert_eq!(simd_saturating_add(min1, d).0, min.0); - assert_eq!(simd_saturating_add(min, d).0, min.0); + assert_eq!(simd_saturating_add(z, z), z); + assert_eq!(simd_saturating_add(z, a), a); + assert_eq!(simd_saturating_add(b, z), b); + assert_eq!(simd_saturating_add(a, a), b); + assert_eq!(simd_saturating_add(a, max), max); + assert_eq!(simd_saturating_add(max, b), max); + assert_eq!(simd_saturating_add(max1, a), max); + assert_eq!(simd_saturating_add(min1, z), min1); + assert_eq!(simd_saturating_add(min, z), min); + assert_eq!(simd_saturating_add(min1, c), min); + assert_eq!(simd_saturating_add(min, c), min); + assert_eq!(simd_saturating_add(min1, d), min); + assert_eq!(simd_saturating_add(min, d), min); - assert_eq!(simd_saturating_sub(b, z).0, b.0); - assert_eq!(simd_saturating_sub(b, a).0, a.0); - assert_eq!(simd_saturating_sub(a, a).0, z.0); - assert_eq!(simd_saturating_sub(a, b).0, c.0); - assert_eq!(simd_saturating_sub(z, max).0, min1.0); - assert_eq!(simd_saturating_sub(min1, z).0, min1.0); - assert_eq!(simd_saturating_sub(min1, a).0, min.0); - assert_eq!(simd_saturating_sub(min1, b).0, min.0); + assert_eq!(simd_saturating_sub(b, z), b); + assert_eq!(simd_saturating_sub(b, a), a); + assert_eq!(simd_saturating_sub(a, a), z); + assert_eq!(simd_saturating_sub(a, b), c); + assert_eq!(simd_saturating_sub(z, max), min1); + assert_eq!(simd_saturating_sub(min1, z), min1); + assert_eq!(simd_saturating_sub(min1, a), min); + assert_eq!(simd_saturating_sub(min1, b), min); } } } diff --git a/tests/ui/simd/intrinsic/generic-as.rs b/tests/ui/simd/intrinsic/generic-as.rs index da53211cbc74..f9ed416b6ff5 100644 --- a/tests/ui/simd/intrinsic/generic-as.rs +++ b/tests/ui/simd/intrinsic/generic-as.rs @@ -2,45 +2,47 @@ #![feature(repr_simd, core_intrinsics)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_as; -#[derive(Copy, Clone)] -#[repr(simd)] -struct V([T; 2]); +type V = Simd; fn main() { unsafe { - let u = V::([u32::MIN, u32::MAX]); + let u: V:: = Simd([u32::MIN, u32::MAX]); let i: V = simd_as(u); - assert_eq!(i.0[0], u.0[0] as i16); - assert_eq!(i.0[1], u.0[1] as i16); + assert_eq!(i[0], u[0] as i16); + assert_eq!(i[1], u[1] as i16); } unsafe { - let f = V::([f32::MIN, f32::MAX]); + let f: V:: = Simd([f32::MIN, f32::MAX]); let i: V = simd_as(f); - assert_eq!(i.0[0], f.0[0] as i16); - assert_eq!(i.0[1], f.0[1] as i16); + assert_eq!(i[0], f[0] as i16); + assert_eq!(i[1], f[1] as i16); } unsafe { - let f = V::([f32::MIN, f32::MAX]); + let f: V:: = Simd([f32::MIN, f32::MAX]); let u: V = simd_as(f); - assert_eq!(u.0[0], f.0[0] as u8); - assert_eq!(u.0[1], f.0[1] as u8); + assert_eq!(u[0], f[0] as u8); + assert_eq!(u[1], f[1] as u8); } unsafe { - let f = V::([f64::MIN, f64::MAX]); + let f: V:: = Simd([f64::MIN, f64::MAX]); let i: V = simd_as(f); - assert_eq!(i.0[0], f.0[0] as isize); - assert_eq!(i.0[1], f.0[1] as isize); + assert_eq!(i[0], f[0] as isize); + assert_eq!(i[1], f[1] as isize); } unsafe { - let f = V::([f64::MIN, f64::MAX]); + let f: V:: = Simd([f64::MIN, f64::MAX]); let u: V = simd_as(f); - assert_eq!(u.0[0], f.0[0] as usize); - assert_eq!(u.0[1], f.0[1] as usize); + assert_eq!(u[0], f[0] as usize); + assert_eq!(u[1], f[1] as usize); } } diff --git a/tests/ui/simd/intrinsic/generic-bswap-byte.rs b/tests/ui/simd/intrinsic/generic-bswap-byte.rs index 903a07656a70..d30a560b1c2e 100644 --- a/tests/ui/simd/intrinsic/generic-bswap-byte.rs +++ b/tests/ui/simd/intrinsic/generic-bswap-byte.rs @@ -2,19 +2,15 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_bswap; -#[repr(simd)] -#[derive(Copy, Clone)] -struct i8x4([i8; 4]); - -#[repr(simd)] -#[derive(Copy, Clone)] -struct u8x4([u8; 4]); - fn main() { unsafe { - assert_eq!(simd_bswap(i8x4([0, 1, 2, 3])).0, [0, 1, 2, 3]); - assert_eq!(simd_bswap(u8x4([0, 1, 2, 3])).0, [0, 1, 2, 3]); + assert_eq!(simd_bswap(i8x4::from_array([0, 1, 2, 3])).into_array(), [0, 1, 2, 3]); + assert_eq!(simd_bswap(u8x4::from_array([0, 1, 2, 3])).into_array(), [0, 1, 2, 3]); } } diff --git a/tests/ui/simd/intrinsic/generic-cast-pass.rs b/tests/ui/simd/intrinsic/generic-cast-pass.rs index 7a4663bcad2b..0c3b00d65bf5 100644 --- a/tests/ui/simd/intrinsic/generic-cast-pass.rs +++ b/tests/ui/simd/intrinsic/generic-cast-pass.rs @@ -2,55 +2,57 @@ #![feature(repr_simd, core_intrinsics)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_cast; use std::cmp::{max, min}; -#[derive(Copy, Clone)] -#[repr(simd)] -struct V([T; 2]); +type V = Simd; fn main() { unsafe { - let u = V::([i16::MIN as u32, i16::MAX as u32]); + let u: V:: = Simd([i16::MIN as u32, i16::MAX as u32]); let i: V = simd_cast(u); - assert_eq!(i.0[0], u.0[0] as i16); - assert_eq!(i.0[1], u.0[1] as i16); + assert_eq!(i[0], u[0] as i16); + assert_eq!(i[1], u[1] as i16); } unsafe { - let f = V::([i16::MIN as f32, i16::MAX as f32]); + let f: V:: = Simd([i16::MIN as f32, i16::MAX as f32]); let i: V = simd_cast(f); - assert_eq!(i.0[0], f.0[0] as i16); - assert_eq!(i.0[1], f.0[1] as i16); + assert_eq!(i[0], f[0] as i16); + assert_eq!(i[1], f[1] as i16); } unsafe { - let f = V::([u8::MIN as f32, u8::MAX as f32]); + let f: V:: = Simd([u8::MIN as f32, u8::MAX as f32]); let u: V = simd_cast(f); - assert_eq!(u.0[0], f.0[0] as u8); - assert_eq!(u.0[1], f.0[1] as u8); + assert_eq!(u[0], f[0] as u8); + assert_eq!(u[1], f[1] as u8); } unsafe { // We would like to do isize::MIN..=isize::MAX, but those values are not representable in // an f64, so we clamp to the range of an i32 to prevent running into UB. - let f = V::([ + let f: V:: = Simd([ max(isize::MIN, i32::MIN as isize) as f64, min(isize::MAX, i32::MAX as isize) as f64, ]); let i: V = simd_cast(f); - assert_eq!(i.0[0], f.0[0] as isize); - assert_eq!(i.0[1], f.0[1] as isize); + assert_eq!(i[0], f[0] as isize); + assert_eq!(i[1], f[1] as isize); } unsafe { - let f = V::([ + let f: V:: = Simd([ max(usize::MIN, u32::MIN as usize) as f64, min(usize::MAX, u32::MAX as usize) as f64, ]); let u: V = simd_cast(f); - assert_eq!(u.0[0], f.0[0] as usize); - assert_eq!(u.0[1], f.0[1] as usize); + assert_eq!(u[0], f[0] as usize); + assert_eq!(u[1], f[1] as usize); } } diff --git a/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs b/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs index ea34e9ffeb8e..594d1d25d165 100644 --- a/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs +++ b/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs @@ -1,18 +1,24 @@ //@ run-pass #![feature(repr_simd, core_intrinsics)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_cast; -#[derive(Copy, Clone)] -#[repr(simd)] -struct V([T; 4]); +type V = Simd; fn main() { - let u = V::([0, 1, 2, 3]); + let u: V:: = Simd([0, 1, 2, 3]); let uu32: V = unsafe { simd_cast(u) }; let ui64: V = unsafe { simd_cast(u) }; - for (u, (uu32, ui64)) in u.0.iter().zip(uu32.0.iter().zip(ui64.0.iter())) { + for (u, (uu32, ui64)) in u + .as_array() + .iter() + .zip(uu32.as_array().iter().zip(ui64.as_array().iter())) + { assert_eq!(*u as u32, *uu32); assert_eq!(*u as i64, *ui64); } diff --git a/tests/ui/simd/intrinsic/generic-comparison-pass.rs b/tests/ui/simd/intrinsic/generic-comparison-pass.rs index 50a05eecb03b..3e803e8f6032 100644 --- a/tests/ui/simd/intrinsic/generic-comparison-pass.rs +++ b/tests/ui/simd/intrinsic/generic-comparison-pass.rs @@ -3,17 +3,11 @@ #![feature(repr_simd, core_intrinsics, macro_metavar_expr_concat)] #![allow(non_camel_case_types)] -use std::intrinsics::simd::{simd_eq, simd_ge, simd_gt, simd_le, simd_lt, simd_ne}; +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; -#[repr(simd)] -#[derive(Copy, Clone)] -struct i32x4([i32; 4]); -#[repr(simd)] -#[derive(Copy, Clone)] -struct u32x4(pub [u32; 4]); -#[repr(simd)] -#[derive(Copy, Clone)] -struct f32x4(pub [f32; 4]); +use std::intrinsics::simd::{simd_eq, simd_ge, simd_gt, simd_le, simd_lt, simd_ne}; macro_rules! cmp { ($method: ident($lhs: expr, $rhs: expr)) => {{ @@ -21,10 +15,11 @@ macro_rules! cmp { let rhs = $rhs; let e: u32x4 = ${concat(simd_, $method)}($lhs, $rhs); // assume the scalar version is correct/the behaviour we want. - assert!((e.0[0] != 0) == lhs.0[0].$method(&rhs.0[0])); - assert!((e.0[1] != 0) == lhs.0[1].$method(&rhs.0[1])); - assert!((e.0[2] != 0) == lhs.0[2].$method(&rhs.0[2])); - assert!((e.0[3] != 0) == lhs.0[3].$method(&rhs.0[3])); + let (lhs, rhs, e) = (lhs.as_array(), rhs.as_array(), e.as_array()); + assert!((e[0] != 0) == lhs[0].$method(&rhs[0])); + assert!((e[1] != 0) == lhs[1].$method(&rhs[1])); + assert!((e[2] != 0) == lhs[2].$method(&rhs[2])); + assert!((e[3] != 0) == lhs[3].$method(&rhs[3])); }}; } macro_rules! tests { @@ -53,17 +48,17 @@ macro_rules! tests { fn main() { // 13 vs. -100 tests that we get signed vs. unsigned comparisons // correct (i32: 13 > -100, u32: 13 < -100). let i1 = i32x4(10, -11, 12, 13); - let i1 = i32x4([10, -11, 12, 13]); - let i2 = i32x4([5, -5, 20, -100]); - let i3 = i32x4([10, -11, 20, -100]); + let i1 = i32x4::from_array([10, -11, 12, 13]); + let i2 = i32x4::from_array([5, -5, 20, -100]); + let i3 = i32x4::from_array([10, -11, 20, -100]); - let u1 = u32x4([10, !11 + 1, 12, 13]); - let u2 = u32x4([5, !5 + 1, 20, !100 + 1]); - let u3 = u32x4([10, !11 + 1, 20, !100 + 1]); + let u1 = u32x4::from_array([10, !11 + 1, 12, 13]); + let u2 = u32x4::from_array([5, !5 + 1, 20, !100 + 1]); + let u3 = u32x4::from_array([10, !11 + 1, 20, !100 + 1]); - let f1 = f32x4([10.0, -11.0, 12.0, 13.0]); - let f2 = f32x4([5.0, -5.0, 20.0, -100.0]); - let f3 = f32x4([10.0, -11.0, 20.0, -100.0]); + let f1 = f32x4::from_array([10.0, -11.0, 12.0, 13.0]); + let f2 = f32x4::from_array([5.0, -5.0, 20.0, -100.0]); + let f3 = f32x4::from_array([10.0, -11.0, 20.0, -100.0]); unsafe { tests! { @@ -84,7 +79,7 @@ fn main() { // NAN comparisons are special: // -11 (*) 13 // -5 -100 (*) - let f4 = f32x4([f32::NAN, f1.0[1], f32::NAN, f2.0[3]]); + let f4 = f32x4::from_array([f32::NAN, f1[1], f32::NAN, f2[3]]); unsafe { tests! { diff --git a/tests/ui/simd/intrinsic/generic-elements-pass.rs b/tests/ui/simd/intrinsic/generic-elements-pass.rs index e4d47cdb3818..f441d992e11b 100644 --- a/tests/ui/simd/intrinsic/generic-elements-pass.rs +++ b/tests/ui/simd/intrinsic/generic-elements-pass.rs @@ -2,23 +2,14 @@ #![feature(repr_simd, intrinsics, core_intrinsics)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::{ simd_extract, simd_extract_dyn, simd_insert, simd_insert_dyn, simd_shuffle, }; -#[repr(simd)] -#[derive(Copy, Clone, Debug, PartialEq)] -#[allow(non_camel_case_types)] -struct i32x2([i32; 2]); -#[repr(simd)] -#[derive(Copy, Clone, Debug, PartialEq)] -#[allow(non_camel_case_types)] -struct i32x4([i32; 4]); -#[repr(simd)] -#[derive(Copy, Clone, Debug, PartialEq)] -#[allow(non_camel_case_types)] -struct i32x8([i32; 8]); - #[repr(simd)] struct SimdShuffleIdx([u32; LEN]); @@ -34,26 +25,26 @@ macro_rules! all_eq { } fn main() { - let x2 = i32x2([20, 21]); - let x4 = i32x4([40, 41, 42, 43]); - let x8 = i32x8([80, 81, 82, 83, 84, 85, 86, 87]); + let x2 = i32x2::from_array([20, 21]); + let x4 = i32x4::from_array([40, 41, 42, 43]); + let x8 = i32x8::from_array([80, 81, 82, 83, 84, 85, 86, 87]); unsafe { - all_eq!(simd_insert(x2, 0, 100), i32x2([100, 21])); - all_eq!(simd_insert(x2, 1, 100), i32x2([20, 100])); + all_eq!(simd_insert(x2, 0, 100), i32x2::from_array([100, 21])); + all_eq!(simd_insert(x2, 1, 100), i32x2::from_array([20, 100])); - all_eq!(simd_insert(x4, 0, 100), i32x4([100, 41, 42, 43])); - all_eq!(simd_insert(x4, 1, 100), i32x4([40, 100, 42, 43])); - all_eq!(simd_insert(x4, 2, 100), i32x4([40, 41, 100, 43])); - all_eq!(simd_insert(x4, 3, 100), i32x4([40, 41, 42, 100])); + all_eq!(simd_insert(x4, 0, 100), i32x4::from_array([100, 41, 42, 43])); + all_eq!(simd_insert(x4, 1, 100), i32x4::from_array([40, 100, 42, 43])); + all_eq!(simd_insert(x4, 2, 100), i32x4::from_array([40, 41, 100, 43])); + all_eq!(simd_insert(x4, 3, 100), i32x4::from_array([40, 41, 42, 100])); - all_eq!(simd_insert(x8, 0, 100), i32x8([100, 81, 82, 83, 84, 85, 86, 87])); - all_eq!(simd_insert(x8, 1, 100), i32x8([80, 100, 82, 83, 84, 85, 86, 87])); - all_eq!(simd_insert(x8, 2, 100), i32x8([80, 81, 100, 83, 84, 85, 86, 87])); - all_eq!(simd_insert(x8, 3, 100), i32x8([80, 81, 82, 100, 84, 85, 86, 87])); - all_eq!(simd_insert(x8, 4, 100), i32x8([80, 81, 82, 83, 100, 85, 86, 87])); - all_eq!(simd_insert(x8, 5, 100), i32x8([80, 81, 82, 83, 84, 100, 86, 87])); - all_eq!(simd_insert(x8, 6, 100), i32x8([80, 81, 82, 83, 84, 85, 100, 87])); - all_eq!(simd_insert(x8, 7, 100), i32x8([80, 81, 82, 83, 84, 85, 86, 100])); + all_eq!(simd_insert(x8, 0, 100), i32x8::from_array([100, 81, 82, 83, 84, 85, 86, 87])); + all_eq!(simd_insert(x8, 1, 100), i32x8::from_array([80, 100, 82, 83, 84, 85, 86, 87])); + all_eq!(simd_insert(x8, 2, 100), i32x8::from_array([80, 81, 100, 83, 84, 85, 86, 87])); + all_eq!(simd_insert(x8, 3, 100), i32x8::from_array([80, 81, 82, 100, 84, 85, 86, 87])); + all_eq!(simd_insert(x8, 4, 100), i32x8::from_array([80, 81, 82, 83, 100, 85, 86, 87])); + all_eq!(simd_insert(x8, 5, 100), i32x8::from_array([80, 81, 82, 83, 84, 100, 86, 87])); + all_eq!(simd_insert(x8, 6, 100), i32x8::from_array([80, 81, 82, 83, 84, 85, 100, 87])); + all_eq!(simd_insert(x8, 7, 100), i32x8::from_array([80, 81, 82, 83, 84, 85, 86, 100])); all_eq!(simd_extract(x2, 0), 20); all_eq!(simd_extract(x2, 1), 21); @@ -73,22 +64,22 @@ fn main() { all_eq!(simd_extract(x8, 7), 87); } unsafe { - all_eq!(simd_insert_dyn(x2, 0, 100), i32x2([100, 21])); - all_eq!(simd_insert_dyn(x2, 1, 100), i32x2([20, 100])); + all_eq!(simd_insert_dyn(x2, 0, 100), i32x2::from_array([100, 21])); + all_eq!(simd_insert_dyn(x2, 1, 100), i32x2::from_array([20, 100])); - all_eq!(simd_insert_dyn(x4, 0, 100), i32x4([100, 41, 42, 43])); - all_eq!(simd_insert_dyn(x4, 1, 100), i32x4([40, 100, 42, 43])); - all_eq!(simd_insert_dyn(x4, 2, 100), i32x4([40, 41, 100, 43])); - all_eq!(simd_insert_dyn(x4, 3, 100), i32x4([40, 41, 42, 100])); + all_eq!(simd_insert_dyn(x4, 0, 100), i32x4::from_array([100, 41, 42, 43])); + all_eq!(simd_insert_dyn(x4, 1, 100), i32x4::from_array([40, 100, 42, 43])); + all_eq!(simd_insert_dyn(x4, 2, 100), i32x4::from_array([40, 41, 100, 43])); + all_eq!(simd_insert_dyn(x4, 3, 100), i32x4::from_array([40, 41, 42, 100])); - all_eq!(simd_insert_dyn(x8, 0, 100), i32x8([100, 81, 82, 83, 84, 85, 86, 87])); - all_eq!(simd_insert_dyn(x8, 1, 100), i32x8([80, 100, 82, 83, 84, 85, 86, 87])); - all_eq!(simd_insert_dyn(x8, 2, 100), i32x8([80, 81, 100, 83, 84, 85, 86, 87])); - all_eq!(simd_insert_dyn(x8, 3, 100), i32x8([80, 81, 82, 100, 84, 85, 86, 87])); - all_eq!(simd_insert_dyn(x8, 4, 100), i32x8([80, 81, 82, 83, 100, 85, 86, 87])); - all_eq!(simd_insert_dyn(x8, 5, 100), i32x8([80, 81, 82, 83, 84, 100, 86, 87])); - all_eq!(simd_insert_dyn(x8, 6, 100), i32x8([80, 81, 82, 83, 84, 85, 100, 87])); - all_eq!(simd_insert_dyn(x8, 7, 100), i32x8([80, 81, 82, 83, 84, 85, 86, 100])); + all_eq!(simd_insert_dyn(x8, 0, 100), i32x8::from_array([100, 81, 82, 83, 84, 85, 86, 87])); + all_eq!(simd_insert_dyn(x8, 1, 100), i32x8::from_array([80, 100, 82, 83, 84, 85, 86, 87])); + all_eq!(simd_insert_dyn(x8, 2, 100), i32x8::from_array([80, 81, 100, 83, 84, 85, 86, 87])); + all_eq!(simd_insert_dyn(x8, 3, 100), i32x8::from_array([80, 81, 82, 100, 84, 85, 86, 87])); + all_eq!(simd_insert_dyn(x8, 4, 100), i32x8::from_array([80, 81, 82, 83, 100, 85, 86, 87])); + all_eq!(simd_insert_dyn(x8, 5, 100), i32x8::from_array([80, 81, 82, 83, 84, 100, 86, 87])); + all_eq!(simd_insert_dyn(x8, 6, 100), i32x8::from_array([80, 81, 82, 83, 84, 85, 100, 87])); + all_eq!(simd_insert_dyn(x8, 7, 100), i32x8::from_array([80, 81, 82, 83, 84, 85, 86, 100])); all_eq!(simd_extract_dyn(x2, 0), 20); all_eq!(simd_extract_dyn(x2, 1), 21); @@ -108,38 +99,47 @@ fn main() { all_eq!(simd_extract_dyn(x8, 7), 87); } - let y2 = i32x2([120, 121]); - let y4 = i32x4([140, 141, 142, 143]); - let y8 = i32x8([180, 181, 182, 183, 184, 185, 186, 187]); + let y2 = i32x2::from_array([120, 121]); + let y4 = i32x4::from_array([140, 141, 142, 143]); + let y8 = i32x8::from_array([180, 181, 182, 183, 184, 185, 186, 187]); unsafe { - all_eq!(simd_shuffle(x2, y2, const { SimdShuffleIdx([3u32, 0]) }), i32x2([121, 20])); + all_eq!( + simd_shuffle(x2, y2, const { SimdShuffleIdx([3u32, 0]) }), + i32x2::from_array([121, 20]) + ); all_eq!( simd_shuffle(x2, y2, const { SimdShuffleIdx([3u32, 0, 1, 2]) }), - i32x4([121, 20, 21, 120]) + i32x4::from_array([121, 20, 21, 120]) ); all_eq!( simd_shuffle(x2, y2, const { SimdShuffleIdx([3u32, 0, 1, 2, 1, 2, 3, 0]) }), - i32x8([121, 20, 21, 120, 21, 120, 121, 20]) + i32x8::from_array([121, 20, 21, 120, 21, 120, 121, 20]) ); - all_eq!(simd_shuffle(x4, y4, const { SimdShuffleIdx([7u32, 2]) }), i32x2([143, 42])); + all_eq!( + simd_shuffle(x4, y4, const { SimdShuffleIdx([7u32, 2]) }), + i32x2::from_array([143, 42]) + ); all_eq!( simd_shuffle(x4, y4, const { SimdShuffleIdx([7u32, 2, 5, 0]) }), - i32x4([143, 42, 141, 40]) + i32x4::from_array([143, 42, 141, 40]) ); all_eq!( simd_shuffle(x4, y4, const { SimdShuffleIdx([7u32, 2, 5, 0, 3, 6, 4, 1]) }), - i32x8([143, 42, 141, 40, 43, 142, 140, 41]) + i32x8::from_array([143, 42, 141, 40, 43, 142, 140, 41]) ); - all_eq!(simd_shuffle(x8, y8, const { SimdShuffleIdx([11u32, 5]) }), i32x2([183, 85])); + all_eq!( + simd_shuffle(x8, y8, const { SimdShuffleIdx([11u32, 5]) }), + i32x2::from_array([183, 85]) + ); all_eq!( simd_shuffle(x8, y8, const { SimdShuffleIdx([11u32, 5, 15, 0]) }), - i32x4([183, 85, 187, 80]) + i32x4::from_array([183, 85, 187, 80]) ); all_eq!( simd_shuffle(x8, y8, const { SimdShuffleIdx([11u32, 5, 15, 0, 3, 8, 12, 1]) }), - i32x8([183, 85, 187, 80, 83, 180, 184, 81]) + i32x8::from_array([183, 85, 187, 80, 83, 180, 184, 81]) ); } } diff --git a/tests/ui/simd/intrinsic/generic-gather-scatter-pass.rs b/tests/ui/simd/intrinsic/generic-gather-scatter-pass.rs index b98d4d6575bb..c2418c019eda 100644 --- a/tests/ui/simd/intrinsic/generic-gather-scatter-pass.rs +++ b/tests/ui/simd/intrinsic/generic-gather-scatter-pass.rs @@ -6,24 +6,26 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::{simd_gather, simd_scatter}; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct x4(pub [T; 4]); +type x4 = Simd; fn main() { let mut x = [0_f32, 1., 2., 3., 4., 5., 6., 7.]; - let default = x4([-3_f32, -3., -3., -3.]); - let s_strided = x4([0_f32, 2., -3., 6.]); - let mask = x4([-1_i32, -1, 0, -1]); + let default = x4::from_array([-3_f32, -3., -3., -3.]); + let s_strided = x4::from_array([0_f32, 2., -3., 6.]); + let mask = x4::from_array([-1_i32, -1, 0, -1]); // reading from *const unsafe { let pointer = x.as_ptr(); let pointers = - x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]); + x4::from_array(std::array::from_fn(|i| pointer.add(i * 2))); let r_strided = simd_gather(default, pointers, mask); @@ -34,7 +36,7 @@ fn main() { unsafe { let pointer = x.as_mut_ptr(); let pointers = - x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]); + x4::from_array(std::array::from_fn(|i| pointer.add(i * 2))); let r_strided = simd_gather(default, pointers, mask); @@ -45,9 +47,9 @@ fn main() { unsafe { let pointer = x.as_mut_ptr(); let pointers = - x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]); + x4::from_array(std::array::from_fn(|i| pointer.add(i * 2))); - let values = x4([42_f32, 43_f32, 44_f32, 45_f32]); + let values = x4::from_array([42_f32, 43_f32, 44_f32, 45_f32]); simd_scatter(values, pointers, mask); assert_eq!(x, [42., 1., 43., 3., 4., 5., 45., 7.]); @@ -65,14 +67,14 @@ fn main() { &x[7] as *const f32, ]; - let default = x4([y[0], y[0], y[0], y[0]]); - let s_strided = x4([y[0], y[2], y[0], y[6]]); + let default = x4::from_array([y[0], y[0], y[0], y[0]]); + let s_strided = x4::from_array([y[0], y[2], y[0], y[6]]); // reading from *const unsafe { let pointer = y.as_ptr(); let pointers = - x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]); + x4::from_array(std::array::from_fn(|i| pointer.add(i * 2))); let r_strided = simd_gather(default, pointers, mask); @@ -83,7 +85,7 @@ fn main() { unsafe { let pointer = y.as_mut_ptr(); let pointers = - x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]); + x4::from_array(std::array::from_fn(|i| pointer.add(i * 2))); let r_strided = simd_gather(default, pointers, mask); @@ -94,9 +96,9 @@ fn main() { unsafe { let pointer = y.as_mut_ptr(); let pointers = - x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]); + x4::from_array(std::array::from_fn(|i| pointer.add(i * 2))); - let values = x4([y[7], y[6], y[5], y[1]]); + let values = x4::from_array([y[7], y[6], y[5], y[1]]); simd_scatter(values, pointers, mask); let s = [ diff --git a/tests/ui/simd/intrinsic/generic-select-pass.rs b/tests/ui/simd/intrinsic/generic-select-pass.rs index 0e5f7c4902f3..ff2d70d6a978 100644 --- a/tests/ui/simd/intrinsic/generic-select-pass.rs +++ b/tests/ui/simd/intrinsic/generic-select-pass.rs @@ -6,38 +6,24 @@ // Test that the simd_select intrinsics produces correct results. #![feature(repr_simd, core_intrinsics)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::{simd_select, simd_select_bitmask}; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct i32x4(pub [i32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct u32x4(pub [u32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct u32x8([u32; 8]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct f32x4(pub [f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct b8x4(pub [i8; 4]); +type b8x4 = i8x4; fn main() { - let m0 = b8x4([!0, !0, !0, !0]); - let m1 = b8x4([0, 0, 0, 0]); - let m2 = b8x4([!0, !0, 0, 0]); - let m3 = b8x4([0, 0, !0, !0]); - let m4 = b8x4([!0, 0, !0, 0]); + let m0 = b8x4::from_array([!0, !0, !0, !0]); + let m1 = b8x4::from_array([0, 0, 0, 0]); + let m2 = b8x4::from_array([!0, !0, 0, 0]); + let m3 = b8x4::from_array([0, 0, !0, !0]); + let m4 = b8x4::from_array([!0, 0, !0, 0]); unsafe { - let a = i32x4([1, -2, 3, 4]); - let b = i32x4([5, 6, -7, 8]); + let a = i32x4::from_array([1, -2, 3, 4]); + let b = i32x4::from_array([5, 6, -7, 8]); let r: i32x4 = simd_select(m0, a, b); let e = a; @@ -48,21 +34,21 @@ fn main() { assert_eq!(r, e); let r: i32x4 = simd_select(m2, a, b); - let e = i32x4([1, -2, -7, 8]); + let e = i32x4::from_array([1, -2, -7, 8]); assert_eq!(r, e); let r: i32x4 = simd_select(m3, a, b); - let e = i32x4([5, 6, 3, 4]); + let e = i32x4::from_array([5, 6, 3, 4]); assert_eq!(r, e); let r: i32x4 = simd_select(m4, a, b); - let e = i32x4([1, 6, 3, 8]); + let e = i32x4::from_array([1, 6, 3, 8]); assert_eq!(r, e); } unsafe { - let a = u32x4([1, 2, 3, 4]); - let b = u32x4([5, 6, 7, 8]); + let a = u32x4::from_array([1, 2, 3, 4]); + let b = u32x4::from_array([5, 6, 7, 8]); let r: u32x4 = simd_select(m0, a, b); let e = a; @@ -73,21 +59,21 @@ fn main() { assert_eq!(r, e); let r: u32x4 = simd_select(m2, a, b); - let e = u32x4([1, 2, 7, 8]); + let e = u32x4::from_array([1, 2, 7, 8]); assert_eq!(r, e); let r: u32x4 = simd_select(m3, a, b); - let e = u32x4([5, 6, 3, 4]); + let e = u32x4::from_array([5, 6, 3, 4]); assert_eq!(r, e); let r: u32x4 = simd_select(m4, a, b); - let e = u32x4([1, 6, 3, 8]); + let e = u32x4::from_array([1, 6, 3, 8]); assert_eq!(r, e); } unsafe { - let a = f32x4([1., 2., 3., 4.]); - let b = f32x4([5., 6., 7., 8.]); + let a = f32x4::from_array([1., 2., 3., 4.]); + let b = f32x4::from_array([5., 6., 7., 8.]); let r: f32x4 = simd_select(m0, a, b); let e = a; @@ -98,23 +84,23 @@ fn main() { assert_eq!(r, e); let r: f32x4 = simd_select(m2, a, b); - let e = f32x4([1., 2., 7., 8.]); + let e = f32x4::from_array([1., 2., 7., 8.]); assert_eq!(r, e); let r: f32x4 = simd_select(m3, a, b); - let e = f32x4([5., 6., 3., 4.]); + let e = f32x4::from_array([5., 6., 3., 4.]); assert_eq!(r, e); let r: f32x4 = simd_select(m4, a, b); - let e = f32x4([1., 6., 3., 8.]); + let e = f32x4::from_array([1., 6., 3., 8.]); assert_eq!(r, e); } unsafe { let t = !0 as i8; let f = 0 as i8; - let a = b8x4([t, f, t, f]); - let b = b8x4([f, f, f, t]); + let a = b8x4::from_array([t, f, t, f]); + let b = b8x4::from_array([f, f, f, t]); let r: b8x4 = simd_select(m0, a, b); let e = a; @@ -125,21 +111,21 @@ fn main() { assert_eq!(r, e); let r: b8x4 = simd_select(m2, a, b); - let e = b8x4([t, f, f, t]); + let e = b8x4::from_array([t, f, f, t]); assert_eq!(r, e); let r: b8x4 = simd_select(m3, a, b); - let e = b8x4([f, f, t, f]); + let e = b8x4::from_array([f, f, t, f]); assert_eq!(r, e); let r: b8x4 = simd_select(m4, a, b); - let e = b8x4([t, f, t, t]); + let e = b8x4::from_array([t, f, t, t]); assert_eq!(r, e); } unsafe { - let a = u32x8([0, 1, 2, 3, 4, 5, 6, 7]); - let b = u32x8([8, 9, 10, 11, 12, 13, 14, 15]); + let a = u32x8::from_array([0, 1, 2, 3, 4, 5, 6, 7]); + let b = u32x8::from_array([8, 9, 10, 11, 12, 13, 14, 15]); let r: u32x8 = simd_select_bitmask(0u8, a, b); let e = b; @@ -150,21 +136,21 @@ fn main() { assert_eq!(r, e); let r: u32x8 = simd_select_bitmask(0b01010101u8, a, b); - let e = u32x8([0, 9, 2, 11, 4, 13, 6, 15]); + let e = u32x8::from_array([0, 9, 2, 11, 4, 13, 6, 15]); assert_eq!(r, e); let r: u32x8 = simd_select_bitmask(0b10101010u8, a, b); - let e = u32x8([8, 1, 10, 3, 12, 5, 14, 7]); + let e = u32x8::from_array([8, 1, 10, 3, 12, 5, 14, 7]); assert_eq!(r, e); let r: u32x8 = simd_select_bitmask(0b11110000u8, a, b); - let e = u32x8([8, 9, 10, 11, 4, 5, 6, 7]); + let e = u32x8::from_array([8, 9, 10, 11, 4, 5, 6, 7]); assert_eq!(r, e); } unsafe { - let a = u32x4([0, 1, 2, 3]); - let b = u32x4([4, 5, 6, 7]); + let a = u32x4::from_array([0, 1, 2, 3]); + let b = u32x4::from_array([4, 5, 6, 7]); let r: u32x4 = simd_select_bitmask(0u8, a, b); let e = b; @@ -175,15 +161,15 @@ fn main() { assert_eq!(r, e); let r: u32x4 = simd_select_bitmask(0b0101u8, a, b); - let e = u32x4([0, 5, 2, 7]); + let e = u32x4::from_array([0, 5, 2, 7]); assert_eq!(r, e); let r: u32x4 = simd_select_bitmask(0b1010u8, a, b); - let e = u32x4([4, 1, 6, 3]); + let e = u32x4::from_array([4, 1, 6, 3]); assert_eq!(r, e); let r: u32x4 = simd_select_bitmask(0b1100u8, a, b); - let e = u32x4([4, 5, 2, 3]); + let e = u32x4::from_array([4, 5, 2, 3]); assert_eq!(r, e); } } diff --git a/tests/ui/simd/intrinsic/inlining-issue67557.rs b/tests/ui/simd/intrinsic/inlining-issue67557.rs index 13e7266b2a56..14f180425d8a 100644 --- a/tests/ui/simd/intrinsic/inlining-issue67557.rs +++ b/tests/ui/simd/intrinsic/inlining-issue67557.rs @@ -5,11 +5,13 @@ //@ compile-flags: -Zmir-opt-level=4 #![feature(core_intrinsics, repr_simd)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_shuffle; -#[repr(simd)] -#[derive(Debug, PartialEq)] -struct Simd2([u8; 2]); +type Simd2 = u8x2; #[repr(simd)] struct SimdShuffleIdx([u32; LEN]); @@ -17,7 +19,11 @@ struct SimdShuffleIdx([u32; LEN]); fn main() { unsafe { const IDX: SimdShuffleIdx<2> = SimdShuffleIdx([0, 1]); - let p_res: Simd2 = simd_shuffle(Simd2([10, 11]), Simd2([12, 13]), IDX); + let p_res: Simd2 = simd_shuffle( + Simd2::from_array([10, 11]), + Simd2::from_array([12, 13]), + IDX, + ); let a_res: Simd2 = inline_me(); assert_10_11(p_res); @@ -27,16 +33,16 @@ fn main() { #[inline(never)] fn assert_10_11(x: Simd2) { - assert_eq!(x, Simd2([10, 11])); + assert_eq!(x.into_array(), [10, 11]); } #[inline(never)] fn assert_10_13(x: Simd2) { - assert_eq!(x, Simd2([10, 13])); + assert_eq!(x.into_array(), [10, 13]); } #[inline(always)] unsafe fn inline_me() -> Simd2 { const IDX: SimdShuffleIdx<2> = SimdShuffleIdx([0, 3]); - simd_shuffle(Simd2([10, 11]), Simd2([12, 13]), IDX) + simd_shuffle(Simd2::from_array([10, 11]), Simd2::from_array([12, 13]), IDX) } diff --git a/tests/ui/simd/intrinsic/ptr-cast.rs b/tests/ui/simd/intrinsic/ptr-cast.rs index 3a73c0273e1a..63b65d83f767 100644 --- a/tests/ui/simd/intrinsic/ptr-cast.rs +++ b/tests/ui/simd/intrinsic/ptr-cast.rs @@ -2,18 +2,20 @@ #![feature(repr_simd, core_intrinsics)] +#[path = "../../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::{simd_cast_ptr, simd_expose_provenance, simd_with_exposed_provenance}; -#[derive(Copy, Clone)] -#[repr(simd)] -struct V([T; 2]); +type V = Simd; fn main() { unsafe { let mut foo = 4i8; let ptr = &mut foo as *mut i8; - let ptrs = V::<*mut i8>([ptr, core::ptr::null_mut()]); + let ptrs: V::<*mut i8> = Simd([ptr, core::ptr::null_mut()]); // change constness and type let const_ptrs: V<*const u8> = simd_cast_ptr(ptrs); @@ -22,8 +24,8 @@ fn main() { let with_exposed_provenance: V<*mut i8> = simd_with_exposed_provenance(exposed_addr); - assert!(const_ptrs.0 == [ptr as *const u8, core::ptr::null()]); - assert!(exposed_addr.0 == [ptr as usize, 0]); - assert!(with_exposed_provenance.0 == ptrs.0); + assert!(const_ptrs.into_array() == [ptr as *const u8, core::ptr::null()]); + assert!(exposed_addr.into_array() == [ptr as usize, 0]); + assert!(with_exposed_provenance.into_array() == ptrs.into_array()); } } diff --git a/tests/ui/simd/issue-39720.rs b/tests/ui/simd/issue-39720.rs index db441e551679..09d6142c9201 100644 --- a/tests/ui/simd/issue-39720.rs +++ b/tests/ui/simd/issue-39720.rs @@ -2,16 +2,16 @@ #![feature(repr_simd, core_intrinsics)] -#[repr(simd)] -#[derive(Copy, Clone, Debug)] -pub struct Char3(pub [i8; 3]); +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; -#[repr(simd)] -#[derive(Copy, Clone, Debug)] -pub struct Short3(pub [i16; 3]); +pub type Char3 = Simd; + +pub type Short3 = Simd; fn main() { - let cast: Short3 = unsafe { std::intrinsics::simd::simd_cast(Char3([10, -3, -9])) }; + let cast: Short3 = unsafe { std::intrinsics::simd::simd_cast(Char3::from_array([10, -3, -9])) }; println!("{:?}", cast); } diff --git a/tests/ui/simd/issue-85915-simd-ptrs.rs b/tests/ui/simd/issue-85915-simd-ptrs.rs index 4e2379d05251..a74c36fabc1b 100644 --- a/tests/ui/simd/issue-85915-simd-ptrs.rs +++ b/tests/ui/simd/issue-85915-simd-ptrs.rs @@ -6,35 +6,27 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::{simd_gather, simd_scatter}; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct cptrx4([*const T; 4]); +type cptrx4 = Simd<*const T, 4>; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct mptrx4([*mut T; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct f32x4([f32; 4]); - -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct i32x4([i32; 4]); +type mptrx4 = Simd<*mut T, 4>; fn main() { let mut x = [0_f32, 1., 2., 3., 4., 5., 6., 7.]; - let default = f32x4([-3_f32, -3., -3., -3.]); - let s_strided = f32x4([0_f32, 2., -3., 6.]); - let mask = i32x4([-1_i32, -1, 0, -1]); + let default = f32x4::from_array([-3_f32, -3., -3., -3.]); + let s_strided = f32x4::from_array([0_f32, 2., -3., 6.]); + let mask = i32x4::from_array([-1_i32, -1, 0, -1]); // reading from *const unsafe { let pointer = &x as *const f32; - let pointers = cptrx4([ + let pointers = cptrx4::from_array([ pointer.offset(0) as *const f32, pointer.offset(2), pointer.offset(4), @@ -49,14 +41,14 @@ fn main() { // writing to *mut unsafe { let pointer = &mut x as *mut f32; - let pointers = mptrx4([ + let pointers = mptrx4::from_array([ pointer.offset(0) as *mut f32, pointer.offset(2), pointer.offset(4), pointer.offset(6), ]); - let values = f32x4([42_f32, 43_f32, 44_f32, 45_f32]); + let values = f32x4::from_array([42_f32, 43_f32, 44_f32, 45_f32]); simd_scatter(values, pointers, mask); assert_eq!(x, [42., 1., 43., 3., 4., 5., 45., 7.]); diff --git a/tests/ui/simd/issue-89193.rs b/tests/ui/simd/issue-89193.rs index a6c3017572a1..da4cd4565893 100644 --- a/tests/ui/simd/issue-89193.rs +++ b/tests/ui/simd/issue-89193.rs @@ -6,36 +6,38 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::simd_gather; -#[repr(simd)] -#[derive(Copy, Clone, PartialEq, Debug)] -struct x4(pub [T; 4]); +type x4 = Simd; fn main() { let x: [usize; 4] = [10, 11, 12, 13]; - let default = x4([0_usize, 1, 2, 3]); + let default = x4::from_array([0_usize, 1, 2, 3]); let all_set = u8::MAX as i8; // aka -1 - let mask = x4([all_set, all_set, all_set, all_set]); - let expected = x4([10_usize, 11, 12, 13]); + let mask = x4::from_array([all_set, all_set, all_set, all_set]); + let expected = x4::from_array([10_usize, 11, 12, 13]); unsafe { let pointer = x.as_ptr(); let pointers = - x4([pointer.offset(0), pointer.offset(1), pointer.offset(2), pointer.offset(3)]); + x4::from_array(std::array::from_fn(|i| pointer.add(i))); let result = simd_gather(default, pointers, mask); assert_eq!(result, expected); } // and again for isize let x: [isize; 4] = [10, 11, 12, 13]; - let default = x4([0_isize, 1, 2, 3]); - let expected = x4([10_isize, 11, 12, 13]); + let default = x4::from_array([0_isize, 1, 2, 3]); + let expected = x4::from_array([10_isize, 11, 12, 13]); unsafe { let pointer = x.as_ptr(); let pointers = - x4([pointer.offset(0), pointer.offset(1), pointer.offset(2), pointer.offset(3)]); + x4::from_array(std::array::from_fn(|i| pointer.add(i))); let result = simd_gather(default, pointers, mask); assert_eq!(result, expected); } diff --git a/tests/ui/simd/masked-load-store.rs b/tests/ui/simd/masked-load-store.rs index 69ea76581ee6..da32ba611c48 100644 --- a/tests/ui/simd/masked-load-store.rs +++ b/tests/ui/simd/masked-load-store.rs @@ -1,11 +1,11 @@ //@ run-pass #![feature(repr_simd, core_intrinsics)] -use std::intrinsics::simd::{simd_masked_load, simd_masked_store}; +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; -#[derive(Copy, Clone)] -#[repr(simd)] -struct Simd([T; N]); +use std::intrinsics::simd::{simd_masked_load, simd_masked_store}; fn main() { unsafe { @@ -15,7 +15,7 @@ fn main() { let b: Simd = simd_masked_load(Simd::([-1, 0, -1, -1]), b_src.as_ptr(), b_default); - assert_eq!(&b.0, &[4, 9, 6, 7]); + assert_eq!(b.as_array(), &[4, 9, 6, 7]); let mut output = [u8::MAX; 5]; diff --git a/tests/ui/simd/monomorphize-shuffle-index.rs b/tests/ui/simd/monomorphize-shuffle-index.rs index a56f2ea14520..1490f8e2319f 100644 --- a/tests/ui/simd/monomorphize-shuffle-index.rs +++ b/tests/ui/simd/monomorphize-shuffle-index.rs @@ -11,6 +11,10 @@ )] #![allow(incomplete_features)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + #[cfg(old)] use std::intrinsics::simd::simd_shuffle; @@ -18,10 +22,6 @@ use std::intrinsics::simd::simd_shuffle; #[rustc_intrinsic] unsafe fn simd_shuffle_const_generic(a: T, b: T) -> U; -#[derive(Copy, Clone)] -#[repr(simd)] -struct Simd([T; N]); - trait Shuffle { const I: Simd; const J: &'static [u32] = &Self::I.0; @@ -57,9 +57,9 @@ fn main() { let b = Simd::([4, 5, 6, 7]); unsafe { let x: Simd = I1.shuffle(a, b); - assert_eq!(x.0, [0, 2, 4, 6]); + assert_eq!(x.into_array(), [0, 2, 4, 6]); let y: Simd = I2.shuffle(a, b); - assert_eq!(y.0, [1, 5]); + assert_eq!(y.into_array(), [1, 5]); } } diff --git a/tests/ui/simd/repr_packed.rs b/tests/ui/simd/repr_packed.rs index cc54477ae713..f0c6de7c402f 100644 --- a/tests/ui/simd/repr_packed.rs +++ b/tests/ui/simd/repr_packed.rs @@ -3,15 +3,16 @@ #![feature(repr_simd, core_intrinsics)] #![allow(non_camel_case_types)] -use std::intrinsics::simd::simd_add; +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; -#[repr(simd, packed)] -struct Simd([T; N]); +use std::intrinsics::simd::simd_add; fn check_size_align() { use std::mem; - assert_eq!(mem::size_of::>(), mem::size_of::<[T; N]>()); - assert_eq!(mem::size_of::>() % mem::align_of::>(), 0); + assert_eq!(mem::size_of::>(), mem::size_of::<[T; N]>()); + assert_eq!(mem::size_of::>() % mem::align_of::>(), 0); } fn check_ty() { @@ -35,14 +36,21 @@ fn main() { unsafe { // powers-of-two have no padding and have the same layout as #[repr(simd)] - let x: Simd = - simd_add(Simd::([0., 1., 2., 3.]), Simd::([2., 2., 2., 2.])); - assert_eq!(std::mem::transmute::<_, [f64; 4]>(x), [2., 3., 4., 5.]); + let x: PackedSimd = + simd_add( + PackedSimd::([0., 1., 2., 3.]), + PackedSimd::([2., 2., 2., 2.]), + ); + assert_eq!(x.into_array(), [2., 3., 4., 5.]); // non-powers-of-two should have padding (which is removed by #[repr(packed)]), // but the intrinsic handles it - let x: Simd = simd_add(Simd::([0., 1., 2.]), Simd::([2., 2., 2.])); - let arr: [f64; 3] = x.0; + let x: PackedSimd = + simd_add( + PackedSimd::([0., 1., 2.]), + PackedSimd::([2., 2., 2.]), + ); + let arr: [f64; 3] = x.into_array(); assert_eq!(arr, [2., 3., 4.]); } } diff --git a/tests/ui/simd/shuffle.rs b/tests/ui/simd/shuffle.rs index cd270edcf00c..061571a47867 100644 --- a/tests/ui/simd/shuffle.rs +++ b/tests/ui/simd/shuffle.rs @@ -10,10 +10,16 @@ use std::marker::ConstParamTy; use std::intrinsics::simd::simd_shuffle; +// not using `minisimd` because of the `ConstParamTy` #[derive(Copy, Clone, ConstParamTy, PartialEq, Eq)] #[repr(simd)] struct Simd([T; N]); +fn into_array(v: Simd) -> [T; N] { + const { assert!(size_of::>() == size_of::<[T; N]>()) } + unsafe { std::intrinsics::transmute_unchecked(v) } +} + unsafe fn __shuffle_vector16, T, U>(x: T, y: T) -> U { simd_shuffle(x, y, IDX) } @@ -25,10 +31,10 @@ fn main() { let b = Simd::([4, 5, 6, 7]); unsafe { let x: Simd = simd_shuffle(a, b, I1); - assert_eq!(x.0, [0, 2, 4, 6]); + assert_eq!(into_array(x), [0, 2, 4, 6]); let y: Simd = simd_shuffle(a, b, I2); - assert_eq!(y.0, [1, 5]); + assert_eq!(into_array(y), [1, 5]); } // Test that an indirection (via an unnamed constant) diff --git a/tests/ui/simd/simd-bitmask-notpow2.rs b/tests/ui/simd/simd-bitmask-notpow2.rs index 4935097065ea..b9af591d1b94 100644 --- a/tests/ui/simd/simd-bitmask-notpow2.rs +++ b/tests/ui/simd/simd-bitmask-notpow2.rs @@ -4,21 +4,23 @@ //@ ignore-endian-big #![feature(repr_simd, core_intrinsics)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; + use std::intrinsics::simd::{simd_bitmask, simd_select_bitmask}; fn main() { // Non-power-of-2 multi-byte mask. - #[repr(simd, packed)] #[allow(non_camel_case_types)] - #[derive(Copy, Clone, Debug, PartialEq)] - struct i32x10([i32; 10]); + type i32x10 = PackedSimd; impl i32x10 { fn splat(x: i32) -> Self { Self([x; 10]) } } unsafe { - let mask = i32x10([!0, !0, 0, !0, 0, 0, !0, 0, !0, 0]); + let mask = i32x10::from_array([!0, !0, 0, !0, 0, 0, !0, 0, !0, 0]); let mask_bits = if cfg!(target_endian = "little") { 0b0101001011 } else { 0b1101001010 }; let mask_bytes = if cfg!(target_endian = "little") { [0b01001011, 0b01] } else { [0b11, 0b01001010] }; @@ -43,17 +45,20 @@ fn main() { } // Test for a mask where the next multiple of 8 is not a power of two. - #[repr(simd, packed)] #[allow(non_camel_case_types)] - #[derive(Copy, Clone, Debug, PartialEq)] - struct i32x20([i32; 20]); + type i32x20 = PackedSimd; impl i32x20 { fn splat(x: i32) -> Self { Self([x; 20]) } } unsafe { - let mask = i32x20([!0, !0, 0, !0, 0, 0, !0, 0, !0, 0, 0, 0, 0, !0, !0, !0, !0, !0, !0, !0]); + let mask = i32x20::from_array([ + !0, !0, 0, !0, 0, + 0, !0, 0, !0, 0, + 0, 0, 0, !0, !0, + !0, !0, !0, !0, !0, + ]); let mask_bits = if cfg!(target_endian = "little") { 0b11111110000101001011 } else { diff --git a/tests/ui/simd/simd-bitmask.rs b/tests/ui/simd/simd-bitmask.rs index 6fcceeaa24bb..609dae3647b2 100644 --- a/tests/ui/simd/simd-bitmask.rs +++ b/tests/ui/simd/simd-bitmask.rs @@ -1,11 +1,11 @@ //@run-pass #![feature(repr_simd, core_intrinsics)] -use std::intrinsics::simd::{simd_bitmask, simd_select_bitmask}; +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +use minisimd::*; -#[derive(Copy, Clone)] -#[repr(simd)] -struct Simd([T; N]); +use std::intrinsics::simd::{simd_bitmask, simd_select_bitmask}; fn main() { unsafe { @@ -41,11 +41,11 @@ fn main() { let mask = if cfg!(target_endian = "little") { 0b0101u8 } else { 0b1010u8 }; let r = simd_select_bitmask(mask, a, b); - assert_eq!(r.0, e); + assert_eq!(r.into_array(), e); let mask = if cfg!(target_endian = "little") { [0b0101u8] } else { [0b1010u8] }; let r = simd_select_bitmask(mask, a, b); - assert_eq!(r.0, e); + assert_eq!(r.into_array(), e); let a = Simd::([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); let b = Simd::([16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]); @@ -57,7 +57,7 @@ fn main() { 0b0011000000001010u16 }; let r = simd_select_bitmask(mask, a, b); - assert_eq!(r.0, e); + assert_eq!(r.into_array(), e); let mask = if cfg!(target_endian = "little") { [0b00001100u8, 0b01010000u8] @@ -65,6 +65,6 @@ fn main() { [0b00110000u8, 0b00001010u8] }; let r = simd_select_bitmask(mask, a, b); - assert_eq!(r.0, e); + assert_eq!(r.into_array(), e); } } diff --git a/tests/ui/simd/target-feature-mixup.rs b/tests/ui/simd/target-feature-mixup.rs index 77f186152487..82902891b97f 100644 --- a/tests/ui/simd/target-feature-mixup.rs +++ b/tests/ui/simd/target-feature-mixup.rs @@ -8,6 +8,11 @@ #![feature(repr_simd, target_feature, cfg_target_feature)] +#[path = "../../auxiliary/minisimd.rs"] +mod minisimd; +#[allow(unused)] +use minisimd::*; + use std::process::{Command, ExitStatus}; use std::env; @@ -50,19 +55,13 @@ fn is_sigill(status: ExitStatus) -> bool { #[allow(nonstandard_style)] mod test { // An SSE type - #[repr(simd)] - #[derive(PartialEq, Debug, Clone, Copy)] - struct __m128i([u64; 2]); + type __m128i = super::u64x2; // An AVX type - #[repr(simd)] - #[derive(PartialEq, Debug, Clone, Copy)] - struct __m256i([u64; 4]); + type __m256i = super::u64x4; // An AVX-512 type - #[repr(simd)] - #[derive(PartialEq, Debug, Clone, Copy)] - struct __m512i([u64; 8]); + type __m512i = super::u64x8; pub fn main(level: &str) { unsafe { @@ -88,9 +87,9 @@ mod test { )*) => ($( $(#[$attr])* unsafe fn $main(level: &str) { - let m128 = __m128i([1, 2]); - let m256 = __m256i([3, 4, 5, 6]); - let m512 = __m512i([7, 8, 9, 10, 11, 12, 13, 14]); + let m128 = __m128i::from_array([1, 2]); + let m256 = __m256i::from_array([3, 4, 5, 6]); + let m512 = __m512i::from_array([7, 8, 9, 10, 11, 12, 13, 14]); assert_eq!(id_sse_128(m128), m128); assert_eq!(id_sse_256(m256), m256); assert_eq!(id_sse_512(m512), m512); @@ -125,55 +124,55 @@ mod test { #[target_feature(enable = "sse2")] unsafe fn id_sse_128(a: __m128i) -> __m128i { - assert_eq!(a, __m128i([1, 2])); + assert_eq!(a, __m128i::from_array([1, 2])); a.clone() } #[target_feature(enable = "sse2")] unsafe fn id_sse_256(a: __m256i) -> __m256i { - assert_eq!(a, __m256i([3, 4, 5, 6])); + assert_eq!(a, __m256i::from_array([3, 4, 5, 6])); a.clone() } #[target_feature(enable = "sse2")] unsafe fn id_sse_512(a: __m512i) -> __m512i { - assert_eq!(a, __m512i([7, 8, 9, 10, 11, 12, 13, 14])); + assert_eq!(a, __m512i::from_array([7, 8, 9, 10, 11, 12, 13, 14])); a.clone() } #[target_feature(enable = "avx")] unsafe fn id_avx_128(a: __m128i) -> __m128i { - assert_eq!(a, __m128i([1, 2])); + assert_eq!(a, __m128i::from_array([1, 2])); a.clone() } #[target_feature(enable = "avx")] unsafe fn id_avx_256(a: __m256i) -> __m256i { - assert_eq!(a, __m256i([3, 4, 5, 6])); + assert_eq!(a, __m256i::from_array([3, 4, 5, 6])); a.clone() } #[target_feature(enable = "avx")] unsafe fn id_avx_512(a: __m512i) -> __m512i { - assert_eq!(a, __m512i([7, 8, 9, 10, 11, 12, 13, 14])); + assert_eq!(a, __m512i::from_array([7, 8, 9, 10, 11, 12, 13, 14])); a.clone() } #[target_feature(enable = "avx512bw")] unsafe fn id_avx512_128(a: __m128i) -> __m128i { - assert_eq!(a, __m128i([1, 2])); + assert_eq!(a, __m128i::from_array([1, 2])); a.clone() } #[target_feature(enable = "avx512bw")] unsafe fn id_avx512_256(a: __m256i) -> __m256i { - assert_eq!(a, __m256i([3, 4, 5, 6])); + assert_eq!(a, __m256i::from_array([3, 4, 5, 6])); a.clone() } #[target_feature(enable = "avx512bw")] unsafe fn id_avx512_512(a: __m512i) -> __m512i { - assert_eq!(a, __m512i([7, 8, 9, 10, 11, 12, 13, 14])); + assert_eq!(a, __m512i::from_array([7, 8, 9, 10, 11, 12, 13, 14])); a.clone() } } From 25a804ab062582bba55bf5cd9844bd13aae00f21 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Fri, 18 Jul 2025 17:29:33 -0700 Subject: [PATCH 123/183] ...and wasm tests too --- tests/ui/wasm/simd-to-array-80108.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/ui/wasm/simd-to-array-80108.rs b/tests/ui/wasm/simd-to-array-80108.rs index c7f8585eaa4e..f6b368992bef 100644 --- a/tests/ui/wasm/simd-to-array-80108.rs +++ b/tests/ui/wasm/simd-to-array-80108.rs @@ -10,6 +10,8 @@ pub struct Vector([i32; 4]); impl Vector { pub const fn to_array(self) -> [i32; 4] { - self.0 + // This used to just be `.0`, but that was banned in + // + unsafe { std::mem::transmute(self) } } } From 493fd9a54110dc9d0d60566140e65f701070e34c Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sat, 12 Jul 2025 17:11:47 -0700 Subject: [PATCH 124/183] Update cranelift tests --- .../example/float-minmax-pass.rs | 22 ++++++++++++------- .../example/mini_core_hello_world.rs | 3 ++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs b/compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs index ad46e18c11c0..b7491b7e522f 100644 --- a/compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs +++ b/compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs @@ -11,6 +11,12 @@ #[derive(Copy, Clone, PartialEq, Debug)] struct f32x4(pub [f32; 4]); +impl f32x4 { + fn into_array(self) -> [f32; 4] { + unsafe { std::mem::transmute(self) } + } +} + use std::intrinsics::simd::*; fn main() { @@ -29,22 +35,22 @@ fn main() { unsafe { let min0 = simd_fmin(x, y); let min1 = simd_fmin(y, x); - assert_eq!(min0, min1); + assert_eq!(min0.into_array(), min1.into_array()); let e = f32x4([1.0, 1.0, 3.0, 3.0]); - assert_eq!(min0, e); + assert_eq!(min0.into_array(), e.into_array()); let minn = simd_fmin(x, n); - assert_eq!(minn, x); + assert_eq!(minn.into_array(), x.into_array()); let minn = simd_fmin(y, n); - assert_eq!(minn, y); + assert_eq!(minn.into_array(), y.into_array()); let max0 = simd_fmax(x, y); let max1 = simd_fmax(y, x); - assert_eq!(max0, max1); + assert_eq!(max0.into_array(), max1.into_array()); let e = f32x4([2.0, 2.0, 4.0, 4.0]); - assert_eq!(max0, e); + assert_eq!(max0.into_array(), e.into_array()); let maxn = simd_fmax(x, n); - assert_eq!(maxn, x); + assert_eq!(maxn.into_array(), x.into_array()); let maxn = simd_fmax(y, n); - assert_eq!(maxn, y); + assert_eq!(maxn.into_array(), y.into_array()); } } diff --git a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs index 246bd3104ec4..86602c6b2a3f 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs @@ -348,7 +348,8 @@ fn main() { struct V([f64; 2]); let f = V([0.0, 1.0]); - let _a = f.0[0]; + let fp = (&raw const f) as *const [f64; 2]; + let _a = (unsafe { &*fp })[0]; stack_val_align(); } From f790042c6ab3cf05622e63928b13cb802d68fadf Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sun, 13 Jul 2025 11:26:40 -0700 Subject: [PATCH 125/183] Update Miri Tests --- .../tests/pass/intrinsics/portable-simd.rs | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/tools/miri/tests/pass/intrinsics/portable-simd.rs b/src/tools/miri/tests/pass/intrinsics/portable-simd.rs index 726d4c01cc3f..e2cd08733af1 100644 --- a/src/tools/miri/tests/pass/intrinsics/portable-simd.rs +++ b/src/tools/miri/tests/pass/intrinsics/portable-simd.rs @@ -349,12 +349,15 @@ fn simd_mask() { // Non-power-of-2 multi-byte mask. #[repr(simd, packed)] #[allow(non_camel_case_types)] - #[derive(Copy, Clone, Debug, PartialEq)] + #[derive(Copy, Clone)] struct i32x10([i32; 10]); impl i32x10 { fn splat(x: i32) -> Self { Self([x; 10]) } + fn into_array(self) -> [i32; 10] { + unsafe { std::mem::transmute(self) } + } } unsafe { let mask = i32x10([!0, !0, 0, !0, 0, 0, !0, 0, !0, 0]); @@ -377,19 +380,22 @@ fn simd_mask() { i32x10::splat(!0), // yes i32x10::splat(0), // no ); - assert_eq!(selected1, mask); - assert_eq!(selected2, mask); + assert_eq!(selected1.into_array(), mask.into_array()); + assert_eq!(selected2.into_array(), mask.into_array()); } // Test for a mask where the next multiple of 8 is not a power of two. #[repr(simd, packed)] #[allow(non_camel_case_types)] - #[derive(Copy, Clone, Debug, PartialEq)] + #[derive(Copy, Clone)] struct i32x20([i32; 20]); impl i32x20 { fn splat(x: i32) -> Self { Self([x; 20]) } + fn into_array(self) -> [i32; 20] { + unsafe { std::mem::transmute(self) } + } } unsafe { let mask = i32x20([!0, !0, 0, !0, 0, 0, !0, 0, !0, 0, 0, 0, 0, !0, !0, !0, !0, !0, !0, !0]); @@ -419,8 +425,8 @@ fn simd_mask() { i32x20::splat(!0), // yes i32x20::splat(0), // no ); - assert_eq!(selected1, mask); - assert_eq!(selected2, mask); + assert_eq!(selected1.into_array(), mask.into_array()); + assert_eq!(selected2.into_array(), mask.into_array()); } } @@ -708,12 +714,12 @@ fn simd_ops_non_pow2() { let x = SimdPacked([1u32; 3]); let y = SimdPacked([2u32; 3]); let z = unsafe { intrinsics::simd_add(x, y) }; - assert_eq!({ z.0 }, [3u32; 3]); + assert_eq!(unsafe { *(&raw const z).cast::<[u32; 3]>() }, [3u32; 3]); let x = SimdPadded([1u32; 3]); let y = SimdPadded([2u32; 3]); let z = unsafe { intrinsics::simd_add(x, y) }; - assert_eq!(z.0, [3u32; 3]); + assert_eq!(unsafe { *(&raw const z).cast::<[u32; 3]>() }, [3u32; 3]); } fn main() { From 6fd83ea5e57ee593f774d24ffe90c87a9cf3b51c Mon Sep 17 00:00:00 2001 From: ognevnydemon Date: Sun, 20 Jul 2025 20:19:11 +0300 Subject: [PATCH 126/183] opt-dist: change build_dir field to be an actual build dir make it configurable so users can set build.build-dir option in bootstrap.toml --- src/tools/opt-dist/src/environment.rs | 2 +- src/tools/opt-dist/src/exec.rs | 4 ++-- src/tools/opt-dist/src/main.rs | 12 +++++++++--- src/tools/opt-dist/src/tests.rs | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/tools/opt-dist/src/environment.rs b/src/tools/opt-dist/src/environment.rs index d41dc80e6b2a..e6e4c711c0cb 100644 --- a/src/tools/opt-dist/src/environment.rs +++ b/src/tools/opt-dist/src/environment.rs @@ -48,7 +48,7 @@ impl Environment { } pub fn build_artifacts(&self) -> Utf8PathBuf { - self.build_root().join("build").join(&self.host_tuple) + self.build_root().join(&self.host_tuple) } pub fn artifact_dir(&self) -> Utf8PathBuf { diff --git a/src/tools/opt-dist/src/exec.rs b/src/tools/opt-dist/src/exec.rs index 56eff2ca2a7d..a8d4c93d160c 100644 --- a/src/tools/opt-dist/src/exec.rs +++ b/src/tools/opt-dist/src/exec.rs @@ -99,7 +99,7 @@ pub struct Bootstrap { impl Bootstrap { pub fn build(env: &Environment) -> Self { - let metrics_path = env.build_root().join("build").join("metrics.json"); + let metrics_path = env.build_root().join("metrics.json"); let cmd = cmd(&[ env.python_binary(), env.checkout_path().join("x.py").as_str(), @@ -119,7 +119,7 @@ impl Bootstrap { } pub fn dist(env: &Environment, dist_args: &[String]) -> Self { - let metrics_path = env.build_root().join("build").join("metrics.json"); + let metrics_path = env.build_root().join("metrics.json"); let args = dist_args.iter().map(|arg| arg.as_str()).collect::>(); let cmd = cmd(&args).env("RUST_BACKTRACE", "full"); let mut cmd = add_shared_x_flags(env, cmd); diff --git a/src/tools/opt-dist/src/main.rs b/src/tools/opt-dist/src/main.rs index 7857f196626b..d0e6badede6e 100644 --- a/src/tools/opt-dist/src/main.rs +++ b/src/tools/opt-dist/src/main.rs @@ -102,6 +102,11 @@ enum EnvironmentCmd { /// Will be LLVM built during the run? #[arg(long, default_value_t = true, action(clap::ArgAction::Set))] build_llvm: bool, + + /// Set build artifacts dir. Relative to `checkout_dir`, should point to the directory set + /// in bootstrap.toml via `build.build-dir` option + #[arg(long, default_value = "build")] + build_dir: Utf8PathBuf, }, /// Perform an optimized build on Linux CI, from inside Docker. LinuxCi { @@ -138,6 +143,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec)> shared, run_tests, build_llvm, + build_dir, } => { let env = EnvironmentBuilder::default() .host_tuple(target_triple) @@ -145,7 +151,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec)> .checkout_dir(checkout_dir.clone()) .host_llvm_dir(llvm_dir) .artifact_dir(artifact_dir) - .build_dir(checkout_dir) + .build_dir(checkout_dir.join(build_dir)) .prebuilt_rustc_perf(rustc_perf_checkout_dir) .shared_llvm(llvm_shared) .use_bolt(use_bolt) @@ -171,7 +177,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec)> .checkout_dir(checkout_dir.clone()) .host_llvm_dir(Utf8PathBuf::from("/rustroot")) .artifact_dir(Utf8PathBuf::from("/tmp/tmp-multistage/opt-artifacts")) - .build_dir(checkout_dir.join("obj")) + .build_dir(checkout_dir.join("obj").join("build")) .shared_llvm(true) // FIXME: Enable bolt for aarch64 once it's fixed upstream. Broken as of December 2024. .use_bolt(!is_aarch64) @@ -194,7 +200,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec)> .checkout_dir(checkout_dir.clone()) .host_llvm_dir(checkout_dir.join("citools").join("clang-rust")) .artifact_dir(checkout_dir.join("opt-artifacts")) - .build_dir(checkout_dir) + .build_dir(checkout_dir.join("build")) .shared_llvm(false) .use_bolt(false) .skipped_tests(vec![]) diff --git a/src/tools/opt-dist/src/tests.rs b/src/tools/opt-dist/src/tests.rs index 2d2aab86eda3..c3c45d262dde 100644 --- a/src/tools/opt-dist/src/tests.rs +++ b/src/tools/opt-dist/src/tests.rs @@ -13,7 +13,7 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> { // and then use that extracted rustc as a stage0 compiler. // Then we run a subset of tests using that compiler, to have a basic smoke test which checks // whether the optimization pipeline hasn't broken something. - let build_dir = env.build_root().join("build"); + let build_dir = env.build_root(); let dist_dir = build_dir.join("dist"); let unpacked_dist_dir = build_dir.join("unpacked-dist"); std::fs::create_dir_all(&unpacked_dist_dir)?; From 41ce1ed252f194756fb2f3e3e92bbdfb3940088d Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Thu, 6 Mar 2025 19:13:46 -0800 Subject: [PATCH 127/183] Ban projecting into SIMD types [MCP838] --- compiler/rustc_codegen_ssa/src/mir/operand.rs | 19 +++--------- compiler/rustc_mir_transform/src/validate.rs | 9 ++++++ .../simd/project-to-simd-array-field.rs | 31 ------------------- tests/ui/mir/validate/project-into-simd.rs | 18 +++++++++++ tests/ui/simd/issue-105439.rs | 4 ++- 5 files changed, 35 insertions(+), 46 deletions(-) delete mode 100644 tests/codegen/simd/project-to-simd-array-field.rs create mode 100644 tests/ui/mir/validate/project-into-simd.rs diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs index 6a3fdb6ede18..06bedaaa4a27 100644 --- a/compiler/rustc_codegen_ssa/src/mir/operand.rs +++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs @@ -329,20 +329,11 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { let offset = self.layout.fields.offset(i); if !bx.is_backend_ref(self.layout) && bx.is_backend_ref(field) { - if let BackendRepr::SimdVector { count, .. } = self.layout.backend_repr - && let BackendRepr::Memory { sized: true } = field.backend_repr - && count.is_power_of_two() - { - assert_eq!(field.size, self.layout.size); - // This is being deprecated, but for now stdarch still needs it for - // Newtype vector of array, e.g. #[repr(simd)] struct S([i32; 4]); - let place = PlaceRef::alloca(bx, field); - self.val.store(bx, place.val.with_type(self.layout)); - return bx.load_operand(place); - } else { - // Part of https://github.com/rust-lang/compiler-team/issues/838 - bug!("Non-ref type {self:?} cannot project to ref field type {field:?}"); - } + // Part of https://github.com/rust-lang/compiler-team/issues/838 + span_bug!( + fx.mir.span, + "Non-ref type {self:?} cannot project to ref field type {field:?}", + ); } let val = if field.is_zst() { diff --git a/compiler/rustc_mir_transform/src/validate.rs b/compiler/rustc_mir_transform/src/validate.rs index 659ca4df159d..5860072d541f 100644 --- a/compiler/rustc_mir_transform/src/validate.rs +++ b/compiler/rustc_mir_transform/src/validate.rs @@ -721,6 +721,15 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { ); } + if adt_def.repr().simd() { + self.fail( + location, + format!( + "Projecting into SIMD type {adt_def:?} is banned by MCP#838" + ), + ); + } + let var = parent_ty.variant_index.unwrap_or(FIRST_VARIANT); let Some(field) = adt_def.variant(var).fields.get(f) else { fail_out_of_bounds(self, location); diff --git a/tests/codegen/simd/project-to-simd-array-field.rs b/tests/codegen/simd/project-to-simd-array-field.rs deleted file mode 100644 index 29fab6406336..000000000000 --- a/tests/codegen/simd/project-to-simd-array-field.rs +++ /dev/null @@ -1,31 +0,0 @@ -//@compile-flags: -Copt-level=3 - -#![crate_type = "lib"] -#![feature(repr_simd, core_intrinsics)] - -#[allow(non_camel_case_types)] -#[derive(Clone, Copy)] -#[repr(simd)] -struct i32x4([i32; 4]); - -#[inline(always)] -fn to_array4(a: i32x4) -> [i32; 4] { - a.0 -} - -// CHECK-LABEL: simd_add_self_then_return_array( -// CHECK-SAME: ptr{{.+}}sret{{.+}}%[[RET:.+]], -// CHECK-SAME: ptr{{.+}}%a) -#[no_mangle] -pub fn simd_add_self_then_return_array(a: &i32x4) -> [i32; 4] { - // It would be nice to just ban `.0` into simd types, - // but until we do this has to keep working. - // See also - - // CHECK: %[[T1:.+]] = load <4 x i32>, ptr %a - // CHECK: %[[T2:.+]] = shl <4 x i32> %[[T1]], {{splat \(i32 1\)|}} - // CHECK: store <4 x i32> %[[T2]], ptr %[[RET]] - let a = *a; - let b = unsafe { core::intrinsics::simd::simd_add(a, a) }; - to_array4(b) -} diff --git a/tests/ui/mir/validate/project-into-simd.rs b/tests/ui/mir/validate/project-into-simd.rs new file mode 100644 index 000000000000..67766c8c4b01 --- /dev/null +++ b/tests/ui/mir/validate/project-into-simd.rs @@ -0,0 +1,18 @@ +// Optimized MIR shouldn't have critical call edges +// +//@ build-fail +//@ edition: 2021 +//@ compile-flags: --crate-type=lib +//@ failure-status: 101 +//@ dont-check-compiler-stderr + +#![feature(repr_simd)] + +#[repr(simd)] +pub struct U32x4([u32; 4]); + +pub fn f(a: U32x4) -> [u32; 4] { + a.0 + //~^ ERROR broken MIR in Item + //~| ERROR Projecting into SIMD type U32x4 is banned by MCP#838 +} diff --git a/tests/ui/simd/issue-105439.rs b/tests/ui/simd/issue-105439.rs index 0a44f36fb2ec..1d57eff341c0 100644 --- a/tests/ui/simd/issue-105439.rs +++ b/tests/ui/simd/issue-105439.rs @@ -10,7 +10,9 @@ struct i32x4([i32; 4]); #[inline(always)] fn to_array(a: i32x4) -> [i32; 4] { - a.0 + // This was originally just `a.0`, but that ended up being annoying enough + // that it was banned by + unsafe { std::mem::transmute(a) } } fn main() { From f147716e7d5a3b4e1e4c0e8b5b5dd26da00cdab0 Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Sun, 20 Jul 2025 05:33:25 +0000 Subject: [PATCH 128/183] flt2dec: use fill instead of loop --- library/core/src/num/flt2dec/mod.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/library/core/src/num/flt2dec/mod.rs b/library/core/src/num/flt2dec/mod.rs index 7601e3e2c58a..e79a00a86596 100644 --- a/library/core/src/num/flt2dec/mod.rs +++ b/library/core/src/num/flt2dec/mod.rs @@ -150,23 +150,19 @@ pub fn round_up(d: &mut [u8]) -> Option { Some(i) => { // d[i+1..n] is all nines d[i] += 1; - for j in i + 1..d.len() { - d[j] = b'0'; - } + d[i + 1..].fill(b'0'); None } - None if d.len() > 0 => { - // 999..999 rounds to 1000..000 with an increased exponent - d[0] = b'1'; - for j in 1..d.len() { - d[j] = b'0'; - } - Some(b'0') - } - None => { + None if d.is_empty() => { // an empty buffer rounds up (a bit strange but reasonable) Some(b'1') } + None => { + // 999..999 rounds to 1000..000 with an increased exponent + d[0] = b'1'; + d[1..].fill(b'0'); + Some(b'0') + } } } From 725523e9b0b7f8c415e238a09a61688a7f3d36a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ml=C3=A1dek?= Date: Wed, 16 Jul 2025 17:49:47 +0200 Subject: [PATCH 129/183] tests: cover more `exported_private_dependencies` cases --- .../pub-priv-dep/auxiliary/priv_dep.rs | 6 + tests/ui/privacy/pub-priv-dep/pub-priv1.rs | 71 +++++++- .../ui/privacy/pub-priv-dep/pub-priv1.stderr | 166 ++++++++++++++++-- 3 files changed, 223 insertions(+), 20 deletions(-) diff --git a/tests/ui/privacy/pub-priv-dep/auxiliary/priv_dep.rs b/tests/ui/privacy/pub-priv-dep/auxiliary/priv_dep.rs index 756401470262..d389f8c861a4 100644 --- a/tests/ui/privacy/pub-priv-dep/auxiliary/priv_dep.rs +++ b/tests/ui/privacy/pub-priv-dep/auxiliary/priv_dep.rs @@ -10,3 +10,9 @@ macro_rules! m { pub enum E { V1 } + +struct PrivType; + +pub type Unit = (); +pub type PubPub = OtherType; +pub type PubPriv = PrivType; diff --git a/tests/ui/privacy/pub-priv-dep/pub-priv1.rs b/tests/ui/privacy/pub-priv-dep/pub-priv1.rs index b85f2754fb18..eae0f9756a10 100644 --- a/tests/ui/privacy/pub-priv-dep/pub-priv1.rs +++ b/tests/ui/privacy/pub-priv-dep/pub-priv1.rs @@ -32,6 +32,33 @@ pub struct PublicType { pub other_field: PubType, // Type from public dependency - this is fine } +pub struct PublicTuple( + pub OtherType, + //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface [exported_private_dependencies] + OtherType, + pub PubType, +); + +pub enum PublicEnum { + OtherType, + ActualOtherType(OtherType, PubType), + //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface [exported_private_dependencies] + ActualOtherTypeStruct { + field: OtherType, + //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface [exported_private_dependencies] + other_field: PubType, + }, +} + +pub struct PublicGenericType(pub T, U); +pub type ReexportedPublicGeneric = PublicGenericType; +//~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface +pub type ReexportedPrivateGeneric = PublicGenericType<(), OtherType>; +//~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface + +pub struct PublicGenericBoundedType(T); +//~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface + impl PublicType { pub fn pub_fn_param(param: OtherType) {} //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface @@ -46,9 +73,15 @@ pub trait MyPubTrait { type Foo: OtherTrait; //~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface - fn required() -> impl OtherTrait; + fn required_impl_trait() -> impl OtherTrait; - fn provided() -> impl OtherTrait { OtherType } + fn provided_impl_trait() -> impl OtherTrait { OtherType } + + fn required_concrete() -> OtherType; + //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface + + fn provided_concrete() -> OtherType { OtherType } + //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface } pub trait WithSuperTrait: OtherTrait {} @@ -67,6 +100,12 @@ impl PubLocalTraitWithAssoc for PrivateAssoc { pub fn in_bounds(x: T) { unimplemented!() } //~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface +pub fn private_return_impl_trait() -> impl OtherTrait { OtherType } +//~^ ERROR trait `OtherTrait` from private dependency 'priv_dep' in public interface + +pub fn private_return() -> OtherType { OtherType } +//~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface + pub fn private_in_generic() -> std::num::Saturating { unimplemented!() } //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface @@ -79,6 +118,9 @@ pub const CONST: OtherType = OtherType; pub type Alias = OtherType; //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface +pub type AliasOfAlias = priv_dep::PubPub; +//~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface + pub struct PublicWithPrivateImpl; impl OtherTrait for PublicWithPrivateImpl {} @@ -90,6 +132,22 @@ impl PubTraitOnPrivate for OtherType {} //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface //~| ERROR type `OtherType` from private dependency 'priv_dep' in public interface +pub struct PublicWithStdImpl; + +impl From for PublicWithStdImpl { +//~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface + fn from(val: OtherType) -> Self { Self } + //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface +} + +impl From for OtherType { + //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface + //~| ERROR type `OtherType` from private dependency 'priv_dep' in public interface + fn from(val: PublicWithStdImpl) -> Self { Self } + //~^ ERROR type `OtherType` from private dependency 'priv_dep' in public interface + //~| ERROR type `OtherType` from private dependency 'priv_dep' in public interface +} + pub struct AllowedPrivType { #[allow(exported_private_dependencies)] pub allowed: OtherType, @@ -107,4 +165,13 @@ pub use pm::pm_attr; pub use priv_dep::E::V1; //~^ ERROR variant `V1` from private dependency 'priv_dep' is re-exported +pub use priv_dep::Unit; +//~^ ERROR type alias `Unit` from private dependency 'priv_dep' is re-exported +pub use priv_dep::PubPub; +//~^ ERROR type alias `PubPub` from private dependency 'priv_dep' is re-exported +pub use priv_dep::PubPriv; +//~^ ERROR type alias `PubPriv` from private dependency 'priv_dep' is re-exported +pub use priv_dep::OtherType as Renamed; +//~^ ERROR struct `Renamed` from private dependency 'priv_dep' is re-exported + fn main() {} diff --git a/tests/ui/privacy/pub-priv-dep/pub-priv1.stderr b/tests/ui/privacy/pub-priv-dep/pub-priv1.stderr index 24bd071567fc..e66db53f65dd 100644 --- a/tests/ui/privacy/pub-priv-dep/pub-priv1.stderr +++ b/tests/ui/privacy/pub-priv-dep/pub-priv1.stderr @@ -11,35 +11,59 @@ LL | #![deny(exported_private_dependencies)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: macro `m` from private dependency 'priv_dep' is re-exported - --> $DIR/pub-priv1.rs:98:9 + --> $DIR/pub-priv1.rs:156:9 | LL | pub use priv_dep::m; | ^^^^^^^^^^^ error: macro `fn_like` from private dependency 'pm' is re-exported - --> $DIR/pub-priv1.rs:100:9 + --> $DIR/pub-priv1.rs:158:9 | LL | pub use pm::fn_like; | ^^^^^^^^^^^ error: derive macro `PmDerive` from private dependency 'pm' is re-exported - --> $DIR/pub-priv1.rs:102:9 + --> $DIR/pub-priv1.rs:160:9 | LL | pub use pm::PmDerive; | ^^^^^^^^^^^^ error: attribute macro `pm_attr` from private dependency 'pm' is re-exported - --> $DIR/pub-priv1.rs:104:9 + --> $DIR/pub-priv1.rs:162:9 | LL | pub use pm::pm_attr; | ^^^^^^^^^^^ error: variant `V1` from private dependency 'priv_dep' is re-exported - --> $DIR/pub-priv1.rs:107:9 + --> $DIR/pub-priv1.rs:165:9 | LL | pub use priv_dep::E::V1; | ^^^^^^^^^^^^^^^ +error: type alias `Unit` from private dependency 'priv_dep' is re-exported + --> $DIR/pub-priv1.rs:168:9 + | +LL | pub use priv_dep::Unit; + | ^^^^^^^^^^^^^^ + +error: type alias `PubPub` from private dependency 'priv_dep' is re-exported + --> $DIR/pub-priv1.rs:170:9 + | +LL | pub use priv_dep::PubPub; + | ^^^^^^^^^^^^^^^^ + +error: type alias `PubPriv` from private dependency 'priv_dep' is re-exported + --> $DIR/pub-priv1.rs:172:9 + | +LL | pub use priv_dep::PubPriv; + | ^^^^^^^^^^^^^^^^^ + +error: struct `Renamed` from private dependency 'priv_dep' is re-exported + --> $DIR/pub-priv1.rs:174:9 + | +LL | pub use priv_dep::OtherType as Renamed; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error: type `OtherType` from private dependency 'priv_dep' in public interface --> $DIR/pub-priv1.rs:29:5 | @@ -49,82 +73,188 @@ LL | pub field: OtherType, error: type `OtherType` from private dependency 'priv_dep' in public interface --> $DIR/pub-priv1.rs:36:5 | +LL | pub OtherType, + | ^^^^^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:44:21 + | +LL | ActualOtherType(OtherType, PubType), + | ^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:47:9 + | +LL | field: OtherType, + | ^^^^^^^^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:54:1 + | +LL | pub type ReexportedPublicGeneric = PublicGenericType; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:56:1 + | +LL | pub type ReexportedPrivateGeneric = PublicGenericType<(), OtherType>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: trait `OtherTrait` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:59:1 + | +LL | pub struct PublicGenericBoundedType(T); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:63:5 + | LL | pub fn pub_fn_param(param: OtherType) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type `OtherType` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:39:5 + --> $DIR/pub-priv1.rs:66:5 | LL | pub fn pub_fn_return() -> OtherType { OtherType } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: trait `OtherTrait` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:46:5 + --> $DIR/pub-priv1.rs:73:5 | LL | type Foo: OtherTrait; | ^^^^^^^^^^^^^^^^^^^^ +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:80:5 + | +LL | fn required_concrete() -> OtherType; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:83:5 + | +LL | fn provided_concrete() -> OtherType { OtherType } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error: trait `OtherTrait` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:54:1 + --> $DIR/pub-priv1.rs:87:1 | LL | pub trait WithSuperTrait: OtherTrait {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type `OtherType` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:63:5 + --> $DIR/pub-priv1.rs:96:5 | LL | type X = OtherType; | ^^^^^^ error: trait `OtherTrait` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:67:1 + --> $DIR/pub-priv1.rs:100:1 | LL | pub fn in_bounds(x: T) { unimplemented!() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: trait `OtherTrait` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:103:1 + | +LL | pub fn private_return_impl_trait() -> impl OtherTrait { OtherType } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error: type `OtherType` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:70:1 + --> $DIR/pub-priv1.rs:106:1 + | +LL | pub fn private_return() -> OtherType { OtherType } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:109:1 | LL | pub fn private_in_generic() -> std::num::Saturating { unimplemented!() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type `OtherType` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:73:1 + --> $DIR/pub-priv1.rs:112:1 | LL | pub static STATIC: OtherType = OtherType; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type `OtherType` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:76:1 + --> $DIR/pub-priv1.rs:115:1 | LL | pub const CONST: OtherType = OtherType; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type `OtherType` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:79:1 + --> $DIR/pub-priv1.rs:118:1 | LL | pub type Alias = OtherType; | ^^^^^^^^^^^^^^ +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:121:1 + | +LL | pub type AliasOfAlias = priv_dep::PubPub; + | ^^^^^^^^^^^^^^^^^^^^^ + error: trait `OtherTrait` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:84:1 + --> $DIR/pub-priv1.rs:126:1 | LL | impl OtherTrait for PublicWithPrivateImpl {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type `OtherType` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:89:1 + --> $DIR/pub-priv1.rs:131:1 | LL | impl PubTraitOnPrivate for OtherType {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type `OtherType` from private dependency 'priv_dep' in public interface - --> $DIR/pub-priv1.rs:89:1 + --> $DIR/pub-priv1.rs:131:1 | LL | impl PubTraitOnPrivate for OtherType {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 20 previous errors +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:137:1 + | +LL | impl From for PublicWithStdImpl { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:139:5 + | +LL | fn from(val: OtherType) -> Self { Self } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:143:1 + | +LL | impl From for OtherType { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:143:1 + | +LL | impl From for OtherType { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:146:5 + | +LL | fn from(val: PublicWithStdImpl) -> Self { Self } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `OtherType` from private dependency 'priv_dep' in public interface + --> $DIR/pub-priv1.rs:146:5 + | +LL | fn from(val: PublicWithStdImpl) -> Self { Self } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 41 previous errors From 3f9be406a6fd879a99a0eba33cc196fa2cb3957b Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 19 Jul 2025 20:04:08 +0200 Subject: [PATCH 130/183] fix handling of base address for TypeId allocations --- .../src/const_eval/machine.rs | 18 ++---- .../rustc_const_eval/src/interpret/memory.rs | 16 ++++- src/tools/miri/src/alloc_addresses/mod.rs | 58 +++++++++++-------- .../src/borrow_tracker/stacked_borrows/mod.rs | 4 +- .../src/borrow_tracker/tree_borrows/mod.rs | 2 +- 5 files changed, 55 insertions(+), 43 deletions(-) diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index f24fb18f83b1..a18ae79f318d 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -279,23 +279,15 @@ impl<'tcx> CompileTimeInterpCx<'tcx> { fn guaranteed_cmp(&mut self, a: Scalar, b: Scalar) -> InterpResult<'tcx, u8> { interp_ok(match (a, b) { // Comparisons between integers are always known. - (Scalar::Int { .. }, Scalar::Int { .. }) => { - if a == b { - 1 - } else { - 0 - } - } - // Comparisons of abstract pointers with null pointers are known if the pointer - // is in bounds, because if they are in bounds, the pointer can't be null. - // Inequality with integers other than null can never be known for sure. - (Scalar::Int(int), ptr @ Scalar::Ptr(..)) - | (ptr @ Scalar::Ptr(..), Scalar::Int(int)) + (Scalar::Int(a), Scalar::Int(b)) => (a == b) as u8, + // Comparisons of null with an arbitrary scalar can be known if `scalar_may_be_null` + // indicates that the scalar can definitely *not* be null. + (Scalar::Int(int), ptr) | (ptr, Scalar::Int(int)) if int.is_null() && !self.scalar_may_be_null(ptr)? => { 0 } - // Equality with integers can never be known for sure. + // Other ways of comparing integers and pointers can never be known for sure. (Scalar::Int { .. }, Scalar::Ptr(..)) | (Scalar::Ptr(..), Scalar::Int { .. }) => 2, // FIXME: return a `1` for when both sides are the same pointer, *except* that // some things (like functions and vtables) do not have stable addresses diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index 20c8e983ceae..34297a616482 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -67,8 +67,10 @@ pub enum AllocKind { LiveData, /// A function allocation (that fn ptrs point to). Function, - /// A "virtual" allocation, used for vtables and TypeId. - Virtual, + /// A vtable allocation. + VTable, + /// A TypeId allocation. + TypeId, /// A dead allocation. Dead, } @@ -952,7 +954,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { let kind = match global_alloc { GlobalAlloc::Static { .. } | GlobalAlloc::Memory { .. } => AllocKind::LiveData, GlobalAlloc::Function { .. } => bug!("We already checked function pointers above"), - GlobalAlloc::VTable { .. } | GlobalAlloc::TypeId { .. } => AllocKind::Virtual, + GlobalAlloc::VTable { .. } => AllocKind::VTable, + GlobalAlloc::TypeId { .. } => AllocKind::TypeId, }; return AllocInfo::new(size, align, kind, mutbl); } @@ -1617,6 +1620,13 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { match self.ptr_try_get_alloc_id(ptr, 0) { Ok((alloc_id, offset, _)) => { let info = self.get_alloc_info(alloc_id); + if matches!(info.kind, AllocKind::TypeId) { + // We *could* actually precisely answer this question since here, + // the offset *is* the integer value. But the entire point of making + // this a pointer is not to leak the integer value, so we say everything + // might be null. + return interp_ok(true); + } // If the pointer is in-bounds (including "at the end"), it is definitely not null. if offset <= info.size { return interp_ok(false); diff --git a/src/tools/miri/src/alloc_addresses/mod.rs b/src/tools/miri/src/alloc_addresses/mod.rs index 10339928ac2d..334503d2994b 100644 --- a/src/tools/miri/src/alloc_addresses/mod.rs +++ b/src/tools/miri/src/alloc_addresses/mod.rs @@ -116,14 +116,6 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { let this = self.eval_context_ref(); let info = this.get_alloc_info(alloc_id); - // Miri's address assignment leaks state across thread boundaries, which is incompatible - // with GenMC execution. So we instead let GenMC assign addresses to allocations. - if let Some(genmc_ctx) = this.machine.data_race.as_genmc_ref() { - let addr = genmc_ctx.handle_alloc(&this.machine, info.size, info.align, memory_kind)?; - return interp_ok(addr); - } - - let mut rng = this.machine.rng.borrow_mut(); // This is either called immediately after allocation (and then cached), or when // adjusting `tcx` pointers (which never get freed). So assert that we are looking // at a live allocation. This also ensures that we never re-assign an address to an @@ -131,6 +123,19 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { // information was removed. assert!(!matches!(info.kind, AllocKind::Dead)); + // TypeId allocations always have a "base address" of 0 (i.e., the relative offset is the + // hash fragment and therefore equal to the actual integer value). + if matches!(info.kind, AllocKind::TypeId) { + return interp_ok(0); + } + + // Miri's address assignment leaks state across thread boundaries, which is incompatible + // with GenMC execution. So we instead let GenMC assign addresses to allocations. + if let Some(genmc_ctx) = this.machine.data_race.as_genmc_ref() { + let addr = genmc_ctx.handle_alloc(&this.machine, info.size, info.align, memory_kind)?; + return interp_ok(addr); + } + // This allocation does not have a base address yet, pick or reuse one. if !this.machine.native_lib.is_empty() { // In native lib mode, we use the "real" address of the bytes for this allocation. @@ -157,7 +162,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { this.get_alloc_bytes_unchecked_raw(alloc_id)? } } - AllocKind::Function | AllocKind::Virtual => { + AllocKind::Function | AllocKind::VTable => { // Allocate some dummy memory to get a unique address for this function/vtable. let alloc_bytes = MiriAllocBytes::from_bytes( &[0u8; 1], @@ -169,12 +174,13 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { std::mem::forget(alloc_bytes); ptr } - AllocKind::Dead => unreachable!(), + AllocKind::TypeId | AllocKind::Dead => unreachable!(), }; // We don't have to expose this pointer yet, we do that in `prepare_for_native_call`. return interp_ok(base_ptr.addr().to_u64()); } // We are not in native lib mode, so we control the addresses ourselves. + let mut rng = this.machine.rng.borrow_mut(); if let Some((reuse_addr, clock)) = global_state.reuse.take_addr( &mut *rng, info.size, @@ -295,21 +301,25 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // Store address in cache. global_state.base_addr.try_insert(alloc_id, base_addr).unwrap(); - // Also maintain the opposite mapping in `int_to_ptr_map`, ensuring we keep it sorted. - // We have a fast-path for the common case that this address is bigger than all previous ones. - let pos = if global_state - .int_to_ptr_map - .last() - .is_some_and(|(last_addr, _)| *last_addr < base_addr) - { - global_state.int_to_ptr_map.len() - } else { - global_state + // Also maintain the opposite mapping in `int_to_ptr_map`, ensuring we keep it + // sorted. We have a fast-path for the common case that this address is bigger than + // all previous ones. We skip this for allocations at address 0; those can't be + // real, they must be TypeId "fake allocations". + if base_addr != 0 { + let pos = if global_state .int_to_ptr_map - .binary_search_by_key(&base_addr, |(addr, _)| *addr) - .unwrap_err() - }; - global_state.int_to_ptr_map.insert(pos, (base_addr, alloc_id)); + .last() + .is_some_and(|(last_addr, _)| *last_addr < base_addr) + { + global_state.int_to_ptr_map.len() + } else { + global_state + .int_to_ptr_map + .binary_search_by_key(&base_addr, |(addr, _)| *addr) + .unwrap_err() + }; + global_state.int_to_ptr_map.insert(pos, (base_addr, alloc_id)); + } interp_ok(base_addr) } diff --git a/src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs b/src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs index e834fdffdd18..2977efaae04a 100644 --- a/src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs +++ b/src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs @@ -650,7 +650,7 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> { dcx.log_protector(); } }, - AllocKind::Function | AllocKind::Virtual | AllocKind::Dead => { + AllocKind::Function | AllocKind::VTable | AllocKind::TypeId | AllocKind::Dead => { // No stacked borrows on these allocations. } } @@ -1021,7 +1021,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { trace!("Stacked Borrows tag {tag:?} exposed in {alloc_id:?}"); alloc_extra.borrow_tracker_sb().borrow_mut().exposed_tags.insert(tag); } - AllocKind::Function | AllocKind::Virtual | AllocKind::Dead => { + AllocKind::Function | AllocKind::VTable | AllocKind::TypeId | AllocKind::Dead => { // No stacked borrows on these allocations. } } diff --git a/src/tools/miri/src/borrow_tracker/tree_borrows/mod.rs b/src/tools/miri/src/borrow_tracker/tree_borrows/mod.rs index aa92f8a8c309..ad2a67160f48 100644 --- a/src/tools/miri/src/borrow_tracker/tree_borrows/mod.rs +++ b/src/tools/miri/src/borrow_tracker/tree_borrows/mod.rs @@ -673,7 +673,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { trace!("Tree Borrows tag {tag:?} exposed in {alloc_id:?}"); alloc_extra.borrow_tracker_tb().borrow_mut().expose_tag(tag); } - AllocKind::Function | AllocKind::Virtual | AllocKind::Dead => { + AllocKind::Function | AllocKind::VTable | AllocKind::TypeId | AllocKind::Dead => { // No tree borrows on these allocations. } } From 7bf2dd6295d95ec5a92cc23b70a32a36035bc995 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 20 Jul 2025 22:27:43 +0200 Subject: [PATCH 131/183] update lockfile --- Cargo.lock | 159 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 108 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7d2fca8bb3f4..43f8f30979f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,7 +384,7 @@ dependencies = [ name = "cargo-miri" version = "0.1.0" dependencies = [ - "cargo_metadata 0.19.2", + "cargo_metadata 0.21.0", "directories", "rustc-build-sysroot", "rustc_tools_util 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -402,6 +402,31 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo-platform" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84982c6c0ae343635a3a4ee6dedef965513735c8b183caa7289fa6e27399ebd4" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-util-schemas" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dc1a6f7b5651af85774ae5a34b4e8be397d9cf4bc063b7e6dbd99a841837830" +dependencies = [ + "semver", + "serde", + "serde-untagged", + "serde-value", + "thiserror 2.0.12", + "toml 0.8.23", + "unicode-xid", + "url", +] + [[package]] name = "cargo_metadata" version = "0.18.1" @@ -409,7 +434,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", - "cargo-platform", + "cargo-platform 0.1.9", "semver", "serde", "serde_json", @@ -423,7 +448,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" dependencies = [ "camino", - "cargo-platform", + "cargo-platform 0.1.9", + "semver", + "serde", + "serde_json", + "thiserror 2.0.12", +] + +[[package]] +name = "cargo_metadata" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cfca2aaa699835ba88faf58a06342a314a950d2b9686165e038286c30316868" +dependencies = [ + "camino", + "cargo-platform 0.2.0", + "cargo-util-schemas", "semver", "serde", "serde_json", @@ -572,7 +612,7 @@ dependencies = [ "tempfile", "termize", "toml 0.7.8", - "ui_test 0.30.2", + "ui_test", "walkdir", ] @@ -714,6 +754,15 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "colored" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "comma" version = "1.0.0" @@ -727,7 +776,7 @@ dependencies = [ "anstyle-svg", "build_helper", "camino", - "colored", + "colored 2.2.0", "diff", "getopts", "glob", @@ -1154,6 +1203,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "erased-serde" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] + [[package]] name = "errno" version = "0.3.13" @@ -1842,17 +1901,16 @@ dependencies = [ [[package]] name = "ipc-channel" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8251fb7bcd9ccd3725ed8deae9fe7db8e586495c9eb5b0c52e6233e5e75ea" +checksum = "5b1c98b70019c830a1fc39cecfe1f60ff99c4122f0a189697c810c90ec545c14" dependencies = [ "bincode", "crossbeam-channel", "fnv", - "lazy_static", "libc", "mio", - "rand 0.8.5", + "rand 0.9.1", "serde", "tempfile", "uuid", @@ -2251,7 +2309,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "log", "wasi 0.11.1+wasi-snapshot-preview1", "windows-sys 0.59.0", ] @@ -2274,7 +2331,7 @@ dependencies = [ "capstone", "chrono", "chrono-tz", - "colored", + "colored 3.0.0", "directories", "getrandom 0.3.3", "ipc-channel", @@ -2291,7 +2348,7 @@ dependencies = [ "smallvec", "tempfile", "tikv-jemalloc-sys", - "ui_test 0.29.2", + "ui_test", ] [[package]] @@ -2571,6 +2628,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + [[package]] name = "overload" version = "0.1.1" @@ -4847,6 +4913,27 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-untagged" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "299d9c19d7d466db4ab10addd5703e4c615dec2a5a16dbbafe191045e87ee66e" +dependencies = [ + "erased-serde", + "serde", + "typeid", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.219" @@ -4944,16 +5031,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "spanned" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86af297923fbcfd107c20a189a6e9c872160df71a7190ae4a7a6c5dce4b2feb6" -dependencies = [ - "bstr", - "color-eyre", -] - [[package]] name = "spanned" version = "0.4.1" @@ -5531,6 +5608,12 @@ dependencies = [ "rustc-hash 2.1.1", ] +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + [[package]] name = "typenum" version = "1.18.0" @@ -5552,32 +5635,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" -[[package]] -name = "ui_test" -version = "0.29.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1211b1111c752c73b33073d2958072be08825fd97c9ab4d83444da361a06634b" -dependencies = [ - "annotate-snippets 0.11.5", - "anyhow", - "bstr", - "cargo-platform", - "cargo_metadata 0.18.1", - "color-eyre", - "colored", - "comma", - "crossbeam-channel", - "indicatif", - "levenshtein", - "prettydiff", - "regex", - "rustc_version", - "rustfix", - "serde", - "serde_json", - "spanned 0.3.0", -] - [[package]] name = "ui_test" version = "0.30.2" @@ -5587,10 +5644,10 @@ dependencies = [ "annotate-snippets 0.11.5", "anyhow", "bstr", - "cargo-platform", + "cargo-platform 0.1.9", "cargo_metadata 0.18.1", "color-eyre", - "colored", + "colored 2.2.0", "comma", "crossbeam-channel", "indicatif", @@ -5601,7 +5658,7 @@ dependencies = [ "rustfix", "serde", "serde_json", - "spanned 0.4.1", + "spanned", ] [[package]] From d2be1c8d009997584112954b7ee806e07a322eda Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 20 Jul 2025 22:35:43 +0200 Subject: [PATCH 132/183] Option::as_slice: fix comment --- library/core/src/option.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 8036c59e893a..0e481519f76f 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -842,7 +842,7 @@ impl Option { // just needs to be aligned, which it is because `&self` is aligned and // the offset used is a multiple of alignment. // - // In the new version, the intrinsic always returns a pointer to an + // Here we assume that `offset_of!` always returns an offset to an // in-bounds and correctly aligned position for a `T` (even if in the // `None` case it's just padding). unsafe { From e68f5fe9edaa75e534572da2a3b7832e7d5cfc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 11 Jul 2025 20:30:18 +0200 Subject: [PATCH 133/183] Implement `check::RustAnalyzer` using the `tool_check_step` macro --- src/bootstrap/src/core/build_steps/check.rs | 90 ++++++--------------- src/bootstrap/src/core/builder/tests.rs | 4 +- 2 files changed, 25 insertions(+), 69 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index 2a19e17019e0..a7f2c7b1b605 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -370,69 +370,6 @@ impl Step for CodegenBackend { } } -/// Checks Rust analyzer that links to .rmetas from a checked rustc. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct RustAnalyzer { - pub build_compiler: Compiler, - pub target: TargetSelection, -} - -impl Step for RustAnalyzer { - type Output = (); - const ONLY_HOSTS: bool = true; - const DEFAULT: bool = true; - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - let builder = run.builder; - run.path("src/tools/rust-analyzer").default_condition( - builder - .config - .tools - .as_ref() - .is_none_or(|tools| tools.iter().any(|tool| tool == "rust-analyzer")), - ) - } - - fn make_run(run: RunConfig<'_>) { - let build_compiler = prepare_compiler_for_check(run.builder, run.target, Mode::ToolRustc); - run.builder.ensure(RustAnalyzer { build_compiler, target: run.target }); - } - - fn run(self, builder: &Builder<'_>) { - let build_compiler = self.build_compiler; - let target = self.target; - - let mut cargo = prepare_tool_cargo( - builder, - build_compiler, - Mode::ToolRustc, - target, - builder.kind, - "src/tools/rust-analyzer", - SourceType::InTree, - &["in-rust-tree".to_owned()], - ); - - cargo.allow_features(crate::core::build_steps::tool::RustAnalyzer::ALLOW_FEATURES); - - cargo.arg("--bins"); - cargo.arg("--tests"); - cargo.arg("--benches"); - - // Cargo's output path in a given stage, compiled by a particular - // compiler for the specified target. - let stamp = BuildStamp::new(&builder.cargo_out(build_compiler, Mode::ToolRustc, target)) - .with_prefix("rust-analyzer-check"); - - let _guard = builder.msg_check("rust-analyzer artifacts", target, None); - run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false); - } - - fn metadata(&self) -> Option { - Some(StepMetadata::check("rust-analyzer", self.target).built_by(self.build_compiler)) - } -} - macro_rules! tool_check_step { ( $name:ident { @@ -441,7 +378,10 @@ macro_rules! tool_check_step { $(, alt_path: $alt_path:literal )* // Closure that returns `Mode` based on the passed `&Builder<'_>` , mode: $mode:expr + // Subset of nightly features that are allowed to be used when checking $(, allow_features: $allow_features:expr )? + // Features that should be enabled when checking + $(, enable_features: [$($enable_features:expr),*] )? $(, default: $default:literal )? $( , )? } @@ -485,8 +425,9 @@ macro_rules! tool_check_step { $( _value = $allow_features; )? _value }; + let extra_features: &[&str] = &[$($($enable_features),*)?]; let mode = $mode(builder); - run_tool_check_step(builder, build_compiler, target, $path, mode, allow_features); + run_tool_check_step(builder, build_compiler, target, $path, mode, allow_features, extra_features); } fn metadata(&self) -> Option { @@ -504,9 +445,11 @@ fn run_tool_check_step( path: &str, mode: Mode, allow_features: &str, + extra_features: &[&str], ) { let display_name = path.rsplit('/').next().unwrap(); + let extra_features = extra_features.iter().map(|f| f.to_string()).collect::>(); let mut cargo = prepare_tool_cargo( builder, build_compiler, @@ -519,12 +462,19 @@ fn run_tool_check_step( // steps should probably be marked non-default so that the default // checks aren't affected by toolstate being broken. SourceType::InTree, - &[], + &extra_features, ); cargo.allow_features(allow_features); - // FIXME: check bootstrap doesn't currently work with --all-targets - cargo.arg("--all-targets"); + // FIXME: check bootstrap doesn't currently work when multiple targets are checked + // FIXME: rust-analyzer does not work with --all-targets + if display_name == "rust-analyzer" { + cargo.arg("--bins"); + cargo.arg("--tests"); + cargo.arg("--benches"); + } else { + cargo.arg("--all-targets"); + } let stamp = BuildStamp::new(&builder.cargo_out(build_compiler, mode, target)) .with_prefix(&format!("{display_name}-check")); @@ -553,6 +503,12 @@ tool_check_step!(Clippy { path: "src/tools/clippy", mode: |_builder| Mode::ToolR tool_check_step!(Miri { path: "src/tools/miri", mode: |_builder| Mode::ToolRustc }); tool_check_step!(CargoMiri { path: "src/tools/miri/cargo-miri", mode: |_builder| Mode::ToolRustc }); tool_check_step!(Rustfmt { path: "src/tools/rustfmt", mode: |_builder| Mode::ToolRustc }); +tool_check_step!(RustAnalyzer { + path: "src/tools/rust-analyzer", + mode: |_builder| Mode::ToolRustc, + allow_features: tool::RustAnalyzer::ALLOW_FEATURES, + enable_features: ["in-rust-tree"], +}); tool_check_step!(MiroptTestTools { path: "src/tools/miropt-test-tools", mode: |_builder| Mode::ToolBootstrap diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index d27a2e65ed17..d3184e555064 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -1377,7 +1377,7 @@ mod snapshot { [check] rustc 1 -> Miri 2 [check] rustc 1 -> CargoMiri 2 [check] rustc 1 -> Rustfmt 2 - [check] rustc 1 -> rust-analyzer 2 + [check] rustc 1 -> RustAnalyzer 2 [check] rustc 1 -> TestFloatParse 2 [check] rustc 1 -> std 1 "); @@ -1569,7 +1569,7 @@ mod snapshot { .render_steps(), @r" [build] llvm [check] rustc 0 -> rustc 1 - [check] rustc 0 -> rust-analyzer 1 + [check] rustc 0 -> RustAnalyzer 1 "); } From 192efbbd209eae7006b05205d507fb8c19802a60 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 16 Jul 2025 16:25:29 +0200 Subject: [PATCH 134/183] clippy: make tests work in stage 1 --- src/bootstrap/src/core/build_steps/test.rs | 44 +++++++++---------- src/tools/clippy/clippy_test_deps/Cargo.lock | 1 + src/tools/clippy/clippy_test_deps/Cargo.toml | 1 + src/tools/clippy/tests/compile-test.rs | 29 +++++++++++- .../tests/ui/auxiliary/proc_macro_derive.rs | 2 +- src/tools/clippy/tests/ui/cast_alignment.rs | 3 -- .../clippy/tests/ui/cast_alignment.stderr | 8 ++-- .../clippy/tests/ui/iter_over_hash_type.rs | 11 +++-- .../tests/ui/iter_over_hash_type.stderr | 26 +++++------ .../clippy/tests/ui/strlen_on_c_strings.fixed | 2 - .../clippy/tests/ui/strlen_on_c_strings.rs | 2 - .../tests/ui/strlen_on_c_strings.stderr | 14 +++--- .../clippy/tests/ui/useless_attribute.fixed | 2 +- .../clippy/tests/ui/useless_attribute.rs | 2 +- 14 files changed, 84 insertions(+), 63 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 9e7ea5c115f1..cc2c88f512cb 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -739,7 +739,6 @@ impl Step for CompiletestTest { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Clippy { - stage: u32, host: TargetSelection, } @@ -753,33 +752,23 @@ impl Step for Clippy { } fn make_run(run: RunConfig<'_>) { - // If stage is explicitly set or not lower than 2, keep it. Otherwise, make sure it's at least 2 - // as tests for this step don't work with a lower stage. - let stage = if run.builder.config.is_explicit_stage() || run.builder.top_stage >= 2 { - run.builder.top_stage - } else { - 2 - }; - - run.builder.ensure(Clippy { stage, host: run.target }); + run.builder.ensure(Clippy { host: run.target }); } /// Runs `cargo test` for clippy. fn run(self, builder: &Builder<'_>) { - let stage = self.stage; + let stage = builder.top_stage; let host = self.host; - let compiler = builder.compiler(stage, host); + // We need to carefully distinguish the compiler that builds clippy, and the compiler + // that is linked into the clippy being tested. `target_compiler` is the latter, + // and it must also be used by clippy's test runner to build tests and their dependencies. + let target_compiler = builder.compiler(stage, host); - if stage < 2 { - eprintln!("WARNING: clippy tests on stage {stage} may not behave well."); - eprintln!("HELP: consider using stage 2"); - } - - let tool_result = builder.ensure(tool::Clippy { compiler, target: self.host }); - let compiler = tool_result.build_compiler; + let tool_result = builder.ensure(tool::Clippy { compiler: target_compiler, target: host }); + let tool_compiler = tool_result.build_compiler; let mut cargo = tool::prepare_tool_cargo( builder, - compiler, + tool_compiler, Mode::ToolRustc, host, Kind::Test, @@ -788,11 +777,17 @@ impl Step for Clippy { &[], ); - cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler)); - cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler)); - let host_libs = builder.stage_out(compiler, Mode::ToolRustc).join(builder.cargo_dir()); + cargo.env("RUSTC_TEST_SUITE", builder.rustc(tool_compiler)); + cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(tool_compiler)); + let host_libs = builder.stage_out(tool_compiler, Mode::ToolRustc).join(builder.cargo_dir()); cargo.env("HOST_LIBS", host_libs); + // Build the standard library that the tests can use. + builder.std(target_compiler, host); + cargo.env("TEST_SYSROOT", builder.sysroot(target_compiler)); + cargo.env("TEST_RUSTC", builder.rustc(target_compiler)); + cargo.env("TEST_RUSTC_LIB", builder.rustc_libdir(target_compiler)); + // Collect paths of tests to run 'partially_test: { let paths = &builder.config.paths[..]; @@ -813,7 +808,8 @@ impl Step for Clippy { cargo.add_rustc_lib_path(builder); let cargo = prepare_cargo_test(cargo, &[], &[], host, builder); - let _guard = builder.msg_sysroot_tool(Kind::Test, compiler.stage, "clippy", host, host); + let _guard = + builder.msg_sysroot_tool(Kind::Test, tool_compiler.stage, "clippy", host, host); // Clippy reports errors if it blessed the outputs if cargo.allow_failure().run(builder) { diff --git a/src/tools/clippy/clippy_test_deps/Cargo.lock b/src/tools/clippy/clippy_test_deps/Cargo.lock index a591dae3a1a6..5be404f24e6f 100644 --- a/src/tools/clippy/clippy_test_deps/Cargo.lock +++ b/src/tools/clippy/clippy_test_deps/Cargo.lock @@ -72,6 +72,7 @@ dependencies = [ "futures", "if_chain", "itertools", + "libc", "parking_lot", "quote", "regex", diff --git a/src/tools/clippy/clippy_test_deps/Cargo.toml b/src/tools/clippy/clippy_test_deps/Cargo.toml index a23ffcaf2f97..fcedc5d4843c 100644 --- a/src/tools/clippy/clippy_test_deps/Cargo.toml +++ b/src/tools/clippy/clippy_test_deps/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" # Add dependencies here to make them available in ui tests. [dependencies] +libc = "0.2" regex = "1.5.5" serde = { version = "1.0.145", features = ["derive"] } if_chain = "1.0" diff --git a/src/tools/clippy/tests/compile-test.rs b/src/tools/clippy/tests/compile-test.rs index 57d623b2cfc8..83f91ccaa7b4 100644 --- a/src/tools/clippy/tests/compile-test.rs +++ b/src/tools/clippy/tests/compile-test.rs @@ -151,7 +151,31 @@ impl TestContext { defaults.set_custom( "dependencies", DependencyBuilder { - program: CommandBuilder::cargo(), + program: { + let mut p = CommandBuilder::cargo(); + // If we run in bootstrap, we need to use the right compiler for building the + // tests -- not the compiler that built clippy, but the compiler that got linked + // into clippy. Just invoking TEST_RUSTC does not work because LD_LIBRARY_PATH + // is set in a way that makes it pick the wrong sysroot. Sadly due to + // we cannot use RUSTFLAGS to + // set `--sysroot`, so we need to use bootstrap's rustc wrapper. That wrapper + // however has some staging logic that is hurting us here, so to work around + // that we set both the "real" and "staging" rustc to TEST_RUSTC, including the + // associated library paths. + if let Some(rustc) = option_env!("TEST_RUSTC") { + let libdir = option_env!("TEST_RUSTC_LIB").unwrap(); + let sysroot = option_env!("TEST_SYSROOT").unwrap(); + p.envs.push(("RUSTC_REAL".into(), Some(rustc.into()))); + p.envs.push(("RUSTC_REAL_LIBDIR".into(), Some(libdir.into()))); + p.envs.push(("RUSTC_SNAPSHOT".into(), Some(rustc.into()))); + p.envs.push(("RUSTC_SNAPSHOT_LIBDIR".into(), Some(libdir.into()))); + p.envs.push(( + "RUSTC_SYSROOT".into(), + Some(sysroot.into()), + )); + } + p + }, crate_manifest_path: Path::new("clippy_test_deps").join("Cargo.toml"), build_std: None, bless_lockfile: self.args.bless, @@ -192,6 +216,9 @@ impl TestContext { let dep = format!("-Ldependency={}", Path::new(host_libs).join("deps").display()); config.program.args.push(dep.into()); } + if let Some(sysroot) = option_env!("TEST_SYSROOT") { + config.program.args.push(format!("--sysroot={sysroot}").into()); + } config.program.program = profile_path.join(if cfg!(windows) { "clippy-driver.exe" diff --git a/src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs b/src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs index 5992d15935d5..546509228717 100644 --- a/src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs +++ b/src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs @@ -16,7 +16,7 @@ pub fn derive(_: TokenStream) -> TokenStream { let output = quote! { // Should not trigger `useless_attribute` #[allow(dead_code)] - extern crate rustc_middle; + extern crate core; }; output } diff --git a/src/tools/clippy/tests/ui/cast_alignment.rs b/src/tools/clippy/tests/ui/cast_alignment.rs index 5773ffddb917..ef667f5598a6 100644 --- a/src/tools/clippy/tests/ui/cast_alignment.rs +++ b/src/tools/clippy/tests/ui/cast_alignment.rs @@ -1,6 +1,5 @@ //! Test casts for alignment issues -#![feature(rustc_private)] #![feature(core_intrinsics)] #![warn(clippy::cast_ptr_alignment)] #![allow( @@ -10,8 +9,6 @@ clippy::borrow_as_ptr )] -extern crate libc; - fn main() { /* These should be warned against */ diff --git a/src/tools/clippy/tests/ui/cast_alignment.stderr b/src/tools/clippy/tests/ui/cast_alignment.stderr index 6d9a81f0ecfd..ee4c3e9a77ef 100644 --- a/src/tools/clippy/tests/ui/cast_alignment.stderr +++ b/src/tools/clippy/tests/ui/cast_alignment.stderr @@ -1,5 +1,5 @@ error: casting from `*const u8` to a more-strictly-aligned pointer (`*const u16`) (1 < 2 bytes) - --> tests/ui/cast_alignment.rs:19:5 + --> tests/ui/cast_alignment.rs:16:5 | LL | (&1u8 as *const u8) as *const u16; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,19 +8,19 @@ LL | (&1u8 as *const u8) as *const u16; = help: to override `-D warnings` add `#[allow(clippy::cast_ptr_alignment)]` error: casting from `*mut u8` to a more-strictly-aligned pointer (`*mut u16`) (1 < 2 bytes) - --> tests/ui/cast_alignment.rs:22:5 + --> tests/ui/cast_alignment.rs:19:5 | LL | (&mut 1u8 as *mut u8) as *mut u16; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: casting from `*const u8` to a more-strictly-aligned pointer (`*const u16`) (1 < 2 bytes) - --> tests/ui/cast_alignment.rs:26:5 + --> tests/ui/cast_alignment.rs:23:5 | LL | (&1u8 as *const u8).cast::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: casting from `*mut u8` to a more-strictly-aligned pointer (`*mut u16`) (1 < 2 bytes) - --> tests/ui/cast_alignment.rs:29:5 + --> tests/ui/cast_alignment.rs:26:5 | LL | (&mut 1u8 as *mut u8).cast::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/clippy/tests/ui/iter_over_hash_type.rs b/src/tools/clippy/tests/ui/iter_over_hash_type.rs index 914cc9df0de9..9a3e7033cd87 100644 --- a/src/tools/clippy/tests/ui/iter_over_hash_type.rs +++ b/src/tools/clippy/tests/ui/iter_over_hash_type.rs @@ -3,15 +3,18 @@ #![warn(clippy::iter_over_hash_type)] use std::collections::{HashMap, HashSet}; -extern crate rustc_data_structures; - extern crate proc_macros; +// Ensure it also works via type aliases (this isn't really the Fx hasher but that does not matter). +type FxBuildHasher = std::collections::hash_map::RandomState; +type FxHashMap = HashMap; +type FxHashSet = HashSet; + fn main() { let mut hash_set = HashSet::::new(); let mut hash_map = HashMap::::new(); - let mut fx_hash_map = rustc_data_structures::fx::FxHashMap::::default(); - let mut fx_hash_set = rustc_data_structures::fx::FxHashMap::::default(); + let mut fx_hash_map = FxHashMap::::default(); + let mut fx_hash_set = FxHashSet::::default(); let vec = Vec::::new(); // test hashset diff --git a/src/tools/clippy/tests/ui/iter_over_hash_type.stderr b/src/tools/clippy/tests/ui/iter_over_hash_type.stderr index 1bc6f4588d44..3356186547db 100644 --- a/src/tools/clippy/tests/ui/iter_over_hash_type.stderr +++ b/src/tools/clippy/tests/ui/iter_over_hash_type.stderr @@ -1,5 +1,5 @@ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:18:5 + --> tests/ui/iter_over_hash_type.rs:21:5 | LL | / for x in &hash_set { LL | | @@ -11,7 +11,7 @@ LL | | } = help: to override `-D warnings` add `#[allow(clippy::iter_over_hash_type)]` error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:22:5 + --> tests/ui/iter_over_hash_type.rs:25:5 | LL | / for x in hash_set.iter() { LL | | @@ -20,7 +20,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:26:5 + --> tests/ui/iter_over_hash_type.rs:29:5 | LL | / for x in hash_set.clone() { LL | | @@ -29,7 +29,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:30:5 + --> tests/ui/iter_over_hash_type.rs:33:5 | LL | / for x in hash_set.drain() { LL | | @@ -38,7 +38,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:36:5 + --> tests/ui/iter_over_hash_type.rs:39:5 | LL | / for (x, y) in &hash_map { LL | | @@ -47,7 +47,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:40:5 + --> tests/ui/iter_over_hash_type.rs:43:5 | LL | / for x in hash_map.keys() { LL | | @@ -56,7 +56,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:44:5 + --> tests/ui/iter_over_hash_type.rs:47:5 | LL | / for x in hash_map.values() { LL | | @@ -65,7 +65,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:48:5 + --> tests/ui/iter_over_hash_type.rs:51:5 | LL | / for x in hash_map.values_mut() { LL | | @@ -74,7 +74,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:52:5 + --> tests/ui/iter_over_hash_type.rs:55:5 | LL | / for x in hash_map.iter() { LL | | @@ -83,7 +83,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:56:5 + --> tests/ui/iter_over_hash_type.rs:59:5 | LL | / for x in hash_map.clone() { LL | | @@ -92,7 +92,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:60:5 + --> tests/ui/iter_over_hash_type.rs:63:5 | LL | / for x in hash_map.drain() { LL | | @@ -101,7 +101,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:66:5 + --> tests/ui/iter_over_hash_type.rs:69:5 | LL | / for x in fx_hash_set { LL | | @@ -110,7 +110,7 @@ LL | | } | |_____^ error: iteration over unordered hash-based type - --> tests/ui/iter_over_hash_type.rs:70:5 + --> tests/ui/iter_over_hash_type.rs:73:5 | LL | / for x in fx_hash_map { LL | | diff --git a/src/tools/clippy/tests/ui/strlen_on_c_strings.fixed b/src/tools/clippy/tests/ui/strlen_on_c_strings.fixed index 31ed1cf03a2d..17c1b541f77c 100644 --- a/src/tools/clippy/tests/ui/strlen_on_c_strings.fixed +++ b/src/tools/clippy/tests/ui/strlen_on_c_strings.fixed @@ -1,7 +1,5 @@ #![warn(clippy::strlen_on_c_strings)] #![allow(dead_code, clippy::manual_c_str_literals)] -#![feature(rustc_private)] -extern crate libc; #[allow(unused)] use libc::strlen; diff --git a/src/tools/clippy/tests/ui/strlen_on_c_strings.rs b/src/tools/clippy/tests/ui/strlen_on_c_strings.rs index 0f3798c9fd8a..c641422f5df4 100644 --- a/src/tools/clippy/tests/ui/strlen_on_c_strings.rs +++ b/src/tools/clippy/tests/ui/strlen_on_c_strings.rs @@ -1,7 +1,5 @@ #![warn(clippy::strlen_on_c_strings)] #![allow(dead_code, clippy::manual_c_str_literals)] -#![feature(rustc_private)] -extern crate libc; #[allow(unused)] use libc::strlen; diff --git a/src/tools/clippy/tests/ui/strlen_on_c_strings.stderr b/src/tools/clippy/tests/ui/strlen_on_c_strings.stderr index b8619fa2df30..84a93b99ee33 100644 --- a/src/tools/clippy/tests/ui/strlen_on_c_strings.stderr +++ b/src/tools/clippy/tests/ui/strlen_on_c_strings.stderr @@ -1,5 +1,5 @@ error: using `libc::strlen` on a `CString` or `CStr` value - --> tests/ui/strlen_on_c_strings.rs:13:13 + --> tests/ui/strlen_on_c_strings.rs:11:13 | LL | let _ = unsafe { libc::strlen(cstring.as_ptr()) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cstring.as_bytes().len()` @@ -8,37 +8,37 @@ LL | let _ = unsafe { libc::strlen(cstring.as_ptr()) }; = help: to override `-D warnings` add `#[allow(clippy::strlen_on_c_strings)]` error: using `libc::strlen` on a `CString` or `CStr` value - --> tests/ui/strlen_on_c_strings.rs:18:13 + --> tests/ui/strlen_on_c_strings.rs:16:13 | LL | let _ = unsafe { libc::strlen(cstr.as_ptr()) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cstr.to_bytes().len()` error: using `libc::strlen` on a `CString` or `CStr` value - --> tests/ui/strlen_on_c_strings.rs:21:13 + --> tests/ui/strlen_on_c_strings.rs:19:13 | LL | let _ = unsafe { strlen(cstr.as_ptr()) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cstr.to_bytes().len()` error: using `libc::strlen` on a `CString` or `CStr` value - --> tests/ui/strlen_on_c_strings.rs:25:22 + --> tests/ui/strlen_on_c_strings.rs:23:22 | LL | let _ = unsafe { strlen((*pcstr).as_ptr()) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*pcstr).to_bytes().len()` error: using `libc::strlen` on a `CString` or `CStr` value - --> tests/ui/strlen_on_c_strings.rs:31:22 + --> tests/ui/strlen_on_c_strings.rs:29:22 | LL | let _ = unsafe { strlen(unsafe_identity(cstr).as_ptr()) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unsafe_identity(cstr).to_bytes().len()` error: using `libc::strlen` on a `CString` or `CStr` value - --> tests/ui/strlen_on_c_strings.rs:33:13 + --> tests/ui/strlen_on_c_strings.rs:31:13 | LL | let _ = unsafe { strlen(unsafe { unsafe_identity(cstr) }.as_ptr()) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unsafe { unsafe_identity(cstr) }.to_bytes().len()` error: using `libc::strlen` on a `CString` or `CStr` value - --> tests/ui/strlen_on_c_strings.rs:37:22 + --> tests/ui/strlen_on_c_strings.rs:35:22 | LL | let _ = unsafe { strlen(f(cstr).as_ptr()) }; | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `f(cstr).to_bytes().len()` diff --git a/src/tools/clippy/tests/ui/useless_attribute.fixed b/src/tools/clippy/tests/ui/useless_attribute.fixed index a96c8f46f551..930bc1eaecf9 100644 --- a/src/tools/clippy/tests/ui/useless_attribute.fixed +++ b/src/tools/clippy/tests/ui/useless_attribute.fixed @@ -13,7 +13,7 @@ #[allow(unused_imports)] #[allow(unused_extern_crates)] #[macro_use] -extern crate rustc_middle; +extern crate regex as regex_crate; #[macro_use] extern crate proc_macro_derive; diff --git a/src/tools/clippy/tests/ui/useless_attribute.rs b/src/tools/clippy/tests/ui/useless_attribute.rs index b26410134bbb..50fafd478e51 100644 --- a/src/tools/clippy/tests/ui/useless_attribute.rs +++ b/src/tools/clippy/tests/ui/useless_attribute.rs @@ -13,7 +13,7 @@ #[allow(unused_imports)] #[allow(unused_extern_crates)] #[macro_use] -extern crate rustc_middle; +extern crate regex as regex_crate; #[macro_use] extern crate proc_macro_derive; From 1987471d05854cc8b5014dab44e7648834c02213 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 20 Jul 2025 22:33:04 +0000 Subject: [PATCH 135/183] Consider parent predicates in ImpossiblePredicates pass. --- .../src/impossible_predicates.rs | 26 ++++++++++++++----- .../type-alias-bounds.neg.stderr | 25 +++++++++++------- .../generic_const_exprs/type-alias-bounds.rs | 1 + ...utable-due-to-trivial-bounds-ice-135138.rs | 3 ++- ...le-due-to-trivial-bounds-ice-135138.stderr | 6 ++--- .../layout/unknown-when-no-type-parameter.rs | 5 ++-- .../unknown-when-no-type-parameter.stderr | 7 ++--- .../unknown-when-ptr-metadata-is-DST.rs | 3 ++- .../unknown-when-ptr-metadata-is-DST.stderr | 6 ++--- .../trivial-bounds/everybody-copies.rs} | 7 +++-- .../trivial-bounds/two-sized-strs.rs} | 4 ++- 11 files changed, 58 insertions(+), 35 deletions(-) rename tests/{crashes/131507.rs => ui/trivial-bounds/everybody-copies.rs} (57%) rename tests/{crashes/121363.rs => ui/trivial-bounds/two-sized-strs.rs} (67%) diff --git a/compiler/rustc_mir_transform/src/impossible_predicates.rs b/compiler/rustc_mir_transform/src/impossible_predicates.rs index 86e2bf6cb3c6..5f116d7716db 100644 --- a/compiler/rustc_mir_transform/src/impossible_predicates.rs +++ b/compiler/rustc_mir_transform/src/impossible_predicates.rs @@ -27,7 +27,7 @@ //! it's usually never invoked in this way. use rustc_middle::mir::{Body, START_BLOCK, TerminatorKind}; -use rustc_middle::ty::{TyCtxt, TypeVisitableExt}; +use rustc_middle::ty::{TyCtxt, TypeFlags, TypeVisitableExt}; use rustc_trait_selection::traits; use tracing::trace; @@ -36,14 +36,26 @@ use crate::pass_manager::MirPass; pub(crate) struct ImpossiblePredicates; impl<'tcx> MirPass<'tcx> for ImpossiblePredicates { + #[tracing::instrument(level = "trace", skip(self, tcx, body))] fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { - let predicates = tcx - .predicates_of(body.source.def_id()) + tracing::trace!(def_id = ?body.source.def_id()); + let predicates = tcx.predicates_of(body.source.def_id()).instantiate_identity(tcx); + tracing::trace!(?predicates); + let predicates = predicates .predicates - .iter() - .filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None }); - if traits::impossible_predicates(tcx, traits::elaborate(tcx, predicates).collect()) { - trace!("found unsatisfiable predicates for {:?}", body.source); + .into_iter() + .filter(|p| { + !p.has_type_flags( + // Only consider global clauses to simplify. + TypeFlags::HAS_FREE_LOCAL_NAMES + // Clauses that refer to unevaluated constants as they cause cycles. + | TypeFlags::HAS_CT_PROJECTION, + ) + }) + .collect(); + tracing::trace!(?predicates); + if traits::impossible_predicates(tcx, predicates) { + trace!("found unsatisfiable predicates"); // Clear the body to only contain a single `unreachable` statement. let bbs = body.basic_blocks.as_mut(); bbs.raw.truncate(1); diff --git a/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.neg.stderr b/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.neg.stderr index fa12dd14753f..364fecb96ea9 100644 --- a/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.neg.stderr +++ b/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.neg.stderr @@ -10,8 +10,14 @@ note: required by a bound in `ct_unused_0::AliasConstUnused` LL | type AliasConstUnused = (T, I32<{ DATA }>); | ^^^^ required by this bound in `AliasConstUnused` +error[E0080]: entering unreachable code + --> $DIR/type-alias-bounds.rs:29:52 + | +LL | type AliasConstUnused where String: Copy = I32<{ 0; 0 }>; + | ^^^^^^^^ evaluation of `ct_unused_1::AliasConstUnused::{constant#0}` failed here + error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-alias-bounds.rs:31:12 + --> $DIR/type-alias-bounds.rs:32:12 | LL | let _: AliasConstUnused; | ^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` @@ -23,41 +29,42 @@ LL | type AliasConstUnused where String: Copy = I32<{ 0; 0 }>; | ^^^^ required by this bound in `AliasConstUnused` error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-alias-bounds.rs:39:12 + --> $DIR/type-alias-bounds.rs:40:12 | LL | let _: AliasFnUnused; | ^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | note: required by a bound in `AliasFnUnused` - --> $DIR/type-alias-bounds.rs:36:27 + --> $DIR/type-alias-bounds.rs:37:27 | LL | type AliasFnUnused = (T, I32<{ code() }>); | ^^^^ required by this bound in `AliasFnUnused` error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-alias-bounds.rs:57:12 + --> $DIR/type-alias-bounds.rs:58:12 | LL | let _: AliasAssocConstUsed; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | note: required by a bound in `AliasAssocConstUsed` - --> $DIR/type-alias-bounds.rs:55:41 + --> $DIR/type-alias-bounds.rs:56:41 | LL | type AliasAssocConstUsed = I32<{ T::DATA }>; | ^^^^ required by this bound in `AliasAssocConstUsed` error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-alias-bounds.rs:65:12 + --> $DIR/type-alias-bounds.rs:66:12 | LL | let _: AliasFnUsed; | ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | note: required by a bound in `AliasFnUsed` - --> $DIR/type-alias-bounds.rs:62:33 + --> $DIR/type-alias-bounds.rs:63:33 | LL | type AliasFnUsed = I32<{ code::() }>; | ^^^^ required by this bound in `AliasFnUsed` -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors -For more information about this error, try `rustc --explain E0277`. +Some errors have detailed explanations: E0080, E0277. +For more information about an error, try `rustc --explain E0080`. diff --git a/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs b/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs index f16e646129c6..775b28f8c73a 100644 --- a/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs +++ b/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs @@ -27,6 +27,7 @@ fn ct_unused_0() { fn ct_unused_1() { #[allow(trivial_bounds)] type AliasConstUnused where String: Copy = I32<{ 0; 0 }>; + //[neg]~^ ERROR entering unreachable code #[cfg(neg)] let _: AliasConstUnused; //[neg]~^ ERROR the trait bound `String: Copy` is not satisfied diff --git a/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.rs b/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.rs index 4423b83e24d4..8015a2fe081f 100644 --- a/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.rs +++ b/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.rs @@ -5,7 +5,8 @@ where str: Sized, { [(); { let _a: Option = None; 0 }]; - //~^ ERROR the type `Option` has an unknown layout + //~^ ERROR entering unreachable code + //~| NOTE evaluation of `return_str::{constant#0}` failed here } fn main() {} diff --git a/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.stderr b/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.stderr index 43fe9e3a7a72..cad73b603c1e 100644 --- a/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.stderr +++ b/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.stderr @@ -1,8 +1,8 @@ -error[E0080]: the type `Option` has an unknown layout - --> $DIR/uncomputable-due-to-trivial-bounds-ice-135138.rs:7:16 +error[E0080]: entering unreachable code + --> $DIR/uncomputable-due-to-trivial-bounds-ice-135138.rs:7:10 | LL | [(); { let _a: Option = None; 0 }]; - | ^^ evaluation of `return_str::{constant#0}` failed here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `return_str::{constant#0}` failed here error: aborting due to 1 previous error diff --git a/tests/ui/layout/unknown-when-no-type-parameter.rs b/tests/ui/layout/unknown-when-no-type-parameter.rs index f787998868d4..8579593c65c6 100644 --- a/tests/ui/layout/unknown-when-no-type-parameter.rs +++ b/tests/ui/layout/unknown-when-no-type-parameter.rs @@ -9,9 +9,8 @@ where (): Project, { [(); size_of::<<() as Project>::Assoc>()]; - //~^ ERROR the type `<() as Project>::Assoc` has an unknown layout - //~| NOTE inside `std::mem::size_of::<<() as Project>::Assoc>` - //~| NOTE failed inside this call + //~^ ERROR entering unreachable code + //~| NOTE evaluation of `foo::{constant#0}` failed here } fn main() {} diff --git a/tests/ui/layout/unknown-when-no-type-parameter.stderr b/tests/ui/layout/unknown-when-no-type-parameter.stderr index 9bb42c46ec3e..7c382c7a8550 100644 --- a/tests/ui/layout/unknown-when-no-type-parameter.stderr +++ b/tests/ui/layout/unknown-when-no-type-parameter.stderr @@ -1,11 +1,8 @@ -error[E0080]: the type `<() as Project>::Assoc` has an unknown layout +error[E0080]: entering unreachable code --> $DIR/unknown-when-no-type-parameter.rs:11:10 | LL | [(); size_of::<<() as Project>::Assoc>()]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `foo::{constant#0}` failed inside this call - | -note: inside `std::mem::size_of::<<() as Project>::Assoc>` - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `foo::{constant#0}` failed here error: aborting due to 1 previous error diff --git a/tests/ui/layout/unknown-when-ptr-metadata-is-DST.rs b/tests/ui/layout/unknown-when-ptr-metadata-is-DST.rs index 54f339711d5c..da11804c2267 100644 --- a/tests/ui/layout/unknown-when-ptr-metadata-is-DST.rs +++ b/tests/ui/layout/unknown-when-ptr-metadata-is-DST.rs @@ -6,7 +6,8 @@ where str: std::ptr::Pointee, { [(); { let _a: Option<&str> = None; 0 }]; - //~^ ERROR the type `str` has an unknown layout + //~^ ERROR entering unreachable code + //~| NOTE evaluation of `return_str::{constant#0}` failed here } fn main() {} diff --git a/tests/ui/layout/unknown-when-ptr-metadata-is-DST.stderr b/tests/ui/layout/unknown-when-ptr-metadata-is-DST.stderr index fd9eedc9267a..888e2574119d 100644 --- a/tests/ui/layout/unknown-when-ptr-metadata-is-DST.stderr +++ b/tests/ui/layout/unknown-when-ptr-metadata-is-DST.stderr @@ -1,8 +1,8 @@ -error[E0080]: the type `str` has an unknown layout - --> $DIR/unknown-when-ptr-metadata-is-DST.rs:8:16 +error[E0080]: entering unreachable code + --> $DIR/unknown-when-ptr-metadata-is-DST.rs:8:10 | LL | [(); { let _a: Option<&str> = None; 0 }]; - | ^^ evaluation of `return_str::{constant#0}` failed here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `return_str::{constant#0}` failed here error: aborting due to 1 previous error diff --git a/tests/crashes/131507.rs b/tests/ui/trivial-bounds/everybody-copies.rs similarity index 57% rename from tests/crashes/131507.rs rename to tests/ui/trivial-bounds/everybody-copies.rs index 05b5e76bed7d..3469fa1f1dae 100644 --- a/tests/crashes/131507.rs +++ b/tests/ui/trivial-bounds/everybody-copies.rs @@ -1,5 +1,8 @@ -//@ known-bug: #131507 -//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+Inline -Zvalidate-mir +//! Regression test for #131507 +//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+Inline -Zvalidate-mir --crate-type lib +//@ build-pass + +#![expect(incomplete_features)] #![feature(non_lifetime_binders)] fn brick() diff --git a/tests/crashes/121363.rs b/tests/ui/trivial-bounds/two-sized-strs.rs similarity index 67% rename from tests/crashes/121363.rs rename to tests/ui/trivial-bounds/two-sized-strs.rs index 387963422848..5cb82eac417f 100644 --- a/tests/crashes/121363.rs +++ b/tests/ui/trivial-bounds/two-sized-strs.rs @@ -1,7 +1,9 @@ -//@ known-bug: #121363 +//! Regression test for #121363 //@ compile-flags: -Zmir-enable-passes=+GVN --crate-type lib +//@ build-pass #![feature(trivial_bounds)] +#![expect(trivial_bounds)] #[derive(Debug)] struct TwoStrs(str, str) From 538b0004bc3a64004c9935c91231ed1d518ee35f Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 20 Jul 2025 23:12:44 +0000 Subject: [PATCH 136/183] Also bail out if predicates contain errors. --- .../src/impossible_predicates.rs | 4 ++-- tests/crashes/140100.rs | 7 ------- tests/crashes/140365.rs | 8 -------- tests/ui/mir/meaningless-bound.rs | 20 +++++++++++++++++++ tests/ui/mir/meaningless-bound.stderr | 19 ++++++++++++++++++ 5 files changed, 41 insertions(+), 17 deletions(-) delete mode 100644 tests/crashes/140100.rs delete mode 100644 tests/crashes/140365.rs create mode 100644 tests/ui/mir/meaningless-bound.rs create mode 100644 tests/ui/mir/meaningless-bound.stderr diff --git a/compiler/rustc_mir_transform/src/impossible_predicates.rs b/compiler/rustc_mir_transform/src/impossible_predicates.rs index 5f116d7716db..9a0de3c93263 100644 --- a/compiler/rustc_mir_transform/src/impossible_predicates.rs +++ b/compiler/rustc_mir_transform/src/impossible_predicates.rs @@ -41,7 +41,7 @@ impl<'tcx> MirPass<'tcx> for ImpossiblePredicates { tracing::trace!(def_id = ?body.source.def_id()); let predicates = tcx.predicates_of(body.source.def_id()).instantiate_identity(tcx); tracing::trace!(?predicates); - let predicates = predicates + let predicates: Vec<_> = predicates .predicates .into_iter() .filter(|p| { @@ -54,7 +54,7 @@ impl<'tcx> MirPass<'tcx> for ImpossiblePredicates { }) .collect(); tracing::trace!(?predicates); - if traits::impossible_predicates(tcx, predicates) { + if predicates.references_error() || traits::impossible_predicates(tcx, predicates) { trace!("found unsatisfiable predicates"); // Clear the body to only contain a single `unreachable` statement. let bbs = body.basic_blocks.as_mut(); diff --git a/tests/crashes/140100.rs b/tests/crashes/140100.rs deleted file mode 100644 index 0836ffe2d92f..000000000000 --- a/tests/crashes/140100.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ known-bug: #140100 -fn a() -where - b: Sized, -{ - println!() -} diff --git a/tests/crashes/140365.rs b/tests/crashes/140365.rs deleted file mode 100644 index 809ceaf35a05..000000000000 --- a/tests/crashes/140365.rs +++ /dev/null @@ -1,8 +0,0 @@ -//@ known-bug: #140365 -//@compile-flags: -C opt-level=1 -Zvalidate-mir -fn f() -> &'static str -where - Self: Sized, -{ - "" -} diff --git a/tests/ui/mir/meaningless-bound.rs b/tests/ui/mir/meaningless-bound.rs new file mode 100644 index 000000000000..c9427e7ece51 --- /dev/null +++ b/tests/ui/mir/meaningless-bound.rs @@ -0,0 +1,20 @@ +//! Regression test for #140100 and #140365 +//@compile-flags: -C opt-level=1 -Zvalidate-mir + +fn a() +where + b: Sized, + //~^ ERROR cannot find type `b` in this scope +{ + println!() +} + +fn f() -> &'static str +where + Self: Sized, + //~^ ERROR cannot find type `Self` in this scope +{ + "" +} + +fn main() {} diff --git a/tests/ui/mir/meaningless-bound.stderr b/tests/ui/mir/meaningless-bound.stderr new file mode 100644 index 000000000000..dc08def83b66 --- /dev/null +++ b/tests/ui/mir/meaningless-bound.stderr @@ -0,0 +1,19 @@ +error[E0412]: cannot find type `b` in this scope + --> $DIR/meaningless-bound.rs:6:5 + | +LL | b: Sized, + | ^ not found in this scope + +error[E0411]: cannot find type `Self` in this scope + --> $DIR/meaningless-bound.rs:14:5 + | +LL | fn f() -> &'static str + | - `Self` not allowed in a function +LL | where +LL | Self: Sized, + | ^^^^ `Self` is only available in impls, traits, and type definitions + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0411, E0412. +For more information about an error, try `rustc --explain E0411`. From a546a7cb255da0c4ea4fbfa918d786890bde928e Mon Sep 17 00:00:00 2001 From: Jens Reidel Date: Mon, 21 Jul 2025 02:01:42 +0200 Subject: [PATCH 137/183] Fix run-make tests on musl hosts On musl hosts, we already set -Ctarget-feature=-crt-static and IS_MUSL_HOST=1 in compiletest. However, in order for the run-make tests to compile fine on musl hosts, we need to propagate this flag in our rustc invocations to ensure we can generate cdylibs. Signed-off-by: Jens Reidel --- src/tools/run-make-support/src/external_deps/rustc.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tools/run-make-support/src/external_deps/rustc.rs b/src/tools/run-make-support/src/external_deps/rustc.rs index 1ea549ca7ea1..08ba1388dc14 100644 --- a/src/tools/run-make-support/src/external_deps/rustc.rs +++ b/src/tools/run-make-support/src/external_deps/rustc.rs @@ -52,13 +52,20 @@ impl Rustc { // `rustc` invocation constructor methods /// Construct a new `rustc` invocation. This will automatically set the library - /// search path as `-L cwd()` and also the compilation target. + /// search path as `-L cwd()`, configure the compilation target and enable + /// dynamic linkage by default on musl hosts. /// Use [`bare_rustc`] to avoid this. #[track_caller] pub fn new() -> Self { let mut cmd = setup_common(); cmd.arg("-L").arg(cwd()); + // FIXME: On musl hosts, we currently default to static linkage, while + // for running run-make tests, we rely on dynamic linkage by default + if std::env::var("IS_MUSL_HOST").is_ok_and(|i| i == "1") { + cmd.arg("-Ctarget-feature=-crt-static"); + } + // Automatically default to cross-compilation Self { cmd, target: Some(target()) } } From 750c1e9c39633de1242acf086ef1c053961219b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 21 Jul 2025 09:17:54 +0300 Subject: [PATCH 138/183] Preparing for merge from rust-lang/rust --- src/tools/rust-analyzer/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer/rust-version b/src/tools/rust-analyzer/rust-version index 57ff326ce5a2..c2b1c151b834 100644 --- a/src/tools/rust-analyzer/rust-version +++ b/src/tools/rust-analyzer/rust-version @@ -1 +1 @@ -a9fb6103b05c6ad6eee6bed4c0bb5a2e8e1024c6 +e05ab47e6c418fb2b9faa2eae9a7e70c65c98eaa From 1482809fc16f11ecedb92e688922cf52a2441ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 21 Jul 2025 09:19:24 +0300 Subject: [PATCH 139/183] Bump rustc crates --- src/tools/rust-analyzer/Cargo.lock | 40 +++++++++++++++++------------- src/tools/rust-analyzer/Cargo.toml | 10 ++++---- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/tools/rust-analyzer/Cargo.lock b/src/tools/rust-analyzer/Cargo.lock index e55cd80943df..f3adc4006acf 100644 --- a/src/tools/rust-analyzer/Cargo.lock +++ b/src/tools/rust-analyzer/Cargo.lock @@ -1505,7 +1505,7 @@ dependencies = [ "edition", "expect-test", "ra-ap-rustc_lexer", - "rustc-literal-escaper", + "rustc-literal-escaper 0.0.4", "stdx", "tracing", ] @@ -1756,9 +1756,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_abi" -version = "0.121.0" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee51482d1c9d3e538acda8cce723db8eea1a81540544bf362bf4c3d841b2329" +checksum = "fb01e1fec578003c85481c1cad4ff8cd8195b07c2dc85ae3f716108507ae15d5" dependencies = [ "bitflags 2.9.1", "ra-ap-rustc_hashes", @@ -1768,18 +1768,18 @@ dependencies = [ [[package]] name = "ra-ap-rustc_hashes" -version = "0.121.0" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c8f1e0c28e24e1b4c55dc08058c6c9829df2204497d4034259f491d348c204" +checksum = "e0ec056e72a472ffef8761ce96ece6c626eb07368c09d0105b6df30d27d07673" dependencies = [ "rustc-stable-hash", ] [[package]] name = "ra-ap-rustc_index" -version = "0.121.0" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33f429cec6b92fa2c7243883279fb29dd233fdc3e94099aff32aa91aa87f50" +checksum = "0fcdd1001db0295e59052e9f53aeda588bbe81e362534f4687d41bd44777b5a7" dependencies = [ "ra-ap-rustc_index_macros", "smallvec", @@ -1787,9 +1787,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_index_macros" -version = "0.121.0" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b55910dbe1fe7ef34bdc1d1bcb41e99b377eb680ea58a1218d95d6b4152257" +checksum = "728d64dd98e25530b32e3f7c7c1e844e52722b269360daa1cdeba9dff9727a26" dependencies = [ "proc-macro2", "quote", @@ -1798,9 +1798,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_lexer" -version = "0.121.0" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22944e31fb91e9b3e75bcbc91e37d958b8c0825a6160927f2856831d2ce83b36" +checksum = "415f0821f512608d825b3215489a6a6a2c18ed9f0045953d514e7ec23d4b90ab" dependencies = [ "memchr", "unicode-properties", @@ -1809,19 +1809,19 @@ dependencies = [ [[package]] name = "ra-ap-rustc_parse_format" -version = "0.121.0" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81057891bc2063ad9e353f29462fbc47a0f5072560af34428ae9313aaa5e9d97" +checksum = "18d2c4b48fa26e031b1cca0c8ca7433770f5e35e33da56da8636dae2cd45d4e1" dependencies = [ "ra-ap-rustc_lexer", - "rustc-literal-escaper", + "rustc-literal-escaper 0.0.5", ] [[package]] name = "ra-ap-rustc_pattern_analysis" -version = "0.121.0" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe21a3542980d56d2435e96c2720773cac1c63fd4db666417e414729da192eb3" +checksum = "4657fcfdfe06e2a02ec8180d4e7c95aecf4811ba50367e363d1a2300b7623284" dependencies = [ "ra-ap-rustc_index", "rustc-hash 2.1.1", @@ -1972,6 +1972,12 @@ version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab03008eb631b703dd16978282ae36c73282e7922fe101a4bd072a40ecea7b8b" +[[package]] +name = "rustc-literal-escaper" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ee29da77c5a54f42697493cd4c9b9f31b74df666a6c04dfc4fde77abe0438b" + [[package]] name = "rustc-stable-hash" version = "0.1.2" @@ -2259,7 +2265,7 @@ dependencies = [ "rayon", "rowan", "rustc-hash 2.1.1", - "rustc-literal-escaper", + "rustc-literal-escaper 0.0.4", "rustc_apfloat", "smol_str", "stdx", diff --git a/src/tools/rust-analyzer/Cargo.toml b/src/tools/rust-analyzer/Cargo.toml index 41fa06a76a7b..b21ac158d8e7 100644 --- a/src/tools/rust-analyzer/Cargo.toml +++ b/src/tools/rust-analyzer/Cargo.toml @@ -89,11 +89,11 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" } vfs = { path = "./crates/vfs", version = "0.0.0" } edition = { path = "./crates/edition", version = "0.0.0" } -ra-ap-rustc_lexer = { version = "0.121", default-features = false } -ra-ap-rustc_parse_format = { version = "0.121", default-features = false } -ra-ap-rustc_index = { version = "0.121", default-features = false } -ra-ap-rustc_abi = { version = "0.121", default-features = false } -ra-ap-rustc_pattern_analysis = { version = "0.121", default-features = false } +ra-ap-rustc_lexer = { version = "0.122", default-features = false } +ra-ap-rustc_parse_format = { version = "0.122", default-features = false } +ra-ap-rustc_index = { version = "0.122", default-features = false } +ra-ap-rustc_abi = { version = "0.122", default-features = false } +ra-ap-rustc_pattern_analysis = { version = "0.122", default-features = false } # local crates that aren't published to crates.io. These should not have versions. From f2633640d6e4dbc544b7c722bcda491a8f564285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 21 Jul 2025 09:27:37 +0300 Subject: [PATCH 140/183] Bump rustc-literal-escaper --- src/tools/rust-analyzer/Cargo.lock | 12 +++--------- src/tools/rust-analyzer/Cargo.toml | 2 +- .../rust-analyzer/crates/syntax/src/ast/token_ext.rs | 4 ++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/tools/rust-analyzer/Cargo.lock b/src/tools/rust-analyzer/Cargo.lock index f3adc4006acf..711d03224644 100644 --- a/src/tools/rust-analyzer/Cargo.lock +++ b/src/tools/rust-analyzer/Cargo.lock @@ -1505,7 +1505,7 @@ dependencies = [ "edition", "expect-test", "ra-ap-rustc_lexer", - "rustc-literal-escaper 0.0.4", + "rustc-literal-escaper", "stdx", "tracing", ] @@ -1814,7 +1814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18d2c4b48fa26e031b1cca0c8ca7433770f5e35e33da56da8636dae2cd45d4e1" dependencies = [ "ra-ap-rustc_lexer", - "rustc-literal-escaper 0.0.5", + "rustc-literal-escaper", ] [[package]] @@ -1966,12 +1966,6 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc-literal-escaper" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab03008eb631b703dd16978282ae36c73282e7922fe101a4bd072a40ecea7b8b" - [[package]] name = "rustc-literal-escaper" version = "0.0.5" @@ -2265,7 +2259,7 @@ dependencies = [ "rayon", "rowan", "rustc-hash 2.1.1", - "rustc-literal-escaper 0.0.4", + "rustc-literal-escaper", "rustc_apfloat", "smol_str", "stdx", diff --git a/src/tools/rust-analyzer/Cargo.toml b/src/tools/rust-analyzer/Cargo.toml index b21ac158d8e7..1ca258abf4b4 100644 --- a/src/tools/rust-analyzer/Cargo.toml +++ b/src/tools/rust-analyzer/Cargo.toml @@ -149,7 +149,7 @@ serde = { version = "1.0.219" } serde_derive = { version = "1.0.219" } serde_json = "1.0.140" rustc-hash = "2.1.1" -rustc-literal-escaper = "0.0.4" +rustc-literal-escaper = "0.0.5" smallvec = { version = "1.15.1", features = [ "const_new", "union", diff --git a/src/tools/rust-analyzer/crates/syntax/src/ast/token_ext.rs b/src/tools/rust-analyzer/crates/syntax/src/ast/token_ext.rs index 4afdda78a0e7..742c452616ef 100644 --- a/src/tools/rust-analyzer/crates/syntax/src/ast/token_ext.rs +++ b/src/tools/rust-analyzer/crates/syntax/src/ast/token_ext.rs @@ -309,8 +309,8 @@ impl ast::CString { let mut prev_end = 0; let mut has_error = None; let extend_unit = |buf: &mut Vec, unit: MixedUnit| match unit { - MixedUnit::Char(c) => buf.extend(c.encode_utf8(&mut [0; 4]).as_bytes()), - MixedUnit::HighByte(b) => buf.push(b), + MixedUnit::Char(c) => buf.extend(c.get().encode_utf8(&mut [0; 4]).as_bytes()), + MixedUnit::HighByte(b) => buf.push(b.get()), }; unescape_c_str(text, |char_range, unescaped| match (unescaped, buf.capacity() == 0) { (Ok(u), false) => extend_unit(&mut buf, u), From 2050358679088b319cde837f9c6e9d9e58249503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 21 Jul 2025 09:31:28 +0300 Subject: [PATCH 141/183] Revert "Bump rustc-literal-escaper" This reverts commit 9f3adc540b51a4c2d0472d94033f6d9147b36f6e. --- src/tools/rust-analyzer/Cargo.lock | 12 +++++++++--- src/tools/rust-analyzer/Cargo.toml | 2 +- .../rust-analyzer/crates/syntax/src/ast/token_ext.rs | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/tools/rust-analyzer/Cargo.lock b/src/tools/rust-analyzer/Cargo.lock index 711d03224644..f3adc4006acf 100644 --- a/src/tools/rust-analyzer/Cargo.lock +++ b/src/tools/rust-analyzer/Cargo.lock @@ -1505,7 +1505,7 @@ dependencies = [ "edition", "expect-test", "ra-ap-rustc_lexer", - "rustc-literal-escaper", + "rustc-literal-escaper 0.0.4", "stdx", "tracing", ] @@ -1814,7 +1814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18d2c4b48fa26e031b1cca0c8ca7433770f5e35e33da56da8636dae2cd45d4e1" dependencies = [ "ra-ap-rustc_lexer", - "rustc-literal-escaper", + "rustc-literal-escaper 0.0.5", ] [[package]] @@ -1966,6 +1966,12 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +[[package]] +name = "rustc-literal-escaper" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab03008eb631b703dd16978282ae36c73282e7922fe101a4bd072a40ecea7b8b" + [[package]] name = "rustc-literal-escaper" version = "0.0.5" @@ -2259,7 +2265,7 @@ dependencies = [ "rayon", "rowan", "rustc-hash 2.1.1", - "rustc-literal-escaper", + "rustc-literal-escaper 0.0.4", "rustc_apfloat", "smol_str", "stdx", diff --git a/src/tools/rust-analyzer/Cargo.toml b/src/tools/rust-analyzer/Cargo.toml index 1ca258abf4b4..b21ac158d8e7 100644 --- a/src/tools/rust-analyzer/Cargo.toml +++ b/src/tools/rust-analyzer/Cargo.toml @@ -149,7 +149,7 @@ serde = { version = "1.0.219" } serde_derive = { version = "1.0.219" } serde_json = "1.0.140" rustc-hash = "2.1.1" -rustc-literal-escaper = "0.0.5" +rustc-literal-escaper = "0.0.4" smallvec = { version = "1.15.1", features = [ "const_new", "union", diff --git a/src/tools/rust-analyzer/crates/syntax/src/ast/token_ext.rs b/src/tools/rust-analyzer/crates/syntax/src/ast/token_ext.rs index 742c452616ef..4afdda78a0e7 100644 --- a/src/tools/rust-analyzer/crates/syntax/src/ast/token_ext.rs +++ b/src/tools/rust-analyzer/crates/syntax/src/ast/token_ext.rs @@ -309,8 +309,8 @@ impl ast::CString { let mut prev_end = 0; let mut has_error = None; let extend_unit = |buf: &mut Vec, unit: MixedUnit| match unit { - MixedUnit::Char(c) => buf.extend(c.get().encode_utf8(&mut [0; 4]).as_bytes()), - MixedUnit::HighByte(b) => buf.push(b.get()), + MixedUnit::Char(c) => buf.extend(c.encode_utf8(&mut [0; 4]).as_bytes()), + MixedUnit::HighByte(b) => buf.push(b), }; unescape_c_str(text, |char_range, unescaped| match (unescaped, buf.capacity() == 0) { (Ok(u), false) => extend_unit(&mut buf, u), From da90db796d0cf39658eac0074c63e5e9ffec2ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 21 Jul 2025 09:36:14 +0300 Subject: [PATCH 142/183] Downgrade ra-ap-rustc_parse_format --- src/tools/rust-analyzer/Cargo.lock | 37 +++++++++++++++++------------- src/tools/rust-analyzer/Cargo.toml | 2 +- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/tools/rust-analyzer/Cargo.lock b/src/tools/rust-analyzer/Cargo.lock index f3adc4006acf..c471234bbe3a 100644 --- a/src/tools/rust-analyzer/Cargo.lock +++ b/src/tools/rust-analyzer/Cargo.lock @@ -1268,7 +1268,7 @@ dependencies = [ "expect-test", "intern", "parser", - "ra-ap-rustc_lexer", + "ra-ap-rustc_lexer 0.122.0", "rustc-hash 2.1.1", "smallvec", "span", @@ -1504,8 +1504,8 @@ dependencies = [ "drop_bomb", "edition", "expect-test", - "ra-ap-rustc_lexer", - "rustc-literal-escaper 0.0.4", + "ra-ap-rustc_lexer 0.122.0", + "rustc-literal-escaper", "stdx", "tracing", ] @@ -1614,7 +1614,7 @@ dependencies = [ "object", "paths", "proc-macro-test", - "ra-ap-rustc_lexer", + "ra-ap-rustc_lexer 0.122.0", "span", "syntax-bridge", "tt", @@ -1796,6 +1796,17 @@ dependencies = [ "syn", ] +[[package]] +name = "ra-ap-rustc_lexer" +version = "0.121.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22944e31fb91e9b3e75bcbc91e37d958b8c0825a6160927f2856831d2ce83b36" +dependencies = [ + "memchr", + "unicode-properties", + "unicode-xid", +] + [[package]] name = "ra-ap-rustc_lexer" version = "0.122.0" @@ -1809,12 +1820,12 @@ dependencies = [ [[package]] name = "ra-ap-rustc_parse_format" -version = "0.122.0" +version = "0.121.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d2c4b48fa26e031b1cca0c8ca7433770f5e35e33da56da8636dae2cd45d4e1" +checksum = "81057891bc2063ad9e353f29462fbc47a0f5072560af34428ae9313aaa5e9d97" dependencies = [ - "ra-ap-rustc_lexer", - "rustc-literal-escaper 0.0.5", + "ra-ap-rustc_lexer 0.121.0", + "rustc-literal-escaper", ] [[package]] @@ -1972,12 +1983,6 @@ version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab03008eb631b703dd16978282ae36c73282e7922fe101a4bd072a40ecea7b8b" -[[package]] -name = "rustc-literal-escaper" -version = "0.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ee29da77c5a54f42697493cd4c9b9f31b74df666a6c04dfc4fde77abe0438b" - [[package]] name = "rustc-stable-hash" version = "0.1.2" @@ -2265,7 +2270,7 @@ dependencies = [ "rayon", "rowan", "rustc-hash 2.1.1", - "rustc-literal-escaper 0.0.4", + "rustc-literal-escaper", "rustc_apfloat", "smol_str", "stdx", @@ -2587,7 +2592,7 @@ version = "0.0.0" dependencies = [ "arrayvec", "intern", - "ra-ap-rustc_lexer", + "ra-ap-rustc_lexer 0.122.0", "stdx", "text-size", ] diff --git a/src/tools/rust-analyzer/Cargo.toml b/src/tools/rust-analyzer/Cargo.toml index b21ac158d8e7..700c116ec182 100644 --- a/src/tools/rust-analyzer/Cargo.toml +++ b/src/tools/rust-analyzer/Cargo.toml @@ -90,7 +90,7 @@ vfs = { path = "./crates/vfs", version = "0.0.0" } edition = { path = "./crates/edition", version = "0.0.0" } ra-ap-rustc_lexer = { version = "0.122", default-features = false } -ra-ap-rustc_parse_format = { version = "0.122", default-features = false } +ra-ap-rustc_parse_format = { version = "0.121", default-features = false } ra-ap-rustc_index = { version = "0.122", default-features = false } ra-ap-rustc_abi = { version = "0.122", default-features = false } ra-ap-rustc_pattern_analysis = { version = "0.122", default-features = false } From 1fd06975d0ea9d78d0b611ab292df7a121116501 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 21 Jul 2025 07:57:11 +0000 Subject: [PATCH 143/183] Remove Retag for Unique --- compiler/rustc_mir_transform/src/add_retag.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/rustc_mir_transform/src/add_retag.rs b/compiler/rustc_mir_transform/src/add_retag.rs index 3c29d4624b73..fc08c1df8703 100644 --- a/compiler/rustc_mir_transform/src/add_retag.rs +++ b/compiler/rustc_mir_transform/src/add_retag.rs @@ -4,7 +4,6 @@ //! of MIR building, and only after this pass we think of the program has having the //! normal MIR semantics. -use rustc_hir::LangItem; use rustc_middle::mir::*; use rustc_middle::ty::{self, Ty, TyCtxt}; @@ -28,7 +27,6 @@ fn may_contain_reference<'tcx>(ty: Ty<'tcx>, depth: u32, tcx: TyCtxt<'tcx>) -> b // References and Boxes (`noalias` sources) ty::Ref(..) => true, ty::Adt(..) if ty.is_box() => true, - ty::Adt(adt, _) if tcx.is_lang_item(adt.did(), LangItem::PtrUnique) => true, // Compound types: recurse ty::Array(ty, _) | ty::Slice(ty) => { // This does not branch so we keep the depth the same. From 74ba9cbae4306acf0f4ee34abb6762e05446abc4 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Mon, 21 Jul 2025 16:58:54 +0800 Subject: [PATCH 144/183] Don't use another main test file as auxiliary In this case, the exact extern crate isn't very important. This is part of the changes needed to address the spurious failures from a main test `../removing-extern-crate.rs` being both an auxiliary and a main test file, causing fs races due to multiple `rustc` processes in multiple test threads trying to build the main test file both as a main test and also as an auxiliary at around the same time. --- .../removing-extern-crate-malformed-cfg.fixed | 2 +- .../rust-2018/removing-extern-crate-malformed-cfg.rs | 6 +++--- .../removing-extern-crate-malformed-cfg.stderr | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed index 26c1c9015da8..028f86eb0a3e 100644 --- a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed +++ b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed @@ -1,5 +1,5 @@ //@ edition:2018 -//@ aux-build:../removing-extern-crate.rs +//@ aux-build: remove-extern-crate.rs //@ run-rustfix #![warn(rust_2018_idioms)] diff --git a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs index c5b629fa90b7..1acf531a6619 100644 --- a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs +++ b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs @@ -1,16 +1,16 @@ //@ edition:2018 -//@ aux-build:../removing-extern-crate.rs +//@ aux-build: remove-extern-crate.rs //@ run-rustfix #![warn(rust_2018_idioms)] #[cfg_attr(test, "macro_use")] //~ ERROR expected -extern crate removing_extern_crate as foo; //~ WARNING unused extern crate +extern crate remove_extern_crate as foo; //~ WARNING unused extern crate extern crate core; //~ WARNING unused extern crate mod another { #[cfg_attr(test)] //~ ERROR expected - extern crate removing_extern_crate as foo; //~ WARNING unused extern crate + extern crate remove_extern_crate as foo; //~ WARNING unused extern crate extern crate core; //~ WARNING unused extern crate } diff --git a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr index 0e834707bf9b..632ecd623221 100644 --- a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr +++ b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr @@ -19,8 +19,8 @@ LL | #[cfg_attr(test)] warning: unused extern crate --> $DIR/removing-extern-crate-malformed-cfg.rs:8:1 | -LL | extern crate removing_extern_crate as foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused +LL | extern crate remove_extern_crate as foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused | note: the lint level is defined here --> $DIR/removing-extern-crate-malformed-cfg.rs:5:9 @@ -31,7 +31,7 @@ LL | #![warn(rust_2018_idioms)] help: remove the unused `extern crate` | LL - #[cfg_attr(test, "macro_use")] -LL - extern crate removing_extern_crate as foo; +LL - extern crate remove_extern_crate as foo; LL + | @@ -50,13 +50,13 @@ LL + warning: unused extern crate --> $DIR/removing-extern-crate-malformed-cfg.rs:13:5 | -LL | extern crate removing_extern_crate as foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused +LL | extern crate remove_extern_crate as foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused | help: remove the unused `extern crate` | LL - #[cfg_attr(test)] -LL - extern crate removing_extern_crate as foo; +LL - extern crate remove_extern_crate as foo; LL + | From 3c76e3d0026ea9904358b1614bbd9c4f8b7cedf5 Mon Sep 17 00:00:00 2001 From: Evgenii Zheltonozhskii Date: Mon, 21 Jul 2025 12:49:45 +0300 Subject: [PATCH 145/183] Constify Try, From, TryFrom --- library/core/src/array/mod.rs | 3 +- library/core/src/ascii/ascii_char.rs | 3 +- library/core/src/char/convert.rs | 15 ++++--- library/core/src/convert/mod.rs | 40 ++++++++++++------ library/core/src/convert/num.rs | 24 +++++++---- library/core/src/net/ip_addr.rs | 36 ++++++++++------ library/core/src/net/socket_addr.rs | 9 ++-- library/core/src/num/error.rs | 6 ++- library/core/src/num/mod.rs | 3 +- library/core/src/num/nonzero.rs | 3 +- library/core/src/ops/try_trait.rs | 8 +++- library/core/src/option.rs | 28 +++++++++---- library/core/src/ptr/alignment.rs | 6 ++- library/core/src/result.rs | 26 ++++++++---- library/core/src/str/traits.rs | 2 + library/core/src/sync/atomic.rs | 6 ++- tests/ui/consts/const-try-feature-gate.rs | 2 + tests/ui/consts/const-try-feature-gate.stderr | 36 ++++++++++++++-- tests/ui/consts/const-try.rs | 8 ++-- tests/ui/consts/const-try.stderr | 37 ---------------- tests/ui/consts/control-flow/try.rs | 9 ++-- tests/ui/consts/control-flow/try.stderr | 19 --------- tests/ui/consts/try-operator.rs | 3 +- tests/ui/consts/try-operator.stderr | 42 ------------------- .../ui/traits/const-traits/hir-const-check.rs | 4 +- .../const-traits/hir-const-check.stderr | 19 --------- .../ice-119717-constant-lifetime.rs | 5 +-- .../ice-119717-constant-lifetime.stderr | 13 +----- .../ice-126148-failed-to-normalize.rs | 8 +--- .../ice-126148-failed-to-normalize.stderr | 41 ++---------------- .../trait-default-body-stability.rs | 2 +- .../trait-default-body-stability.stderr | 37 ---------------- 32 files changed, 204 insertions(+), 299 deletions(-) delete mode 100644 tests/ui/consts/const-try.stderr delete mode 100644 tests/ui/consts/control-flow/try.stderr delete mode 100644 tests/ui/consts/try-operator.stderr delete mode 100644 tests/ui/traits/const-traits/hir-const-check.stderr delete mode 100644 tests/ui/traits/const-traits/trait-default-body-stability.stderr diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 62203e132b70..1c23218552aa 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -198,7 +198,8 @@ impl Error for TryFromSliceError { } #[stable(feature = "try_from_slice_error", since = "1.36.0")] -impl From for TryFromSliceError { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for TryFromSliceError { fn from(x: Infallible) -> TryFromSliceError { match x {} } diff --git a/library/core/src/ascii/ascii_char.rs b/library/core/src/ascii/ascii_char.rs index 0b72b4780f16..054ddf844700 100644 --- a/library/core/src/ascii/ascii_char.rs +++ b/library/core/src/ascii/ascii_char.rs @@ -546,7 +546,8 @@ macro_rules! into_int_impl { ($($ty:ty)*) => { $( #[unstable(feature = "ascii_char", issue = "110998")] - impl From for $ty { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const From for $ty { #[inline] fn from(chr: AsciiChar) -> $ty { chr as u8 as $ty diff --git a/library/core/src/char/convert.rs b/library/core/src/char/convert.rs index 78cd89fefae7..23061cb663bc 100644 --- a/library/core/src/char/convert.rs +++ b/library/core/src/char/convert.rs @@ -36,7 +36,8 @@ pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char { } #[stable(feature = "char_convert", since = "1.13.0")] -impl From for u32 { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for u32 { /// Converts a [`char`] into a [`u32`]. /// /// # Examples @@ -53,7 +54,8 @@ impl From for u32 { } #[stable(feature = "more_char_conversions", since = "1.51.0")] -impl From for u64 { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for u64 { /// Converts a [`char`] into a [`u64`]. /// /// # Examples @@ -72,7 +74,8 @@ impl From for u64 { } #[stable(feature = "more_char_conversions", since = "1.51.0")] -impl From for u128 { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for u128 { /// Converts a [`char`] into a [`u128`]. /// /// # Examples @@ -157,7 +160,8 @@ impl TryFrom for u16 { /// for a superset of Windows-1252 that fills the remaining blanks with corresponding /// C0 and C1 control codes. #[stable(feature = "char_convert", since = "1.13.0")] -impl From for char { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for char { /// Converts a [`u8`] into a [`char`]. /// /// # Examples @@ -247,7 +251,8 @@ const fn char_try_from_u32(i: u32) -> Result { } #[stable(feature = "try_from", since = "1.34.0")] -impl TryFrom for char { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const TryFrom for char { type Error = CharTryFromError; #[inline] diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 38381dbdf230..220a24caf09e 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -216,6 +216,8 @@ pub const fn identity(x: T) -> T { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "AsRef"] +#[const_trait] +#[rustc_const_unstable(feature = "const_try", issue = "74935")] pub trait AsRef: PointeeSized { /// Converts this type into a shared reference of the (usually inferred) input type. #[stable(feature = "rust1", since = "1.0.0")] @@ -367,6 +369,8 @@ pub trait AsRef: PointeeSized { /// `&mut Vec`, for example, is the better choice (callers need to pass the correct type then). #[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "AsMut"] +#[const_trait] +#[rustc_const_unstable(feature = "const_try", issue = "74935")] pub trait AsMut: PointeeSized { /// Converts this type into a mutable reference of the (usually inferred) input type. #[stable(feature = "rust1", since = "1.0.0")] @@ -710,9 +714,10 @@ pub trait TryFrom: Sized { // As lifts over & #[stable(feature = "rust1", since = "1.0.0")] -impl AsRef for &T +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const AsRef for &T where - T: AsRef, + T: ~const AsRef, { #[inline] fn as_ref(&self) -> &U { @@ -722,9 +727,10 @@ where // As lifts over &mut #[stable(feature = "rust1", since = "1.0.0")] -impl AsRef for &mut T +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const AsRef for &mut T where - T: AsRef, + T: ~const AsRef, { #[inline] fn as_ref(&self) -> &U { @@ -742,9 +748,10 @@ where // AsMut lifts over &mut #[stable(feature = "rust1", since = "1.0.0")] -impl AsMut for &mut T +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const AsMut for &mut T where - T: AsMut, + T: ~const AsMut, { #[inline] fn as_mut(&mut self) -> &mut U { @@ -840,7 +847,8 @@ where //////////////////////////////////////////////////////////////////////////////// #[stable(feature = "rust1", since = "1.0.0")] -impl AsRef<[T]> for [T] { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const AsRef<[T]> for [T] { #[inline(always)] fn as_ref(&self) -> &[T] { self @@ -848,7 +856,8 @@ impl AsRef<[T]> for [T] { } #[stable(feature = "rust1", since = "1.0.0")] -impl AsMut<[T]> for [T] { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const AsMut<[T]> for [T] { #[inline(always)] fn as_mut(&mut self) -> &mut [T] { self @@ -856,7 +865,8 @@ impl AsMut<[T]> for [T] { } #[stable(feature = "rust1", since = "1.0.0")] -impl AsRef for str { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const AsRef for str { #[inline(always)] fn as_ref(&self) -> &str { self @@ -864,7 +874,8 @@ impl AsRef for str { } #[stable(feature = "as_mut_str_for_str", since = "1.51.0")] -impl AsMut for str { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const AsMut for str { #[inline(always)] fn as_mut(&mut self) -> &mut str { self @@ -925,7 +936,8 @@ impl AsMut for str { pub enum Infallible {} #[stable(feature = "convert_infallible", since = "1.34.0")] -impl Clone for Infallible { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const Clone for Infallible { fn clone(&self) -> Infallible { match *self {} } @@ -953,7 +965,8 @@ impl Error for Infallible { } #[stable(feature = "convert_infallible", since = "1.34.0")] -impl PartialEq for Infallible { +#[rustc_const_unstable(feature = "const_cmp", issue = "143800")] +impl const PartialEq for Infallible { fn eq(&self, _: &Infallible) -> bool { match *self {} } @@ -977,7 +990,8 @@ impl Ord for Infallible { } #[stable(feature = "convert_infallible", since = "1.34.0")] -impl From for Infallible { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for Infallible { #[inline] fn from(x: !) -> Self { x diff --git a/library/core/src/convert/num.rs b/library/core/src/convert/num.rs index 50616732b777..affb4eb64d39 100644 --- a/library/core/src/convert/num.rs +++ b/library/core/src/convert/num.rs @@ -69,7 +69,8 @@ macro_rules! impl_from { }; ($Small:ty => $Large:ty, #[$attr:meta], $doc:expr $(,)?) => { #[$attr] - impl From<$Small> for $Large { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const From<$Small> for $Large { // Rustdocs on the impl block show a "[+] show undocumented items" toggle. // Rustdocs on functions do not. #[doc = $doc] @@ -200,7 +201,8 @@ macro_rules! impl_float_from_bool { )? ) => { #[stable(feature = "float_from_bool", since = "1.68.0")] - impl From for $float { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const From for $float { #[doc = concat!("Converts a [`bool`] to [`", stringify!($float),"`] losslessly.")] /// The resulting value is positive `0.0` for `false` and `1.0` for `true` values. /// @@ -250,7 +252,8 @@ impl_float_from_bool!( macro_rules! impl_try_from_unbounded { ($source:ty => $($target:ty),+) => {$( #[stable(feature = "try_from", since = "1.34.0")] - impl TryFrom<$source> for $target { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const TryFrom<$source> for $target { type Error = TryFromIntError; /// Tries to create the target number type from a source @@ -268,7 +271,8 @@ macro_rules! impl_try_from_unbounded { macro_rules! impl_try_from_lower_bounded { ($source:ty => $($target:ty),+) => {$( #[stable(feature = "try_from", since = "1.34.0")] - impl TryFrom<$source> for $target { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const TryFrom<$source> for $target { type Error = TryFromIntError; /// Tries to create the target number type from a source @@ -290,7 +294,8 @@ macro_rules! impl_try_from_lower_bounded { macro_rules! impl_try_from_upper_bounded { ($source:ty => $($target:ty),+) => {$( #[stable(feature = "try_from", since = "1.34.0")] - impl TryFrom<$source> for $target { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const TryFrom<$source> for $target { type Error = TryFromIntError; /// Tries to create the target number type from a source @@ -312,7 +317,8 @@ macro_rules! impl_try_from_upper_bounded { macro_rules! impl_try_from_both_bounded { ($source:ty => $($target:ty),+) => {$( #[stable(feature = "try_from", since = "1.34.0")] - impl TryFrom<$source> for $target { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const TryFrom<$source> for $target { type Error = TryFromIntError; /// Tries to create the target number type from a source @@ -450,7 +456,8 @@ use crate::num::NonZero; macro_rules! impl_nonzero_int_from_nonzero_int { ($Small:ty => $Large:ty) => { #[stable(feature = "nz_int_conv", since = "1.41.0")] - impl From> for NonZero<$Large> { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const From> for NonZero<$Large> { // Rustdocs on the impl block show a "[+] show undocumented items" toggle. // Rustdocs on functions do not. #[doc = concat!("Converts [NonZero]\\<[", stringify!($Small), "]> ")] @@ -540,7 +547,8 @@ impl_nonzero_int_try_from_int!(isize); macro_rules! impl_nonzero_int_try_from_nonzero_int { ($source:ty => $($target:ty),+) => {$( #[stable(feature = "nzint_try_from_nzint_conv", since = "1.49.0")] - impl TryFrom> for NonZero<$target> { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const TryFrom> for NonZero<$target> { type Error = TryFromIntError; // Rustdocs on the impl block show a "[+] show undocumented items" toggle. diff --git a/library/core/src/net/ip_addr.rs b/library/core/src/net/ip_addr.rs index aaa68e8d7d1a..fef987153cb5 100644 --- a/library/core/src/net/ip_addr.rs +++ b/library/core/src/net/ip_addr.rs @@ -1089,7 +1089,8 @@ impl fmt::Debug for IpAddr { } #[stable(feature = "ip_from_ip", since = "1.16.0")] -impl From for IpAddr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for IpAddr { /// Copies this address to a new `IpAddr::V4`. /// /// # Examples @@ -1111,7 +1112,8 @@ impl From for IpAddr { } #[stable(feature = "ip_from_ip", since = "1.16.0")] -impl From for IpAddr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for IpAddr { /// Copies this address to a new `IpAddr::V6`. /// /// # Examples @@ -1221,7 +1223,8 @@ impl Ord for Ipv4Addr { } #[stable(feature = "ip_u32", since = "1.1.0")] -impl From for u32 { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for u32 { /// Uses [`Ipv4Addr::to_bits`] to convert an IPv4 address to a host byte order `u32`. #[inline] fn from(ip: Ipv4Addr) -> u32 { @@ -1230,7 +1233,8 @@ impl From for u32 { } #[stable(feature = "ip_u32", since = "1.1.0")] -impl From for Ipv4Addr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for Ipv4Addr { /// Uses [`Ipv4Addr::from_bits`] to convert a host byte order `u32` into an IPv4 address. #[inline] fn from(ip: u32) -> Ipv4Addr { @@ -1239,7 +1243,8 @@ impl From for Ipv4Addr { } #[stable(feature = "from_slice_v4", since = "1.9.0")] -impl From<[u8; 4]> for Ipv4Addr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From<[u8; 4]> for Ipv4Addr { /// Creates an `Ipv4Addr` from a four element byte array. /// /// # Examples @@ -1257,7 +1262,8 @@ impl From<[u8; 4]> for Ipv4Addr { } #[stable(feature = "ip_from_slice", since = "1.17.0")] -impl From<[u8; 4]> for IpAddr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From<[u8; 4]> for IpAddr { /// Creates an `IpAddr::V4` from a four element byte array. /// /// # Examples @@ -2211,7 +2217,8 @@ impl Ord for Ipv6Addr { } #[stable(feature = "i128", since = "1.26.0")] -impl From for u128 { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for u128 { /// Uses [`Ipv6Addr::to_bits`] to convert an IPv6 address to a host byte order `u128`. #[inline] fn from(ip: Ipv6Addr) -> u128 { @@ -2219,7 +2226,8 @@ impl From for u128 { } } #[stable(feature = "i128", since = "1.26.0")] -impl From for Ipv6Addr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for Ipv6Addr { /// Uses [`Ipv6Addr::from_bits`] to convert a host byte order `u128` to an IPv6 address. #[inline] fn from(ip: u128) -> Ipv6Addr { @@ -2228,7 +2236,8 @@ impl From for Ipv6Addr { } #[stable(feature = "ipv6_from_octets", since = "1.9.0")] -impl From<[u8; 16]> for Ipv6Addr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From<[u8; 16]> for Ipv6Addr { /// Creates an `Ipv6Addr` from a sixteen element byte array. /// /// # Examples @@ -2255,7 +2264,8 @@ impl From<[u8; 16]> for Ipv6Addr { } #[stable(feature = "ipv6_from_segments", since = "1.16.0")] -impl From<[u16; 8]> for Ipv6Addr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From<[u16; 8]> for Ipv6Addr { /// Creates an `Ipv6Addr` from an eight element 16-bit array. /// /// # Examples @@ -2283,7 +2293,8 @@ impl From<[u16; 8]> for Ipv6Addr { } #[stable(feature = "ip_from_slice", since = "1.17.0")] -impl From<[u8; 16]> for IpAddr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From<[u8; 16]> for IpAddr { /// Creates an `IpAddr::V6` from a sixteen element byte array. /// /// # Examples @@ -2310,7 +2321,8 @@ impl From<[u8; 16]> for IpAddr { } #[stable(feature = "ip_from_slice", since = "1.17.0")] -impl From<[u16; 8]> for IpAddr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From<[u16; 8]> for IpAddr { /// Creates an `IpAddr::V6` from an eight element 16-bit array. /// /// # Examples diff --git a/library/core/src/net/socket_addr.rs b/library/core/src/net/socket_addr.rs index 936f9f64930d..69924199f99f 100644 --- a/library/core/src/net/socket_addr.rs +++ b/library/core/src/net/socket_addr.rs @@ -592,7 +592,8 @@ impl SocketAddrV6 { } #[stable(feature = "ip_from_ip", since = "1.16.0")] -impl From for SocketAddr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for SocketAddr { /// Converts a [`SocketAddrV4`] into a [`SocketAddr::V4`]. #[inline] fn from(sock4: SocketAddrV4) -> SocketAddr { @@ -601,7 +602,8 @@ impl From for SocketAddr { } #[stable(feature = "ip_from_ip", since = "1.16.0")] -impl From for SocketAddr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for SocketAddr { /// Converts a [`SocketAddrV6`] into a [`SocketAddr::V6`]. #[inline] fn from(sock6: SocketAddrV6) -> SocketAddr { @@ -610,7 +612,8 @@ impl From for SocketAddr { } #[stable(feature = "addr_from_into_ip", since = "1.17.0")] -impl> From<(I, u16)> for SocketAddr { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl> const From<(I, u16)> for SocketAddr { /// Converts a tuple struct (Into<[`IpAddr`]>, `u16`) into a [`SocketAddr`]. /// /// This conversion creates a [`SocketAddr::V4`] for an [`IpAddr::V4`] diff --git a/library/core/src/num/error.rs b/library/core/src/num/error.rs index f9c4cdd0ebe6..cfedd465cab0 100644 --- a/library/core/src/num/error.rs +++ b/library/core/src/num/error.rs @@ -26,14 +26,16 @@ impl Error for TryFromIntError { } #[stable(feature = "try_from", since = "1.34.0")] -impl From for TryFromIntError { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for TryFromIntError { fn from(x: Infallible) -> TryFromIntError { match x {} } } #[unstable(feature = "never_type", issue = "35121")] -impl From for TryFromIntError { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for TryFromIntError { #[inline] fn from(never: !) -> TryFromIntError { // Match rather than coerce to make sure that code like diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index faa41ddf13ca..acfe38b7a37b 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -1378,7 +1378,8 @@ const fn from_ascii_radix_panic(radix: u32) -> ! { macro_rules! from_str_int_impl { ($signedness:ident $($int_ty:ty)+) => {$( #[stable(feature = "rust1", since = "1.0.0")] - impl FromStr for $int_ty { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const FromStr for $int_ty { type Err = ParseIntError; /// Parses an integer from a string slice with decimal digits. diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index b8900c4113ad..f793602de508 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -297,7 +297,8 @@ where } #[stable(feature = "from_nonzero", since = "1.31.0")] -impl From> for T +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From> for T where T: ZeroablePrimitive, { diff --git a/library/core/src/ops/try_trait.rs b/library/core/src/ops/try_trait.rs index aebbddb4f1c0..a889c824be53 100644 --- a/library/core/src/ops/try_trait.rs +++ b/library/core/src/ops/try_trait.rs @@ -128,7 +128,9 @@ use crate::ops::ControlFlow; )] #[doc(alias = "?")] #[lang = "Try"] -pub trait Try: FromResidual { +#[const_trait] +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +pub trait Try: ~const FromResidual { /// The type of the value produced by `?` when *not* short-circuiting. #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] type Output; @@ -304,6 +306,8 @@ pub trait Try: FromResidual { )] #[rustc_diagnostic_item = "FromResidual"] #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] +#[const_trait] +#[rustc_const_unstable(feature = "const_try", issue = "74935")] pub trait FromResidual::Residual> { /// Constructs the type from a compatible `Residual` type. /// @@ -357,6 +361,8 @@ where /// and in the other direction, /// ` as Residual>::TryType = Result`. #[unstable(feature = "try_trait_v2_residual", issue = "91285")] +#[const_trait] +#[rustc_const_unstable(feature = "const_try", issue = "74935")] pub trait Residual { /// The "return" type of this meta-function. #[unstable(feature = "try_trait_v2_residual", issue = "91285")] diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 8036c59e893a..7f8c30b95b20 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -2144,9 +2144,12 @@ const fn expect_failed(msg: &str) -> ! { ///////////////////////////////////////////////////////////////////////////// #[stable(feature = "rust1", since = "1.0.0")] -impl Clone for Option +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const Clone for Option where - T: Clone, + // FIXME(const_hack): the T: ~const Destruct should be inferred from the Self: ~const Destruct in clone_from. + // See https://github.com/rust-lang/rust/issues/144207 + T: ~const Clone + ~const Destruct, { #[inline] fn clone(&self) -> Self { @@ -2230,7 +2233,8 @@ impl<'a, T> IntoIterator for &'a mut Option { } #[stable(since = "1.12.0", feature = "option_from")] -impl From for Option { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for Option { /// Moves `val` into a new [`Some`]. /// /// # Examples @@ -2246,7 +2250,8 @@ impl From for Option { } #[stable(feature = "option_ref_from_ref_option", since = "1.30.0")] -impl<'a, T> From<&'a Option> for Option<&'a T> { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl<'a, T> const From<&'a Option> for Option<&'a T> { /// Converts from `&Option` to `Option<&T>`. /// /// # Examples @@ -2273,7 +2278,8 @@ impl<'a, T> From<&'a Option> for Option<&'a T> { } #[stable(feature = "option_ref_from_ref_option", since = "1.30.0")] -impl<'a, T> From<&'a mut Option> for Option<&'a mut T> { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl<'a, T> const From<&'a mut Option> for Option<&'a mut T> { /// Converts from `&mut Option` to `Option<&mut T>` /// /// # Examples @@ -2593,7 +2599,8 @@ impl> FromIterator> for Option { } #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] -impl ops::Try for Option { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const ops::Try for Option { type Output = T; type Residual = Option; @@ -2612,9 +2619,10 @@ impl ops::Try for Option { } #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] +#[rustc_const_unstable(feature = "const_try", issue = "74935")] // Note: manually specifying the residual type instead of using the default to work around // https://github.com/rust-lang/rust/issues/99940 -impl ops::FromResidual> for Option { +impl const ops::FromResidual> for Option { #[inline] fn from_residual(residual: Option) -> Self { match residual { @@ -2625,7 +2633,8 @@ impl ops::FromResidual> for Option { #[diagnostic::do_not_recommend] #[unstable(feature = "try_trait_v2_yeet", issue = "96374")] -impl ops::FromResidual> for Option { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const ops::FromResidual> for Option { #[inline] fn from_residual(ops::Yeet(()): ops::Yeet<()>) -> Self { None @@ -2633,7 +2642,8 @@ impl ops::FromResidual> for Option { } #[unstable(feature = "try_trait_v2_residual", issue = "91285")] -impl ops::Residual for Option { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const ops::Residual for Option { type TryType = Option; } diff --git a/library/core/src/ptr/alignment.rs b/library/core/src/ptr/alignment.rs index 6d473a4bd566..bd5b4e21baa0 100644 --- a/library/core/src/ptr/alignment.rs +++ b/library/core/src/ptr/alignment.rs @@ -189,7 +189,8 @@ impl TryFrom for Alignment { } #[unstable(feature = "ptr_alignment_type", issue = "102070")] -impl From for NonZero { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for NonZero { #[inline] fn from(align: Alignment) -> NonZero { align.as_nonzero() @@ -197,7 +198,8 @@ impl From for NonZero { } #[unstable(feature = "ptr_alignment_type", issue = "102070")] -impl From for usize { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for usize { #[inline] fn from(align: Alignment) -> usize { align.as_usize() diff --git a/library/core/src/result.rs b/library/core/src/result.rs index 7f3f29649854..f65257ff59b9 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -1288,9 +1288,11 @@ impl Result { /// ``` #[unstable(feature = "unwrap_infallible", reason = "newly added", issue = "61695")] #[inline] - pub fn into_ok(self) -> T + #[rustc_allow_const_fn_unstable(const_precise_live_drops)] + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + pub const fn into_ok(self) -> T where - E: Into, + E: ~const Into, { match self { Ok(x) => x, @@ -1323,9 +1325,11 @@ impl Result { /// ``` #[unstable(feature = "unwrap_infallible", reason = "newly added", issue = "61695")] #[inline] - pub fn into_err(self) -> E + #[rustc_allow_const_fn_unstable(const_precise_live_drops)] + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + pub const fn into_err(self) -> E where - T: Into, + T: ~const Into, { match self { Ok(x) => x.into(), @@ -2052,7 +2056,8 @@ impl> FromIterator> for Result { } #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] -impl ops::Try for Result { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const ops::Try for Result { type Output = T; type Residual = Result; @@ -2071,7 +2076,10 @@ impl ops::Try for Result { } #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] -impl> ops::FromResidual> for Result { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl> const ops::FromResidual> + for Result +{ #[inline] #[track_caller] fn from_residual(residual: Result) -> Self { @@ -2082,7 +2090,8 @@ impl> ops::FromResidual> for Res } #[diagnostic::do_not_recommend] #[unstable(feature = "try_trait_v2_yeet", issue = "96374")] -impl> ops::FromResidual> for Result { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl> const ops::FromResidual> for Result { #[inline] fn from_residual(ops::Yeet(e): ops::Yeet) -> Self { Err(From::from(e)) @@ -2090,6 +2099,7 @@ impl> ops::FromResidual> for Result { } #[unstable(feature = "try_trait_v2_residual", issue = "91285")] -impl ops::Residual for Result { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const ops::Residual for Result { type TryType = Result; } diff --git a/library/core/src/str/traits.rs b/library/core/src/str/traits.rs index d0f2b9226bf6..1597d1c1fa86 100644 --- a/library/core/src/str/traits.rs +++ b/library/core/src/str/traits.rs @@ -825,6 +825,8 @@ unsafe impl const SliceIndex for ops::RangeToInclusive { /// assert!(Point::from_str("(1 2)").is_err()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] +#[const_trait] +#[rustc_const_unstable(feature = "const_try", issue = "74935")] pub trait FromStr: Sized { /// The associated error which can be returned from parsing. #[stable(feature = "rust1", since = "1.0.0")] diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs index 04c8d1473b04..546f3d91a809 100644 --- a/library/core/src/sync/atomic.rs +++ b/library/core/src/sync/atomic.rs @@ -2518,7 +2518,8 @@ impl AtomicPtr { #[cfg(target_has_atomic_load_store = "8")] #[stable(feature = "atomic_bool_from", since = "1.24.0")] -impl From for AtomicBool { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const From for AtomicBool { /// Converts a `bool` into an `AtomicBool`. /// /// # Examples @@ -2615,7 +2616,8 @@ macro_rules! atomic_int { } #[$stable_from] - impl From<$int_type> for $atomic_type { + #[rustc_const_unstable(feature = "const_try", issue = "74935")] + impl const From<$int_type> for $atomic_type { #[doc = concat!("Converts an `", stringify!($int_type), "` into an `", stringify!($atomic_type), "`.")] #[inline] fn from(v: $int_type) -> Self { Self::new(v) } diff --git a/tests/ui/consts/const-try-feature-gate.rs b/tests/ui/consts/const-try-feature-gate.rs index 09985079e8e8..4a98185a18a7 100644 --- a/tests/ui/consts/const-try-feature-gate.rs +++ b/tests/ui/consts/const-try-feature-gate.rs @@ -4,6 +4,8 @@ const fn t() -> Option<()> { Some(())?; //~^ ERROR `?` is not allowed //~| ERROR `?` is not allowed + //~| ERROR `Try` is not yet stable as a const trait + //~| ERROR `FromResidual` is not yet stable as a const trait None } diff --git a/tests/ui/consts/const-try-feature-gate.stderr b/tests/ui/consts/const-try-feature-gate.stderr index 0ad19d05b382..62a4a5fba4ff 100644 --- a/tests/ui/consts/const-try-feature-gate.stderr +++ b/tests/ui/consts/const-try-feature-gate.stderr @@ -1,19 +1,47 @@ -error[E0015]: `?` is not allowed on `Option<()>` in constant functions +error[E0658]: `?` is not allowed on `Option<()>` in constant functions --> $DIR/const-try-feature-gate.rs:4:5 | LL | Some(())?; | ^^^^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants + = note: see issue #143874 for more information + = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0015]: `?` is not allowed on `Option<()>` in constant functions +error: `Try` is not yet stable as a const trait + --> $DIR/const-try-feature-gate.rs:4:5 + | +LL | Some(())?; + | ^^^^^^^^^ + | +help: add `#![feature(const_try)]` to the crate attributes to enable + | +LL + #![feature(const_try)] + | + +error[E0658]: `?` is not allowed on `Option<()>` in constant functions --> $DIR/const-try-feature-gate.rs:4:5 | LL | Some(())?; | ^^^^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants + = note: see issue #143874 for more information + = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: aborting due to 2 previous errors +error: `FromResidual` is not yet stable as a const trait + --> $DIR/const-try-feature-gate.rs:4:5 + | +LL | Some(())?; + | ^^^^^^^^^ + | +help: add `#![feature(const_try)]` to the crate attributes to enable + | +LL + #![feature(const_try)] + | -For more information about this error, try `rustc --explain E0015`. +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/consts/const-try.rs b/tests/ui/consts/const-try.rs index e13fad78441d..152400d702ec 100644 --- a/tests/ui/consts/const-try.rs +++ b/tests/ui/consts/const-try.rs @@ -1,4 +1,6 @@ -//@ compile-flags: -Znext-solver +//@ check-pass +//@ revisions: current next +//@[next] compile-flags: -Znext-solver // Demonstrates what's needed to make use of `?` in const contexts. @@ -13,14 +15,12 @@ struct TryMe; struct Error; impl const FromResidual for TryMe { - //~^ ERROR const `impl` for trait `FromResidual` which is not `const` fn from_residual(residual: Error) -> Self { TryMe } } impl const Try for TryMe { - //~^ ERROR const `impl` for trait `Try` which is not `const` type Output = (); type Residual = Error; fn from_output(output: Self::Output) -> Self { @@ -33,8 +33,6 @@ impl const Try for TryMe { const fn t() -> TryMe { TryMe?; - //~^ ERROR `?` is not allowed on - //~| ERROR `?` is not allowed on TryMe } diff --git a/tests/ui/consts/const-try.stderr b/tests/ui/consts/const-try.stderr deleted file mode 100644 index 7004ea3e6dbb..000000000000 --- a/tests/ui/consts/const-try.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error: const `impl` for trait `FromResidual` which is not `const` - --> $DIR/const-try.rs:15:12 - | -LL | impl const FromResidual for TryMe { - | ^^^^^^^^^^^^^^^^^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `Try` which is not `const` - --> $DIR/const-try.rs:22:12 - | -LL | impl const Try for TryMe { - | ^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error[E0015]: `?` is not allowed on `TryMe` in constant functions - --> $DIR/const-try.rs:35:5 - | -LL | TryMe?; - | ^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `TryMe` in constant functions - --> $DIR/const-try.rs:35:5 - | -LL | TryMe?; - | ^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/control-flow/try.rs b/tests/ui/consts/control-flow/try.rs index 67083e1a39b5..6d762f9194e6 100644 --- a/tests/ui/consts/control-flow/try.rs +++ b/tests/ui/consts/control-flow/try.rs @@ -1,11 +1,12 @@ -// The `?` operator is still not const-evaluatable because it calls `From::from` on the error -// variant. +//@ check-pass + +#![allow(dead_code)] +#![feature(const_trait_impl)] +#![feature(const_try)] const fn opt() -> Option { let x = Some(2); x?; - //~^ ERROR: `?` is not allowed - //~| ERROR: `?` is not allowed None } diff --git a/tests/ui/consts/control-flow/try.stderr b/tests/ui/consts/control-flow/try.stderr deleted file mode 100644 index 62a3e3ce6bc3..000000000000 --- a/tests/ui/consts/control-flow/try.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0015]: `?` is not allowed on `Option` in constant functions - --> $DIR/try.rs:6:5 - | -LL | x?; - | ^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `Option` in constant functions - --> $DIR/try.rs:6:5 - | -LL | x?; - | ^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/try-operator.rs b/tests/ui/consts/try-operator.rs index 352dbeefa8a6..59d9fcb1cbdb 100644 --- a/tests/ui/consts/try-operator.rs +++ b/tests/ui/consts/try-operator.rs @@ -1,9 +1,8 @@ -//@ known-bug: #110395 +//@ run-pass #![feature(try_trait_v2)] #![feature(const_trait_impl)] #![feature(const_try)] -#![feature(const_convert)] fn main() { const fn result() -> Result { diff --git a/tests/ui/consts/try-operator.stderr b/tests/ui/consts/try-operator.stderr deleted file mode 100644 index fc37039d2606..000000000000 --- a/tests/ui/consts/try-operator.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error[E0635]: unknown feature `const_convert` - --> $DIR/try-operator.rs:6:12 - | -LL | #![feature(const_convert)] - | ^^^^^^^^^^^^^ - -error[E0015]: `?` is not allowed on `Result<(), ()>` in constant functions - --> $DIR/try-operator.rs:10:9 - | -LL | Err(())?; - | ^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `Result` in constant functions - --> $DIR/try-operator.rs:10:9 - | -LL | Err(())?; - | ^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `Option<()>` in constant functions - --> $DIR/try-operator.rs:18:9 - | -LL | None?; - | ^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `Option<()>` in constant functions - --> $DIR/try-operator.rs:18:9 - | -LL | None?; - | ^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0015, E0635. -For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/traits/const-traits/hir-const-check.rs b/tests/ui/traits/const-traits/hir-const-check.rs index c485fb121841..1b6fa1afab9f 100644 --- a/tests/ui/traits/const-traits/hir-const-check.rs +++ b/tests/ui/traits/const-traits/hir-const-check.rs @@ -1,8 +1,10 @@ +//@ check-pass //@ compile-flags: -Znext-solver // Regression test for #69615. #![feature(const_trait_impl)] +#![feature(const_try)] #[const_trait] pub trait MyTrait { @@ -12,8 +14,6 @@ pub trait MyTrait { impl const MyTrait for () { fn method(&self) -> Option<()> { Some(())?; - //~^ ERROR `?` is not allowed on - //~| ERROR `?` is not allowed on None } } diff --git a/tests/ui/traits/const-traits/hir-const-check.stderr b/tests/ui/traits/const-traits/hir-const-check.stderr deleted file mode 100644 index d66a7ea31449..000000000000 --- a/tests/ui/traits/const-traits/hir-const-check.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0015]: `?` is not allowed on `Option<()>` in constant functions - --> $DIR/hir-const-check.rs:14:9 - | -LL | Some(())?; - | ^^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `Option<()>` in constant functions - --> $DIR/hir-const-check.rs:14:9 - | -LL | Some(())?; - | ^^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs b/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs index 47c85980aca0..af552ac0c5e7 100644 --- a/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs +++ b/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs @@ -1,11 +1,10 @@ #![allow(incomplete_features)] -#![feature(const_trait_impl, try_trait_v2)] +#![feature(const_trait_impl, const_try, try_trait_v2)] use std::ops::FromResidual; impl const FromResidual for T { - //~^ ERROR const `impl` for trait `FromResidual` which is not `const` - //~| ERROR type parameter `T` must be used as the type parameter for some local type + //~^ ERROR type parameter `T` must be used as the type parameter for some local type fn from_residual(t: T) -> _ { //~^ ERROR the placeholder `_` is not allowed t diff --git a/tests/ui/traits/const-traits/ice-119717-constant-lifetime.stderr b/tests/ui/traits/const-traits/ice-119717-constant-lifetime.stderr index 5c5fba95f024..08fc73fe77b4 100644 --- a/tests/ui/traits/const-traits/ice-119717-constant-lifetime.stderr +++ b/tests/ui/traits/const-traits/ice-119717-constant-lifetime.stderr @@ -1,12 +1,3 @@ -error: const `impl` for trait `FromResidual` which is not `const` - --> $DIR/ice-119717-constant-lifetime.rs:6:15 - | -LL | impl const FromResidual for T { - | ^^^^^^^^^^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) --> $DIR/ice-119717-constant-lifetime.rs:6:6 | @@ -17,7 +8,7 @@ LL | impl const FromResidual for T { = note: only traits defined in the current crate can be implemented for a type parameter error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated functions - --> $DIR/ice-119717-constant-lifetime.rs:9:31 + --> $DIR/ice-119717-constant-lifetime.rs:8:31 | LL | fn from_residual(t: T) -> _ { | ^ not allowed in type signatures @@ -28,7 +19,7 @@ LL - fn from_residual(t: T) -> _ { LL + fn from_residual(t: T) -> T { | -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors Some errors have detailed explanations: E0121, E0210. For more information about an error, try `rustc --explain E0121`. diff --git a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs index 5e368b9e6a96..bfce9dc9c733 100644 --- a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs +++ b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs @@ -6,20 +6,16 @@ struct TryMe; struct Error; impl const FromResidual for TryMe {} -//~^ ERROR const `impl` for trait `FromResidual` which is not `const` -//~| ERROR not all trait items implemented +//~^ ERROR not all trait items implemented impl const Try for TryMe { - //~^ ERROR const `impl` for trait `Try` which is not `const` - //~| ERROR not all trait items implemented + //~^ ERROR not all trait items implemented type Output = (); type Residual = Error; } const fn t() -> TryMe { TryMe?; - //~^ ERROR `?` is not allowed on - //~| ERROR `?` is not allowed on TryMe } diff --git a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr index 849d6522cd6e..183203aa8ba5 100644 --- a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr +++ b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr @@ -1,12 +1,3 @@ -error: const `impl` for trait `FromResidual` which is not `const` - --> $DIR/ice-126148-failed-to-normalize.rs:8:12 - | -LL | impl const FromResidual for TryMe {} - | ^^^^^^^^^^^^^^^^^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - error[E0046]: not all trait items implemented, missing: `from_residual` --> $DIR/ice-126148-failed-to-normalize.rs:8:1 | @@ -15,17 +6,8 @@ LL | impl const FromResidual for TryMe {} | = help: implement the missing item: `fn from_residual(_: Error) -> Self { todo!() }` -error: const `impl` for trait `Try` which is not `const` - --> $DIR/ice-126148-failed-to-normalize.rs:12:12 - | -LL | impl const Try for TryMe { - | ^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - error[E0046]: not all trait items implemented, missing: `from_output`, `branch` - --> $DIR/ice-126148-failed-to-normalize.rs:12:1 + --> $DIR/ice-126148-failed-to-normalize.rs:11:1 | LL | impl const Try for TryMe { | ^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_output`, `branch` in implementation @@ -33,23 +15,6 @@ LL | impl const Try for TryMe { = help: implement the missing item: `fn from_output(_: ::Output) -> Self { todo!() }` = help: implement the missing item: `fn branch(self) -> ControlFlow<::Residual, ::Output> { todo!() }` -error[E0015]: `?` is not allowed on `TryMe` in constant functions - --> $DIR/ice-126148-failed-to-normalize.rs:20:5 - | -LL | TryMe?; - | ^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants +error: aborting due to 2 previous errors -error[E0015]: `?` is not allowed on `TryMe` in constant functions - --> $DIR/ice-126148-failed-to-normalize.rs:20:5 - | -LL | TryMe?; - | ^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0015, E0046. -For more information about an error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0046`. diff --git a/tests/ui/traits/const-traits/trait-default-body-stability.rs b/tests/ui/traits/const-traits/trait-default-body-stability.rs index 567f1b3c2842..a8157d37ce3f 100644 --- a/tests/ui/traits/const-traits/trait-default-body-stability.rs +++ b/tests/ui/traits/const-traits/trait-default-body-stability.rs @@ -1,4 +1,4 @@ -//@ known-bug: #110395 +//@ check-pass //@ compile-flags: -Znext-solver #![allow(incomplete_features)] #![feature(staged_api)] diff --git a/tests/ui/traits/const-traits/trait-default-body-stability.stderr b/tests/ui/traits/const-traits/trait-default-body-stability.stderr deleted file mode 100644 index b995d6f4f3d4..000000000000 --- a/tests/ui/traits/const-traits/trait-default-body-stability.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error: const `impl` for trait `Try` which is not `const` - --> $DIR/trait-default-body-stability.rs:19:12 - | -LL | impl const Try for T { - | ^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `FromResidual` which is not `const` - --> $DIR/trait-default-body-stability.rs:34:12 - | -LL | impl const FromResidual for T { - | ^^^^^^^^^^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error[E0015]: `?` is not allowed on `T` in constant functions - --> $DIR/trait-default-body-stability.rs:46:9 - | -LL | T? - | ^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `T` in constant functions - --> $DIR/trait-default-body-stability.rs:46:9 - | -LL | T? - | ^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0015`. From bcaa79529d351416a2ab1c07931a0ba05b99c9c3 Mon Sep 17 00:00:00 2001 From: Kivooeo Date: Sat, 19 Jul 2025 15:18:21 +0500 Subject: [PATCH 146/183] removed tidy check on issues files --- src/tools/tidy/src/issues.txt | 1224 -------------------------------- src/tools/tidy/src/ui_tests.rs | 55 +- triagebot.toml | 6 + 3 files changed, 10 insertions(+), 1275 deletions(-) diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 77414bec82d3..ee06707415f5 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -1364,1230 +1364,6 @@ ui/infinite/issue-41731-infinite-macro-println.rs ui/intrinsics/issue-28575.rs ui/intrinsics/issue-84297-reifying-copy.rs ui/invalid/issue-114435-layout-type-err.rs -ui/issues/auxiliary/issue-11224.rs -ui/issues/auxiliary/issue-11508.rs -ui/issues/auxiliary/issue-11529.rs -ui/issues/auxiliary/issue-11680.rs -ui/issues/auxiliary/issue-12612-1.rs -ui/issues/auxiliary/issue-12612-2.rs -ui/issues/auxiliary/issue-12660-aux.rs -ui/issues/auxiliary/issue-13507.rs -ui/issues/auxiliary/issue-13620-1.rs -ui/issues/auxiliary/issue-13620-2.rs -ui/issues/auxiliary/issue-14344-1.rs -ui/issues/auxiliary/issue-14344-2.rs -ui/issues/auxiliary/issue-14422.rs -ui/issues/auxiliary/issue-15562.rs -ui/issues/auxiliary/issue-16643.rs -ui/issues/auxiliary/issue-16725.rs -ui/issues/auxiliary/issue-17662.rs -ui/issues/auxiliary/issue-18501.rs -ui/issues/auxiliary/issue-18514.rs -ui/issues/auxiliary/issue-18711.rs -ui/issues/auxiliary/issue-18913-1.rs -ui/issues/auxiliary/issue-18913-2.rs -ui/issues/auxiliary/issue-19293.rs -ui/issues/auxiliary/issue-20389.rs -ui/issues/auxiliary/issue-21202.rs -ui/issues/auxiliary/issue-2170-lib.rs -ui/issues/auxiliary/issue-2316-a.rs -ui/issues/auxiliary/issue-2316-b.rs -ui/issues/auxiliary/issue-2380.rs -ui/issues/auxiliary/issue-2414-a.rs -ui/issues/auxiliary/issue-2414-b.rs -ui/issues/auxiliary/issue-2472-b.rs -ui/issues/auxiliary/issue-25185-1.rs -ui/issues/auxiliary/issue-25185-2.rs -ui/issues/auxiliary/issue-2526.rs -ui/issues/auxiliary/issue-25467.rs -ui/issues/auxiliary/issue-2631-a.rs -ui/issues/auxiliary/issue-2723-a.rs -ui/issues/auxiliary/issue-29265.rs -ui/issues/auxiliary/issue-29485.rs -ui/issues/auxiliary/issue-3012-1.rs -ui/issues/auxiliary/issue-30123-aux.rs -ui/issues/auxiliary/issue-3136-a.rs -ui/issues/auxiliary/issue-31702-1.rs -ui/issues/auxiliary/issue-31702-2.rs -ui/issues/auxiliary/issue-34796-aux.rs -ui/issues/auxiliary/issue-36954.rs -ui/issues/auxiliary/issue-38190.rs -ui/issues/auxiliary/issue-38226-aux.rs -ui/issues/auxiliary/issue-3979-traits.rs -ui/issues/auxiliary/issue-41053.rs -ui/issues/auxiliary/issue-41549.rs -ui/issues/auxiliary/issue-42007-s.rs -ui/issues/auxiliary/issue-4208-cc.rs -ui/issues/auxiliary/issue-4545.rs -ui/issues/auxiliary/issue-48984-aux.rs -ui/issues/auxiliary/issue-49544.rs -ui/issues/auxiliary/issue-51798.rs -ui/issues/auxiliary/issue-52489.rs -ui/issues/auxiliary/issue-5518.rs -ui/issues/auxiliary/issue-5521.rs -ui/issues/auxiliary/issue-56943.rs -ui/issues/auxiliary/issue-57271-lib.rs -ui/issues/auxiliary/issue-5844-aux.rs -ui/issues/auxiliary/issue-7178.rs -ui/issues/auxiliary/issue-73112.rs -ui/issues/auxiliary/issue-7899.rs -ui/issues/auxiliary/issue-8044.rs -ui/issues/auxiliary/issue-8259.rs -ui/issues/auxiliary/issue-8401.rs -ui/issues/auxiliary/issue-9123.rs -ui/issues/auxiliary/issue-9155.rs -ui/issues/auxiliary/issue-9188.rs -ui/issues/auxiliary/issue-9906.rs -ui/issues/auxiliary/issue-9968.rs -ui/issues/issue-10228.rs -ui/issues/issue-10291.rs -ui/issues/issue-102964.rs -ui/issues/issue-10396.rs -ui/issues/issue-10412.rs -ui/issues/issue-10436.rs -ui/issues/issue-10456.rs -ui/issues/issue-10465.rs -ui/issues/issue-10545.rs -ui/issues/issue-10638.rs -ui/issues/issue-10656.rs -ui/issues/issue-106755.rs -ui/issues/issue-10683.rs -ui/issues/issue-10718.rs -ui/issues/issue-10734.rs -ui/issues/issue-10764.rs -ui/issues/issue-10767.rs -ui/issues/issue-10802.rs -ui/issues/issue-10806.rs -ui/issues/issue-10853.rs -ui/issues/issue-10877.rs -ui/issues/issue-10902.rs -ui/issues/issue-11004.rs -ui/issues/issue-11047.rs -ui/issues/issue-11085.rs -ui/issues/issue-11192.rs -ui/issues/issue-11205.rs -ui/issues/issue-11224.rs -ui/issues/issue-11267.rs -ui/issues/issue-11374.rs -ui/issues/issue-11382.rs -ui/issues/issue-11384.rs -ui/issues/issue-11508.rs -ui/issues/issue-11529.rs -ui/issues/issue-11552.rs -ui/issues/issue-11592.rs -ui/issues/issue-11677.rs -ui/issues/issue-11680.rs -ui/issues/issue-11681.rs -ui/issues/issue-11709.rs -ui/issues/issue-11740.rs -ui/issues/issue-11771.rs -ui/issues/issue-11820.rs -ui/issues/issue-11844.rs -ui/issues/issue-11869.rs -ui/issues/issue-11958.rs -ui/issues/issue-12033.rs -ui/issues/issue-12041.rs -ui/issues/issue-12127.rs -ui/issues/issue-12285.rs -ui/issues/issue-12567.rs -ui/issues/issue-12612.rs -ui/issues/issue-12660.rs -ui/issues/issue-12677.rs -ui/issues/issue-12729.rs -ui/issues/issue-12744.rs -ui/issues/issue-12860.rs -ui/issues/issue-12863.rs -ui/issues/issue-12909.rs -ui/issues/issue-12920.rs -ui/issues/issue-13027.rs -ui/issues/issue-13058.rs -ui/issues/issue-13105.rs -ui/issues/issue-13167.rs -ui/issues/issue-13202.rs -ui/issues/issue-13204.rs -ui/issues/issue-13214.rs -ui/issues/issue-13259-windows-tcb-trash.rs -ui/issues/issue-13264.rs -ui/issues/issue-13323.rs -ui/issues/issue-13359.rs -ui/issues/issue-13405.rs -ui/issues/issue-13407.rs -ui/issues/issue-13434.rs -ui/issues/issue-13446.rs -ui/issues/issue-13466.rs -ui/issues/issue-13482-2.rs -ui/issues/issue-13482.rs -ui/issues/issue-13497-2.rs -ui/issues/issue-13497.rs -ui/issues/issue-13507-2.rs -ui/issues/issue-13620.rs -ui/issues/issue-13665.rs -ui/issues/issue-13703.rs -ui/issues/issue-13763.rs -ui/issues/issue-13775.rs -ui/issues/issue-13808.rs -ui/issues/issue-13847.rs -ui/issues/issue-13867.rs -ui/issues/issue-14082.rs -ui/issues/issue-14091-2.rs -ui/issues/issue-14091.rs -ui/issues/issue-14092.rs -ui/issues/issue-14229.rs -ui/issues/issue-14254.rs -ui/issues/issue-14285.rs -ui/issues/issue-14308.rs -ui/issues/issue-14330.rs -ui/issues/issue-14344.rs -ui/issues/issue-14366.rs -ui/issues/issue-14382.rs -ui/issues/issue-14393.rs -ui/issues/issue-14399.rs -ui/issues/issue-14422.rs -ui/issues/issue-14541.rs -ui/issues/issue-14721.rs -ui/issues/issue-14821.rs -ui/issues/issue-14845.rs -ui/issues/issue-14853.rs -ui/issues/issue-14865.rs -ui/issues/issue-14875.rs -ui/issues/issue-14901.rs -ui/issues/issue-14915.rs -ui/issues/issue-14919.rs -ui/issues/issue-14959.rs -ui/issues/issue-15034.rs -ui/issues/issue-15043.rs -ui/issues/issue-15063.rs -ui/issues/issue-15094.rs -ui/issues/issue-15104.rs -ui/issues/issue-15129-rpass.rs -ui/issues/issue-15167.rs -ui/issues/issue-15189.rs -ui/issues/issue-15207.rs -ui/issues/issue-15260.rs -ui/issues/issue-15381.rs -ui/issues/issue-15444.rs -ui/issues/issue-15523-big.rs -ui/issues/issue-15523.rs -ui/issues/issue-15562.rs -ui/issues/issue-15571.rs -ui/issues/issue-15673.rs -ui/issues/issue-15734.rs -ui/issues/issue-15735.rs -ui/issues/issue-15756.rs -ui/issues/issue-15763.rs -ui/issues/issue-15774.rs -ui/issues/issue-15783.rs -ui/issues/issue-15793.rs -ui/issues/issue-15858.rs -ui/issues/issue-15896.rs -ui/issues/issue-15965.rs -ui/issues/issue-16048.rs -ui/issues/issue-16149.rs -ui/issues/issue-16151.rs -ui/issues/issue-16256.rs -ui/issues/issue-16278.rs -ui/issues/issue-16401.rs -ui/issues/issue-16441.rs -ui/issues/issue-16452.rs -ui/issues/issue-16492.rs -ui/issues/issue-16530.rs -ui/issues/issue-16560.rs -ui/issues/issue-16562.rs -ui/issues/issue-16596.rs -ui/issues/issue-16643.rs -ui/issues/issue-16648.rs -ui/issues/issue-16668.rs -ui/issues/issue-16671.rs -ui/issues/issue-16683.rs -ui/issues/issue-16725.rs -ui/issues/issue-16739.rs -ui/issues/issue-16745.rs -ui/issues/issue-16774.rs -ui/issues/issue-16783.rs -ui/issues/issue-16819.rs -ui/issues/issue-16922-rpass.rs -ui/issues/issue-16966.rs -ui/issues/issue-16994.rs -ui/issues/issue-17001.rs -ui/issues/issue-17033.rs -ui/issues/issue-17068.rs -ui/issues/issue-17121.rs -ui/issues/issue-17216.rs -ui/issues/issue-17252.rs -ui/issues/issue-17322.rs -ui/issues/issue-17336.rs -ui/issues/issue-17337.rs -ui/issues/issue-17351.rs -ui/issues/issue-17361.rs -ui/issues/issue-17373.rs -ui/issues/issue-17385.rs -ui/issues/issue-17405.rs -ui/issues/issue-17441.rs -ui/issues/issue-17450.rs -ui/issues/issue-17503.rs -ui/issues/issue-17546.rs -ui/issues/issue-17551.rs -ui/issues/issue-17651.rs -ui/issues/issue-17662.rs -ui/issues/issue-17732.rs -ui/issues/issue-17734.rs -ui/issues/issue-17740.rs -ui/issues/issue-17746.rs -ui/issues/issue-17758.rs -ui/issues/issue-17771.rs -ui/issues/issue-17800.rs -ui/issues/issue-17816.rs -ui/issues/issue-17877.rs -ui/issues/issue-17897.rs -ui/issues/issue-17904-2.rs -ui/issues/issue-17904.rs -ui/issues/issue-17905-2.rs -ui/issues/issue-17905.rs -ui/issues/issue-17933.rs -ui/issues/issue-17954.rs -ui/issues/issue-17959.rs -ui/issues/issue-17994.rs -ui/issues/issue-17999.rs -ui/issues/issue-18058.rs -ui/issues/issue-18088.rs -ui/issues/issue-18107.rs -ui/issues/issue-18110.rs -ui/issues/issue-18119.rs -ui/issues/issue-18159.rs -ui/issues/issue-18173.rs -ui/issues/issue-18183.rs -ui/issues/issue-18188.rs -ui/issues/issue-18232.rs -ui/issues/issue-18352.rs -ui/issues/issue-18353.rs -ui/issues/issue-18389.rs -ui/issues/issue-18423.rs -ui/issues/issue-18446-2.rs -ui/issues/issue-18446.rs -ui/issues/issue-18464.rs -ui/issues/issue-18501.rs -ui/issues/issue-18514.rs -ui/issues/issue-18532.rs -ui/issues/issue-18539.rs -ui/issues/issue-18566.rs -ui/issues/issue-18611.rs -ui/issues/issue-18685.rs -ui/issues/issue-18711.rs -ui/issues/issue-18767.rs -ui/issues/issue-18783.rs -ui/issues/issue-18809.rs -ui/issues/issue-18845.rs -ui/issues/issue-18859.rs -ui/issues/issue-18906.rs -ui/issues/issue-18913.rs -ui/issues/issue-18919.rs -ui/issues/issue-18952.rs -ui/issues/issue-18959.rs -ui/issues/issue-18988.rs -ui/issues/issue-19001.rs -ui/issues/issue-19037.rs -ui/issues/issue-19086.rs -ui/issues/issue-19097.rs -ui/issues/issue-19098.rs -ui/issues/issue-19100.rs -ui/issues/issue-19127.rs -ui/issues/issue-19135.rs -ui/issues/issue-19293.rs -ui/issues/issue-19367.rs -ui/issues/issue-19380.rs -ui/issues/issue-19398.rs -ui/issues/issue-19404.rs -ui/issues/issue-19479.rs -ui/issues/issue-19482.rs -ui/issues/issue-19499.rs -ui/issues/issue-19601.rs -ui/issues/issue-19631.rs -ui/issues/issue-19632.rs -ui/issues/issue-19692.rs -ui/issues/issue-19734.rs -ui/issues/issue-19811-escape-unicode.rs -ui/issues/issue-19850.rs -ui/issues/issue-19922.rs -ui/issues/issue-19982.rs -ui/issues/issue-19991.rs -ui/issues/issue-20009.rs -ui/issues/issue-20055-box-trait.rs -ui/issues/issue-20055-box-unsized-array.rs -ui/issues/issue-20162.rs -ui/issues/issue-20174.rs -ui/issues/issue-20186.rs -ui/issues/issue-20225.rs -ui/issues/issue-20261.rs -ui/issues/issue-20313-rpass.rs -ui/issues/issue-20313.rs -ui/issues/issue-20389.rs -ui/issues/issue-20396.rs -ui/issues/issue-20413.rs -ui/issues/issue-20414.rs -ui/issues/issue-20427.rs -ui/issues/issue-20433.rs -ui/issues/issue-20454.rs -ui/issues/issue-20544.rs -ui/issues/issue-20575.rs -ui/issues/issue-20644.rs -ui/issues/issue-20676.rs -ui/issues/issue-20714.rs -ui/issues/issue-2074.rs -ui/issues/issue-20772.rs -ui/issues/issue-20797.rs -ui/issues/issue-20803.rs -ui/issues/issue-20831-debruijn.rs -ui/issues/issue-20847.rs -ui/issues/issue-20939.rs -ui/issues/issue-20953.rs -ui/issues/issue-20971.rs -ui/issues/issue-21033.rs -ui/issues/issue-21140.rs -ui/issues/issue-21160.rs -ui/issues/issue-21174-2.rs -ui/issues/issue-21174.rs -ui/issues/issue-21177.rs -ui/issues/issue-21202.rs -ui/issues/issue-21245.rs -ui/issues/issue-21291.rs -ui/issues/issue-21306.rs -ui/issues/issue-21332.rs -ui/issues/issue-21361.rs -ui/issues/issue-21384.rs -ui/issues/issue-21400.rs -ui/issues/issue-21402.rs -ui/issues/issue-21449.rs -ui/issues/issue-2150.rs -ui/issues/issue-2151.rs -ui/issues/issue-21546.rs -ui/issues/issue-21554.rs -ui/issues/issue-21600.rs -ui/issues/issue-21622.rs -ui/issues/issue-21634.rs -ui/issues/issue-21655.rs -ui/issues/issue-2170-exe.rs -ui/issues/issue-21701.rs -ui/issues/issue-21763.rs -ui/issues/issue-21891.rs -ui/issues/issue-2190-1.rs -ui/issues/issue-21909.rs -ui/issues/issue-21922.rs -ui/issues/issue-21946.rs -ui/issues/issue-21950.rs -ui/issues/issue-21974.rs -ui/issues/issue-22008.rs -ui/issues/issue-22034.rs -ui/issues/issue-22036.rs -ui/issues/issue-2214.rs -ui/issues/issue-22258.rs -ui/issues/issue-22289.rs -ui/issues/issue-22312.rs -ui/issues/issue-22346.rs -ui/issues/issue-22356.rs -ui/issues/issue-22370.rs -ui/issues/issue-22403.rs -ui/issues/issue-22426.rs -ui/issues/issue-22434.rs -ui/issues/issue-22468.rs -ui/issues/issue-22471.rs -ui/issues/issue-22577.rs -ui/issues/issue-22599.rs -ui/issues/issue-22603.rs -ui/issues/issue-22629.rs -ui/issues/issue-22638.rs -ui/issues/issue-22644.rs -ui/issues/issue-22673.rs -ui/issues/issue-22684.rs -ui/issues/issue-22706.rs -ui/issues/issue-22777.rs -ui/issues/issue-22781.rs -ui/issues/issue-22789.rs -ui/issues/issue-2281-part1.rs -ui/issues/issue-22814.rs -ui/issues/issue-2284.rs -ui/issues/issue-22872.rs -ui/issues/issue-22874.rs -ui/issues/issue-2288.rs -ui/issues/issue-22886.rs -ui/issues/issue-22894.rs -ui/issues/issue-22992-2.rs -ui/issues/issue-22992.rs -ui/issues/issue-23024.rs -ui/issues/issue-23036.rs -ui/issues/issue-23041.rs -ui/issues/issue-23046.rs -ui/issues/issue-23073.rs -ui/issues/issue-2311-2.rs -ui/issues/issue-2311.rs -ui/issues/issue-2312.rs -ui/issues/issue-2316-c.rs -ui/issues/issue-23173.rs -ui/issues/issue-23189.rs -ui/issues/issue-23217.rs -ui/issues/issue-23253.rs -ui/issues/issue-23261.rs -ui/issues/issue-23281.rs -ui/issues/issue-23311.rs -ui/issues/issue-23336.rs -ui/issues/issue-23354-2.rs -ui/issues/issue-23354.rs -ui/issues/issue-23406.rs -ui/issues/issue-23433.rs -ui/issues/issue-23442.rs -ui/issues/issue-23477.rs -ui/issues/issue-23485.rs -ui/issues/issue-23491.rs -ui/issues/issue-23543.rs -ui/issues/issue-23544.rs -ui/issues/issue-23550.rs -ui/issues/issue-23589.rs -ui/issues/issue-23699.rs -ui/issues/issue-2380-b.rs -ui/issues/issue-2383.rs -ui/issues/issue-23891.rs -ui/issues/issue-23898.rs -ui/issues/issue-23958.rs -ui/issues/issue-23966.rs -ui/issues/issue-23992.rs -ui/issues/issue-24013.rs -ui/issues/issue-24036.rs -ui/issues/issue-24086.rs -ui/issues/issue-2414-c.rs -ui/issues/issue-24161.rs -ui/issues/issue-24227.rs -ui/issues/issue-2428.rs -ui/issues/issue-24308.rs -ui/issues/issue-24322.rs -ui/issues/issue-24352.rs -ui/issues/issue-24353.rs -ui/issues/issue-24357.rs -ui/issues/issue-24363.rs -ui/issues/issue-24365.rs -ui/issues/issue-24389.rs -ui/issues/issue-24424.rs -ui/issues/issue-24434.rs -ui/issues/issue-2445-b.rs -ui/issues/issue-2445.rs -ui/issues/issue-24533.rs -ui/issues/issue-24589.rs -ui/issues/issue-2463.rs -ui/issues/issue-24682.rs -ui/issues/issue-24687-embed-debuginfo/auxiliary/issue-24687-lib.rs -ui/issues/issue-24687-embed-debuginfo/auxiliary/issue-24687-mbcs-in-comments.rs -ui/issues/issue-2470-bounds-check-overflow.rs -ui/issues/issue-2472.rs -ui/issues/issue-24779.rs -ui/issues/issue-24819.rs -ui/issues/issue-2487-a.rs -ui/issues/issue-24945-repeat-dash-opts.rs -ui/issues/issue-24947.rs -ui/issues/issue-24954.rs -ui/issues/issue-2502.rs -ui/issues/issue-25076.rs -ui/issues/issue-25089.rs -ui/issues/issue-25145.rs -ui/issues/issue-25180.rs -ui/issues/issue-25185.rs -ui/issues/issue-2526-a.rs -ui/issues/issue-25279.rs -ui/issues/issue-25343.rs -ui/issues/issue-25368.rs -ui/issues/issue-25386.rs -ui/issues/issue-25394.rs -ui/issues/issue-25467.rs -ui/issues/issue-25497.rs -ui/issues/issue-2550.rs -ui/issues/issue-25515.rs -ui/issues/issue-25549-multiple-drop.rs -ui/issues/issue-25579.rs -ui/issues/issue-25679.rs -ui/issues/issue-25693.rs -ui/issues/issue-25746-bool-transmute.rs -ui/issues/issue-25757.rs -ui/issues/issue-25810.rs -ui/issues/issue-2590.rs -ui/issues/issue-25901.rs -ui/issues/issue-26056.rs -ui/issues/issue-26093.rs -ui/issues/issue-26095.rs -ui/issues/issue-26127.rs -ui/issues/issue-26186.rs -ui/issues/issue-26205.rs -ui/issues/issue-26217.rs -ui/issues/issue-26237.rs -ui/issues/issue-2631-b.rs -ui/issues/issue-2642.rs -ui/issues/issue-26468.rs -ui/issues/issue-26472.rs -ui/issues/issue-26484.rs -ui/issues/issue-26614.rs -ui/issues/issue-26619.rs -ui/issues/issue-26641.rs -ui/issues/issue-26646.rs -ui/issues/issue-26655.rs -ui/issues/issue-26709.rs -ui/issues/issue-26802.rs -ui/issues/issue-26805.rs -ui/issues/issue-26812.rs -ui/issues/issue-26948.rs -ui/issues/issue-26997.rs -ui/issues/issue-27008.rs -ui/issues/issue-27033.rs -ui/issues/issue-27042.rs -ui/issues/issue-27054-primitive-binary-ops.rs -ui/issues/issue-27078.rs -ui/issues/issue-2708.rs -ui/issues/issue-27105.rs -ui/issues/issue-2723-b.rs -ui/issues/issue-27240.rs -ui/issues/issue-27268.rs -ui/issues/issue-27281.rs -ui/issues/issue-27340.rs -ui/issues/issue-27401-dropflag-reinit.rs -ui/issues/issue-27433.rs -ui/issues/issue-27592.rs -ui/issues/issue-2761.rs -ui/issues/issue-27639.rs -ui/issues/issue-27697.rs -ui/issues/issue-27815.rs -ui/issues/issue-27842.rs -ui/issues/issue-27889.rs -ui/issues/issue-27942.rs -ui/issues/issue-27949.rs -ui/issues/issue-27997.rs -ui/issues/issue-28105.rs -ui/issues/issue-28109.rs -ui/issues/issue-28181.rs -ui/issues/issue-28279.rs -ui/issues/issue-28344.rs -ui/issues/issue-28433.rs -ui/issues/issue-28472.rs -ui/issues/issue-2848.rs -ui/issues/issue-2849.rs -ui/issues/issue-28498-must-work-ex1.rs -ui/issues/issue-28498-must-work-ex2.rs -ui/issues/issue-28498-ugeh-ex1.rs -ui/issues/issue-28550.rs -ui/issues/issue-28561.rs -ui/issues/issue-28568.rs -ui/issues/issue-28586.rs -ui/issues/issue-28600.rs -ui/issues/issue-28625.rs -ui/issues/issue-28776.rs -ui/issues/issue-28828.rs -ui/issues/issue-28839.rs -ui/issues/issue-28936.rs -ui/issues/issue-2895.rs -ui/issues/issue-28971.rs -ui/issues/issue-28983.rs -ui/issues/issue-28999.rs -ui/issues/issue-29030.rs -ui/issues/issue-29037.rs -ui/issues/issue-2904.rs -ui/issues/issue-29048.rs -ui/issues/issue-29053.rs -ui/issues/issue-29071-2.rs -ui/issues/issue-29071.rs -ui/issues/issue-29092.rs -ui/issues/issue-29147-rpass.rs -ui/issues/issue-29147.rs -ui/issues/issue-29265.rs -ui/issues/issue-29276.rs -ui/issues/issue-2935.rs -ui/issues/issue-29466.rs -ui/issues/issue-29485.rs -ui/issues/issue-2951.rs -ui/issues/issue-29516.rs -ui/issues/issue-29522.rs -ui/issues/issue-29540.rs -ui/issues/issue-29663.rs -ui/issues/issue-29668.rs -ui/issues/issue-29710.rs -ui/issues/issue-29723.rs -ui/issues/issue-29740.rs -ui/issues/issue-29743.rs -ui/issues/issue-29821.rs -ui/issues/issue-29857.rs -ui/issues/issue-29861.rs -ui/issues/issue-2989.rs -ui/issues/issue-29948.rs -ui/issues/issue-2995.rs -ui/issues/issue-30018-panic.rs -ui/issues/issue-30081.rs -ui/issues/issue-3012-2.rs -ui/issues/issue-30123.rs -ui/issues/issue-3021-b.rs -ui/issues/issue-3021-d.rs -ui/issues/issue-30236.rs -ui/issues/issue-30255.rs -ui/issues/issue-3026.rs -ui/issues/issue-3029.rs -ui/issues/issue-3037.rs -ui/issues/issue-30371.rs -ui/issues/issue-3038.rs -ui/issues/issue-30380.rs -ui/issues/issue-3052.rs -ui/issues/issue-30530.rs -ui/issues/issue-30589.rs -ui/issues/issue-30615.rs -ui/issues/issue-30756.rs -ui/issues/issue-30891.rs -ui/issues/issue-3091.rs -ui/issues/issue-31011.rs -ui/issues/issue-3109.rs -ui/issues/issue-3121.rs -ui/issues/issue-31267-additional.rs -ui/issues/issue-31267.rs -ui/issues/issue-31299.rs -ui/issues/issue-3136-b.rs -ui/issues/issue-3149.rs -ui/issues/issue-31511.rs -ui/issues/issue-3154.rs -ui/issues/issue-31702.rs -ui/issues/issue-31769.rs -ui/issues/issue-31776.rs -ui/issues/issue-31910.rs -ui/issues/issue-32004.rs -ui/issues/issue-32008.rs -ui/issues/issue-32086.rs -ui/issues/issue-3220.rs -ui/issues/issue-32292.rs -ui/issues/issue-32324.rs -ui/issues/issue-32326.rs -ui/issues/issue-32377.rs -ui/issues/issue-32389.rs -ui/issues/issue-32518.rs -ui/issues/issue-32655.rs -ui/issues/issue-32782.rs -ui/issues/issue-32797.rs -ui/issues/issue-32805.rs -ui/issues/issue-3290.rs -ui/issues/issue-32995-2.rs -ui/issues/issue-32995.rs -ui/issues/issue-33202.rs -ui/issues/issue-33241.rs -ui/issues/issue-33287.rs -ui/issues/issue-33293.rs -ui/issues/issue-33387.rs -ui/issues/issue-3344.rs -ui/issues/issue-33461.rs -ui/issues/issue-33504.rs -ui/issues/issue-33525.rs -ui/issues/issue-33571.rs -ui/issues/issue-33687.rs -ui/issues/issue-33770.rs -ui/issues/issue-3389.rs -ui/issues/issue-33941.rs -ui/issues/issue-34047.rs -ui/issues/issue-34074.rs -ui/issues/issue-34209.rs -ui/issues/issue-34229.rs -ui/issues/issue-3424.rs -ui/issues/issue-3429.rs -ui/issues/issue-34334.rs -ui/issues/issue-34349.rs -ui/issues/issue-34373.rs -ui/issues/issue-34418.rs -ui/issues/issue-34427.rs -ui/issues/issue-3447.rs -ui/issues/issue-34503.rs -ui/issues/issue-34569.rs -ui/issues/issue-34571.rs -ui/issues/issue-34751.rs -ui/issues/issue-3477.rs -ui/issues/issue-34780.rs -ui/issues/issue-34796.rs -ui/issues/issue-34839.rs -ui/issues/issue-3500.rs -ui/issues/issue-35139.rs -ui/issues/issue-3521-2.rs -ui/issues/issue-35241.rs -ui/issues/issue-35423.rs -ui/issues/issue-3556.rs -ui/issues/issue-35570.rs -ui/issues/issue-3559.rs -ui/issues/issue-35600.rs -ui/issues/issue-3574.rs -ui/issues/issue-35815.rs -ui/issues/issue-35976.rs -ui/issues/issue-35988.rs -ui/issues/issue-36023.rs -ui/issues/issue-36036-associated-type-layout.rs -ui/issues/issue-36075.rs -ui/issues/issue-3609.rs -ui/issues/issue-36116.rs -ui/issues/issue-36260.rs -ui/issues/issue-36278-prefix-nesting.rs -ui/issues/issue-36299.rs -ui/issues/issue-36379.rs -ui/issues/issue-36400.rs -ui/issues/issue-36474.rs -ui/issues/issue-3656.rs -ui/issues/issue-3668-non-constant-value-in-constant/issue-3668-2.rs -ui/issues/issue-3668-non-constant-value-in-constant/issue-3668.rs -ui/issues/issue-36744-bitcast-args-if-needed.rs -ui/issues/issue-36786-resolve-call.rs -ui/issues/issue-3680.rs -ui/issues/issue-36816.rs -ui/issues/issue-36836.rs -ui/issues/issue-36839.rs -ui/issues/issue-36856.rs -ui/issues/issue-36936.rs -ui/issues/issue-36954.rs -ui/issues/issue-3702-2.rs -ui/issues/issue-3702.rs -ui/issues/issue-37051.rs -ui/issues/issue-37109.rs -ui/issues/issue-37131.rs -ui/issues/issue-37311-type-length-limit/issue-37311.rs -ui/issues/issue-37510.rs -ui/issues/issue-3753.rs -ui/issues/issue-37534.rs -ui/issues/issue-37576.rs -ui/issues/issue-3763.rs -ui/issues/issue-37665.rs -ui/issues/issue-37686.rs -ui/issues/issue-37725.rs -ui/issues/issue-37733.rs -ui/issues/issue-3779.rs -ui/issues/issue-37884.rs -ui/issues/issue-38160.rs -ui/issues/issue-38190.rs -ui/issues/issue-38226.rs -ui/issues/issue-38381.rs -ui/issues/issue-38412.rs -ui/issues/issue-38437.rs -ui/issues/issue-38458.rs -ui/issues/issue-3847.rs -ui/issues/issue-38556.rs -ui/issues/issue-38727.rs -ui/issues/issue-3874.rs -ui/issues/issue-38763.rs -ui/issues/issue-38857.rs -ui/issues/issue-38875/auxiliary/issue-38875-b.rs -ui/issues/issue-38875/issue-38875.rs -ui/issues/issue-3888-2.rs -ui/issues/issue-38919.rs -ui/issues/issue-38942.rs -ui/issues/issue-3895.rs -ui/issues/issue-38954.rs -ui/issues/issue-38987.rs -ui/issues/issue-39089.rs -ui/issues/issue-39211.rs -ui/issues/issue-39367.rs -ui/issues/issue-39548.rs -ui/issues/issue-39687.rs -ui/issues/issue-39709.rs -ui/issues/issue-3979-2.rs -ui/issues/issue-3979-xcrate.rs -ui/issues/issue-3979.rs -ui/issues/issue-39808.rs -ui/issues/issue-39827.rs -ui/issues/issue-39848.rs -ui/issues/issue-3991.rs -ui/issues/issue-3993.rs -ui/issues/issue-39970.rs -ui/issues/issue-39984.rs -ui/issues/issue-40000.rs -ui/issues/issue-4025.rs -ui/issues/issue-40288-2.rs -ui/issues/issue-40288.rs -ui/issues/issue-40951.rs -ui/issues/issue-41053.rs -ui/issues/issue-41229-ref-str.rs -ui/issues/issue-41298.rs -ui/issues/issue-41479.rs -ui/issues/issue-41498.rs -ui/issues/issue-41549.rs -ui/issues/issue-41604.rs -ui/issues/issue-41652/auxiliary/issue-41652-b.rs -ui/issues/issue-41652/issue-41652.rs -ui/issues/issue-41677.rs -ui/issues/issue-41696.rs -ui/issues/issue-41726.rs -ui/issues/issue-41742.rs -ui/issues/issue-41744.rs -ui/issues/issue-41849-variance-req.rs -ui/issues/issue-41880.rs -ui/issues/issue-41888.rs -ui/issues/issue-41936-variance-coerce-unsized-cycle.rs -ui/issues/issue-41974.rs -ui/issues/issue-41998.rs -ui/issues/issue-42007.rs -ui/issues/issue-4208.rs -ui/issues/issue-42106.rs -ui/issues/issue-42148.rs -ui/issues/issue-42210.rs -ui/issues/issue-4228.rs -ui/issues/issue-42312.rs -ui/issues/issue-42453.rs -ui/issues/issue-42467.rs -ui/issues/issue-4252.rs -ui/issues/issue-42552.rs -ui/issues/issue-4265.rs -ui/issues/issue-42755.rs -ui/issues/issue-42796.rs -ui/issues/issue-42880.rs -ui/issues/issue-42956.rs -ui/issues/issue-43057.rs -ui/issues/issue-43205.rs -ui/issues/issue-43250.rs -ui/issues/issue-43291.rs -ui/issues/issue-4333.rs -ui/issues/issue-4335.rs -ui/issues/issue-43355.rs -ui/issues/issue-43357.rs -ui/issues/issue-43420-no-over-suggest.rs -ui/issues/issue-43424.rs -ui/issues/issue-43431.rs -ui/issues/issue-43483.rs -ui/issues/issue-43692.rs -ui/issues/issue-43806.rs -ui/issues/issue-43853.rs -ui/issues/issue-4387.rs -ui/issues/issue-43910.rs -ui/issues/issue-43923.rs -ui/issues/issue-43988.rs -ui/issues/issue-44023.rs -ui/issues/issue-44056.rs -ui/issues/issue-44078.rs -ui/issues/issue-44216-add-instant.rs -ui/issues/issue-44216-add-system-time.rs -ui/issues/issue-44216-sub-instant.rs -ui/issues/issue-44216-sub-system-time.rs -ui/issues/issue-44239.rs -ui/issues/issue-44247.rs -ui/issues/issue-44405.rs -ui/issues/issue-4464.rs -ui/issues/issue-44730.rs -ui/issues/issue-44851.rs -ui/issues/issue-4517.rs -ui/issues/issue-4541.rs -ui/issues/issue-4542.rs -ui/issues/issue-45425.rs -ui/issues/issue-4545.rs -ui/issues/issue-45510.rs -ui/issues/issue-45562.rs -ui/issues/issue-45697-1.rs -ui/issues/issue-45697.rs -ui/issues/issue-45730.rs -ui/issues/issue-45731.rs -ui/issues/issue-45801.rs -ui/issues/issue-45965.rs -ui/issues/issue-46069.rs -ui/issues/issue-46101.rs -ui/issues/issue-46302.rs -ui/issues/issue-46311.rs -ui/issues/issue-46332.rs -ui/issues/issue-46471-1.rs -ui/issues/issue-46472.rs -ui/issues/issue-46604.rs -ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.rs -ui/issues/issue-46771.rs -ui/issues/issue-46855.rs -ui/issues/issue-46964.rs -ui/issues/issue-46983.rs -ui/issues/issue-47073-zero-padded-tuple-struct-indices.rs -ui/issues/issue-47094.rs -ui/issues/issue-47184.rs -ui/issues/issue-47309.rs -ui/issues/issue-4734.rs -ui/issues/issue-4735.rs -ui/issues/issue-4736.rs -ui/issues/issue-47364.rs -ui/issues/issue-47377.rs -ui/issues/issue-47380.rs -ui/issues/issue-47486.rs -ui/issues/issue-4759-1.rs -ui/issues/issue-4759.rs -ui/issues/issue-47638.rs -ui/issues/issue-47673.rs -ui/issues/issue-47703-1.rs -ui/issues/issue-47703-tuple.rs -ui/issues/issue-47703.rs -ui/issues/issue-47715.rs -ui/issues/issue-47722.rs -ui/issues/issue-48006.rs -ui/issues/issue-48131.rs -ui/issues/issue-48132.rs -ui/issues/issue-48159.rs -ui/issues/issue-48276.rs -ui/issues/issue-4830.rs -ui/issues/issue-48364.rs -ui/issues/issue-48728.rs -ui/issues/issue-4875.rs -ui/issues/issue-48984.rs -ui/issues/issue-49298.rs -ui/issues/issue-4935.rs -ui/issues/issue-49544.rs -ui/issues/issue-49632.rs -ui/issues/issue-4968.rs -ui/issues/issue-4972.rs -ui/issues/issue-49824.rs -ui/issues/issue-49854.rs -ui/issues/issue-49919.rs -ui/issues/issue-49934-errors.rs -ui/issues/issue-49934.rs -ui/issues/issue-49955.rs -ui/issues/issue-49973.rs -ui/issues/issue-50187.rs -ui/issues/issue-50411.rs -ui/issues/issue-50415.rs -ui/issues/issue-50442.rs -ui/issues/issue-50471.rs -ui/issues/issue-50518.rs -ui/issues/issue-50581.rs -ui/issues/issue-50582.rs -ui/issues/issue-50585.rs -ui/issues/issue-50600.rs -ui/issues/issue-50618.rs -ui/issues/issue-5062.rs -ui/issues/issue-5067.rs -ui/issues/issue-50688.rs -ui/issues/issue-50714.rs -ui/issues/issue-50761.rs -ui/issues/issue-50781.rs -ui/issues/issue-50802.rs -ui/issues/issue-50811.rs -ui/issues/issue-5100.rs -ui/issues/issue-51022.rs -ui/issues/issue-51044.rs -ui/issues/issue-51102.rs -ui/issues/issue-51116.rs -ui/issues/issue-51154.rs -ui/issues/issue-51515.rs -ui/issues/issue-51632-try-desugar-incompatible-types.rs -ui/issues/issue-51655.rs -ui/issues/issue-51714.rs -ui/issues/issue-51798.rs -ui/issues/issue-51874.rs -ui/issues/issue-51907.rs -ui/issues/issue-5192.rs -ui/issues/issue-51947.rs -ui/issues/issue-52049.rs -ui/issues/issue-52126-assign-op-invariance.rs -ui/issues/issue-52262.rs -ui/issues/issue-52489.rs -ui/issues/issue-52533.rs -ui/issues/issue-52717.rs -ui/issues/issue-5280.rs -ui/issues/issue-5315.rs -ui/issues/issue-5321-immediates-with-bare-self.rs -ui/issues/issue-53251.rs -ui/issues/issue-53275.rs -ui/issues/issue-53300.rs -ui/issues/issue-53333.rs -ui/issues/issue-53348.rs -ui/issues/issue-53419.rs -ui/issues/issue-53568.rs -ui/issues/issue-5358-1.rs -ui/issues/issue-53728.rs -ui/issues/issue-53843.rs -ui/issues/issue-54044.rs -ui/issues/issue-54062.rs -ui/issues/issue-54094.rs -ui/issues/issue-5439.rs -ui/issues/issue-54410.rs -ui/issues/issue-54462-mutable-noalias-correctness.rs -ui/issues/issue-54477-reduced-2.rs -ui/issues/issue-54696.rs -ui/issues/issue-5518.rs -ui/issues/issue-5521.rs -ui/issues/issue-55376.rs -ui/issues/issue-55380.rs -ui/issues/issue-5550.rs -ui/issues/issue-5554.rs -ui/issues/issue-55587.rs -ui/issues/issue-5572.rs -ui/issues/issue-55731.rs -ui/issues/issue-56128.rs -ui/issues/issue-56175.rs -ui/issues/issue-56199.rs -ui/issues/issue-56229.rs -ui/issues/issue-56237.rs -ui/issues/issue-5666.rs -ui/issues/issue-56806.rs -ui/issues/issue-56835.rs -ui/issues/issue-56870.rs -ui/issues/issue-5688.rs -ui/issues/issue-56943.rs -ui/issues/issue-5708.rs -ui/issues/issue-57156.rs -ui/issues/issue-57162.rs -ui/issues/issue-5718.rs -ui/issues/issue-57198-pass.rs -ui/issues/issue-57271.rs -ui/issues/issue-57399-self-return-impl-trait.rs -ui/issues/issue-5741.rs -ui/issues/issue-5754.rs -ui/issues/issue-57741-dereference-boxed-value/issue-57741-1.rs -ui/issues/issue-57741-dereference-boxed-value/issue-57741.rs -ui/issues/issue-57781.rs -ui/issues/issue-57924.rs -ui/issues/issue-58212.rs -ui/issues/issue-58375-monomorphize-default-impls.rs -ui/issues/issue-5844.rs -ui/issues/issue-58463.rs -ui/issues/issue-58712.rs -ui/issues/issue-58734.rs -ui/issues/issue-5883.rs -ui/issues/issue-5884.rs -ui/issues/issue-58857.rs -ui/issues/issue-5900.rs -ui/issues/issue-59020.rs -ui/issues/issue-5917.rs -ui/issues/issue-59326.rs -ui/issues/issue-59488.rs -ui/issues/issue-59494.rs -ui/issues/issue-5950.rs -ui/issues/issue-59756.rs -ui/issues/issue-5988.rs -ui/issues/issue-5997-outer-generic-parameter/issue-5997-enum.rs -ui/issues/issue-5997-outer-generic-parameter/issue-5997-struct.rs -ui/issues/issue-5997-outer-generic-parameter/issue-5997.rs -ui/issues/issue-60218.rs -ui/issues/issue-60622.rs -ui/issues/issue-60989.rs -ui/issues/issue-61106.rs -ui/issues/issue-61108.rs -ui/issues/issue-6117.rs -ui/issues/issue-6130.rs -ui/issues/issue-61475.rs -ui/issues/issue-6153.rs -ui/issues/issue-61623.rs -ui/issues/issue-61894.rs -ui/issues/issue-62480.rs -ui/issues/issue-6318.rs -ui/issues/issue-6344-let.rs -ui/issues/issue-6344-match.rs -ui/issues/issue-63983.rs -ui/issues/issue-64430.rs -ui/issues/issue-64559.rs -ui/issues/issue-64593.rs -ui/issues/issue-64792-bad-unicode-ctor.rs -ui/issues/issue-65131.rs -ui/issues/issue-65230.rs -ui/issues/issue-65462.rs -ui/issues/issue-6557.rs -ui/issues/issue-66308.rs -ui/issues/issue-66353.rs -ui/issues/issue-66667-function-cmp-cycle.rs -ui/issues/issue-66702-break-outside-loop-val.rs -ui/issues/issue-66706.rs -ui/issues/issue-66923-show-error-for-correct-call.rs -ui/issues/issue-67039-unsound-pin-partialeq.rs -ui/issues/issue-6738.rs -ui/issues/issue-67535.rs -ui/issues/issue-67552.rs -ui/issues/issue-68010-large-zst-consts.rs -ui/issues/issue-68696-catch-during-unwind.rs -ui/issues/issue-6892.rs -ui/issues/issue-68951.rs -ui/issues/issue-6898.rs -ui/issues/issue-69130.rs -ui/issues/issue-6919.rs -ui/issues/issue-69306.rs -ui/issues/issue-6936.rs -ui/issues/issue-69455.rs -ui/issues/issue-69602-type-err-during-codegen-ice.rs -ui/issues/issue-69683.rs -ui/issues/issue-7012.rs -ui/issues/issue-70381.rs -ui/issues/issue-7044.rs -ui/issues/issue-7061.rs -ui/issues/issue-70673.rs -ui/issues/issue-70724-add_type_neq_err_label-unwrap.rs -ui/issues/issue-70746.rs -ui/issues/issue-7092.rs -ui/issues/issue-71406.rs -ui/issues/issue-7178.rs -ui/issues/issue-72002.rs -ui/issues/issue-72076.rs -ui/issues/issue-72278.rs -ui/issues/issue-7246.rs -ui/issues/issue-7268.rs -ui/issues/issue-72839-error-overflow.rs -ui/issues/issue-72933-match-stack-overflow.rs -ui/issues/issue-73112.rs -ui/issues/issue-73229.rs -ui/issues/issue-7344.rs -ui/issues/issue-7364.rs -ui/issues/issue-74082.rs -ui/issues/issue-74564-if-expr-stack-overflow.rs -ui/issues/issue-7519-match-unit-in-arg.rs -ui/issues/issue-75283.rs -ui/issues/issue-7563.rs -ui/issues/issue-75704.rs -ui/issues/issue-7575.rs -ui/issues/issue-76042.rs -ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.rs -ui/issues/issue-76077-inaccesible-private-fields/issue-76077.rs -ui/issues/issue-76191.rs -ui/issues/issue-7660.rs -ui/issues/issue-7663.rs -ui/issues/issue-7673-cast-generically-implemented-trait.rs -ui/issues/issue-77218/issue-77218-2.rs -ui/issues/issue-77218/issue-77218.rs -ui/issues/issue-7784.rs -ui/issues/issue-77919.rs -ui/issues/issue-78192.rs -ui/issues/issue-78622.rs -ui/issues/issue-7867.rs -ui/issues/issue-78957.rs -ui/issues/issue-7899.rs -ui/issues/issue-7911.rs -ui/issues/issue-7970a.rs -ui/issues/issue-8044.rs -ui/issues/issue-80607.rs -ui/issues/issue-81584.rs -ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs -ui/issues/issue-81918.rs -ui/issues/issue-8248.rs -ui/issues/issue-8249.rs -ui/issues/issue-8259.rs -ui/issues/issue-83048.rs -ui/issues/issue-8391.rs -ui/issues/issue-8398.rs -ui/issues/issue-8401.rs -ui/issues/issue-8498.rs -ui/issues/issue-8506.rs -ui/issues/issue-8521.rs -ui/issues/issue-85461.rs -ui/issues/issue-8578.rs -ui/issues/issue-86756.rs -ui/issues/issue-87199.rs -ui/issues/issue-8727.rs -ui/issues/issue-87490.rs -ui/issues/issue-8761.rs -ui/issues/issue-8767.rs -ui/issues/issue-87707.rs -ui/issues/issue-8783.rs -ui/issues/issue-88150.rs -ui/issues/issue-8860.rs -ui/issues/issue-8898.rs -ui/issues/issue-9047.rs -ui/issues/issue-9110.rs -ui/issues/issue-9123.rs -ui/issues/issue-9129.rs -ui/issues/issue-91489.rs -ui/issues/issue-9155.rs -ui/issues/issue-9188.rs -ui/issues/issue-9243.rs -ui/issues/issue-9249.rs -ui/issues/issue-9259.rs -ui/issues/issue-92741.rs -ui/issues/issue-9446.rs -ui/issues/issue-9725.rs -ui/issues/issue-9737.rs -ui/issues/issue-9814.rs -ui/issues/issue-98299.rs -ui/issues/issue-9837.rs -ui/issues/issue-9906.rs -ui/issues/issue-9918.rs -ui/issues/issue-9942.rs -ui/issues/issue-9951.rs -ui/issues/issue-9968.rs -ui/issues/issue-99838.rs ui/iterators/issue-28098.rs ui/iterators/issue-58952-filter-type-length.rs ui/lang-items/issue-83471.rs diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index b9d22ece5975..4d195b3952e2 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -1,24 +1,12 @@ //! Tidy check to ensure below in UI test directories: -//! - the number of entries in each directory must be less than `ENTRY_LIMIT` //! - there are no stray `.stderr` files -use std::collections::{BTreeSet, HashMap}; +use std::collections::BTreeSet; use std::ffi::OsStr; use std::fs; use std::io::Write; use std::path::{Path, PathBuf}; -use ignore::Walk; - -// FIXME: GitHub's UI truncates file lists that exceed 1000 entries, so these -// should all be 1000 or lower. Limits significantly smaller than 1000 are also -// desirable, because large numbers of files are unwieldy in general. See issue -// #73494. -const ENTRY_LIMIT: u32 = 901; -// FIXME: The following limits should be reduced eventually. - -const ISSUES_ENTRY_LIMIT: u32 = 1616; - const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files "stderr", // expected stderr file, corresponds to a rs file @@ -54,42 +42,6 @@ const EXTENSION_EXCEPTION_PATHS: &[&str] = &[ "tests/ui/std/windows-bat-args3.bat", // tests escaping arguments through batch files ]; -fn check_entries(tests_path: &Path, bad: &mut bool) { - let mut directories: HashMap = HashMap::new(); - - for entry in Walk::new(tests_path.join("ui")).flatten() { - let parent = entry.path().parent().unwrap().to_path_buf(); - *directories.entry(parent).or_default() += 1; - } - - let (mut max, mut max_issues) = (0, 0); - for (dir_path, count) in directories { - let is_issues_dir = tests_path.join("ui/issues") == dir_path; - let (limit, maxcnt) = if is_issues_dir { - (ISSUES_ENTRY_LIMIT, &mut max_issues) - } else { - (ENTRY_LIMIT, &mut max) - }; - *maxcnt = (*maxcnt).max(count); - if count > limit { - tidy_error!( - bad, - "following path contains more than {} entries, \ - you should move the test to some relevant subdirectory (current: {}): {}", - limit, - count, - dir_path.display() - ); - } - } - if ISSUES_ENTRY_LIMIT > max_issues { - tidy_error!( - bad, - "`ISSUES_ENTRY_LIMIT` is too high (is {ISSUES_ENTRY_LIMIT}, should be {max_issues})" - ); - } -} - pub fn check(root_path: &Path, bless: bool, bad: &mut bool) { let issues_txt_header = r#"============================================================ ⚠️⚠️⚠️NOTHING SHOULD EVER BE ADDED TO THIS LIST⚠️⚠️⚠️ @@ -97,7 +49,6 @@ pub fn check(root_path: &Path, bless: bool, bad: &mut bool) { "#; let path = &root_path.join("tests"); - check_entries(path, bad); // the list of files in ui tests that are allowed to start with `issue-XXXX` // BTreeSet because we would like a stable ordering so --bless works @@ -179,7 +130,9 @@ pub fn check(root_path: &Path, bless: bool, bad: &mut bool) { .unwrap() .replace(std::path::MAIN_SEPARATOR_STR, "/"); - if !remaining_issue_names.remove(stripped_path.as_str()) { + if !remaining_issue_names.remove(stripped_path.as_str()) + && !stripped_path.starts_with("ui/issues/") + { tidy_error!( bad, "file `tests/{stripped_path}` must begin with a descriptive name, consider `{{reason}}-issue-{issue_n}.rs`", diff --git a/triagebot.toml b/triagebot.toml index 61d8a814c89e..4aec1251c7e7 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -1147,6 +1147,12 @@ cc = ["@nnethercote"] message = "Changes to the size of AST and/or HIR nodes." cc = ["@nnethercote"] +[mentions."tests/ui/issues"] +message = """ +This PR modifies `tests/ui/issues/`. If this PR is adding new tests to `tests/ui/issues/`, +please refrain from doing so, and instead add it to more descriptive subdirectories. +""" + [mentions."compiler/rustc_sanitizers"] cc = ["@rcvalle"] From 21768bb380495d5c771cad9b6eb2b877844f5a11 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Mon, 21 Jul 2025 14:02:02 +0800 Subject: [PATCH 147/183] Enforce PR CI jobs are a subset of Auto CI jobs (modulo carve-outs) To prevent possibility of a PR with red PR-only CI passing Auto CI, then all subsequent PR CI runs will be red until that is fixed. Note that this is **not** a "strict" subset relationship: some jobs necessarily have to differ under PR CI and Auto CI environments. For instance: - `x86_64-gnu-tools` will have auto-only env vars like `DEPLOY_TOOLSTATES_JSON: toolstates-linux.json`. - `tidy` will want to `continue_on_error: true` in PR CI to allow for more "useful" compilation errors to also be reported, whereas it needs to `continue_on_error: false` in Auto CI to prevent wasting Auto CI resources. The carve-outs are: 1. `env` variables. 2. `continue_on_error`. --- src/ci/citool/src/jobs.rs | 116 ++++++++++++++++- src/ci/citool/src/jobs/tests.rs | 220 ++++++++++++++++++++++++++++++++ src/ci/citool/tests/jobs.rs | 2 +- 3 files changed, 333 insertions(+), 5 deletions(-) diff --git a/src/ci/citool/src/jobs.rs b/src/ci/citool/src/jobs.rs index 410274227e4b..47516cbc1f4c 100644 --- a/src/ci/citool/src/jobs.rs +++ b/src/ci/citool/src/jobs.rs @@ -1,9 +1,9 @@ #[cfg(test)] mod tests; -use std::collections::BTreeMap; +use std::collections::{BTreeMap, HashSet}; -use anyhow::Context as _; +use anyhow::{Context as _, anyhow}; use serde_yaml::Value; use crate::GitHubContext; @@ -85,6 +85,10 @@ impl JobDatabase { .cloned() .collect() } + + fn find_auto_job_by_name(&self, job_name: &str) -> Option<&Job> { + self.auto_jobs.iter().find(|job| job.name == job_name) + } } pub fn load_job_db(db: &str) -> anyhow::Result { @@ -97,14 +101,118 @@ pub fn load_job_db(db: &str) -> anyhow::Result { db.apply_merge().context("failed to apply merge keys") }; - // Apply merge twice to handle nested merges + // Apply merge twice to handle nested merges up to depth 2. apply_merge(&mut db)?; apply_merge(&mut db)?; - let db: JobDatabase = serde_yaml::from_value(db).context("failed to parse job database")?; + let mut db: JobDatabase = serde_yaml::from_value(db).context("failed to parse job database")?; + + register_pr_jobs_as_auto_jobs(&mut db)?; + + validate_job_database(&db)?; + Ok(db) } +/// Maintain invariant that PR CI jobs must be a subset of Auto CI jobs modulo carve-outs. +/// +/// When PR jobs are auto-registered as Auto jobs, they will have `continue_on_error` overridden to +/// be `false` to avoid wasting Auto CI resources. +/// +/// When a job is already both a PR job and a auto job, we will post-validate their "equivalence +/// modulo certain carve-outs" in [`validate_job_database`]. +/// +/// This invariant is important to make sure that it's not easily possible (without modifying +/// `citool`) to have PRs with red PR-only CI jobs merged into `master`, causing all subsequent PR +/// CI runs to be red until the cause is fixed. +fn register_pr_jobs_as_auto_jobs(db: &mut JobDatabase) -> anyhow::Result<()> { + for pr_job in &db.pr_jobs { + // It's acceptable to "override" a PR job in Auto job, for instance, `x86_64-gnu-tools` will + // receive an additional `DEPLOY_TOOLSTATES_JSON: toolstates-linux.json` env when under Auto + // environment versus PR environment. + if db.find_auto_job_by_name(&pr_job.name).is_some() { + continue; + } + + let auto_registered_job = Job { continue_on_error: Some(false), ..pr_job.clone() }; + db.auto_jobs.push(auto_registered_job); + } + + Ok(()) +} + +fn validate_job_database(db: &JobDatabase) -> anyhow::Result<()> { + fn ensure_no_duplicate_job_names(section: &str, jobs: &Vec) -> anyhow::Result<()> { + let mut job_names = HashSet::new(); + for job in jobs { + let job_name = job.name.as_str(); + if !job_names.insert(job_name) { + return Err(anyhow::anyhow!( + "duplicate job name `{job_name}` in section `{section}`" + )); + } + } + Ok(()) + } + + ensure_no_duplicate_job_names("pr", &db.pr_jobs)?; + ensure_no_duplicate_job_names("auto", &db.auto_jobs)?; + ensure_no_duplicate_job_names("try", &db.try_jobs)?; + ensure_no_duplicate_job_names("optional", &db.optional_jobs)?; + + fn equivalent_modulo_carve_out(pr_job: &Job, auto_job: &Job) -> anyhow::Result<()> { + let Job { + name, + os, + only_on_channel, + free_disk, + doc_url, + codebuild, + + // Carve-out configs allowed to be different. + env: _, + continue_on_error: _, + } = pr_job; + + if *name == auto_job.name + && *os == auto_job.os + && *only_on_channel == auto_job.only_on_channel + && *free_disk == auto_job.free_disk + && *doc_url == auto_job.doc_url + && *codebuild == auto_job.codebuild + { + Ok(()) + } else { + Err(anyhow!( + "PR job `{}` differs from corresponding Auto job `{}` in configuration other than `continue_on_error` and `env`", + pr_job.name, + auto_job.name + )) + } + } + + for pr_job in &db.pr_jobs { + // At this point, any PR job must also be an Auto job, auto-registered or overridden. + let auto_job = db + .find_auto_job_by_name(&pr_job.name) + .expect("PR job must either be auto-registered as Auto job or overridden"); + + equivalent_modulo_carve_out(pr_job, auto_job)?; + } + + // Auto CI jobs must all "fail-fast" to avoid wasting Auto CI resources. For instance, `tidy`. + for auto_job in &db.auto_jobs { + if auto_job.continue_on_error == Some(true) { + return Err(anyhow!( + "Auto job `{}` cannot have `continue_on_error: true`", + auto_job.name + )); + } + } + + Ok(()) +} + /// Representation of a job outputted to a GitHub Actions workflow. #[derive(serde::Serialize, Debug)] struct GithubActionsJob { diff --git a/src/ci/citool/src/jobs/tests.rs b/src/ci/citool/src/jobs/tests.rs index 63ac508b632e..f1f6274e1ed7 100644 --- a/src/ci/citool/src/jobs/tests.rs +++ b/src/ci/citool/src/jobs/tests.rs @@ -1,3 +1,4 @@ +use std::collections::BTreeMap; use std::path::Path; use super::Job; @@ -146,3 +147,222 @@ fn validate_jobs() { panic!("Job validation failed:\n{error_messages}"); } } + +#[test] +fn pr_job_implies_auto_job() { + let db = load_job_db( + r#" +envs: + pr: + try: + auto: + optional: + +pr: + - name: pr-ci-a + os: ubuntu + env: {} +try: +auto: +optional: +"#, + ) + .unwrap(); + + assert_eq!(db.auto_jobs.iter().map(|j| j.name.as_str()).collect::>(), vec!["pr-ci-a"]) +} + +#[test] +fn implied_auto_job_keeps_env_and_fails_fast() { + let db = load_job_db( + r#" +envs: + pr: + try: + auto: + optional: + +pr: + - name: tidy + env: + DEPLOY_TOOLSTATES_JSON: toolstates-linux.json + continue_on_error: true + os: ubuntu +try: +auto: +optional: +"#, + ) + .unwrap(); + + assert_eq!(db.auto_jobs.iter().map(|j| j.name.as_str()).collect::>(), vec!["tidy"]); + assert_eq!(db.auto_jobs[0].continue_on_error, Some(false)); + assert_eq!( + db.auto_jobs[0].env, + BTreeMap::from([( + "DEPLOY_TOOLSTATES_JSON".to_string(), + serde_yaml::Value::String("toolstates-linux.json".to_string()) + )]) + ); +} + +#[test] +#[should_panic = "duplicate"] +fn duplicate_job_name() { + let _ = load_job_db( + r#" +envs: + pr: + try: + auto: + + +pr: + - name: pr-ci-a + os: ubuntu + env: {} + - name: pr-ci-a + os: ubuntu + env: {} +try: +auto: +optional: +"#, + ) + .unwrap(); +} + +#[test] +fn auto_job_can_override_pr_job_spec() { + let db = load_job_db( + r#" +envs: + pr: + try: + auto: + optional: + +pr: + - name: tidy + os: ubuntu + env: {} +try: +auto: + - name: tidy + env: + DEPLOY_TOOLSTATES_JSON: toolstates-linux.json + continue_on_error: false + os: ubuntu +optional: +"#, + ) + .unwrap(); + + assert_eq!(db.auto_jobs.iter().map(|j| j.name.as_str()).collect::>(), vec!["tidy"]); + assert_eq!(db.auto_jobs[0].continue_on_error, Some(false)); + assert_eq!( + db.auto_jobs[0].env, + BTreeMap::from([( + "DEPLOY_TOOLSTATES_JSON".to_string(), + serde_yaml::Value::String("toolstates-linux.json".to_string()) + )]) + ); +} + +#[test] +fn compatible_divergence_pr_auto_job() { + let db = load_job_db( + r#" +envs: + pr: + try: + auto: + optional: + +pr: + - name: tidy + continue_on_error: true + env: + ENV_ALLOWED_TO_DIFFER: "hello world" + os: ubuntu +try: +auto: + - name: tidy + continue_on_error: false + env: + ENV_ALLOWED_TO_DIFFER: "goodbye world" + os: ubuntu +optional: +"#, + ) + .unwrap(); + + // `continue_on_error` and `env` are carve-outs *allowed* to diverge between PR and Auto job of + // the same name. Should load successfully. + + assert_eq!(db.auto_jobs.iter().map(|j| j.name.as_str()).collect::>(), vec!["tidy"]); + assert_eq!(db.auto_jobs[0].continue_on_error, Some(false)); + assert_eq!( + db.auto_jobs[0].env, + BTreeMap::from([( + "ENV_ALLOWED_TO_DIFFER".to_string(), + serde_yaml::Value::String("goodbye world".to_string()) + )]) + ); +} + +#[test] +#[should_panic = "differs"] +fn incompatible_divergence_pr_auto_job() { + // `os` is not one of the carve-out options allowed to diverge. This should fail. + let _ = load_job_db( + r#" +envs: + pr: + try: + auto: + optional: + +pr: + - name: tidy + continue_on_error: true + env: + ENV_ALLOWED_TO_DIFFER: "hello world" + os: ubuntu +try: +auto: + - name: tidy + continue_on_error: false + env: + ENV_ALLOWED_TO_DIFFER: "goodbye world" + os: windows +optional: +"#, + ) + .unwrap(); +} + +#[test] +#[should_panic = "cannot have `continue_on_error: true`"] +fn auto_job_continue_on_error() { + // Auto CI jobs must fail-fast. + let _ = load_job_db( + r#" +envs: + pr: + try: + auto: + optional: + +pr: +try: +auto: + - name: tidy + continue_on_error: true + os: windows + env: {} +optional: +"#, + ) + .unwrap(); +} diff --git a/src/ci/citool/tests/jobs.rs b/src/ci/citool/tests/jobs.rs index dbaf13d4f428..24e0b85cab22 100644 --- a/src/ci/citool/tests/jobs.rs +++ b/src/ci/citool/tests/jobs.rs @@ -6,7 +6,7 @@ const TEST_JOBS_YML_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/tes fn auto_jobs() { let stdout = get_matrix("push", "commit", "refs/heads/auto"); insta::assert_snapshot!(stdout, @r#" - jobs=[{"name":"aarch64-gnu","full_name":"auto - aarch64-gnu","os":"ubuntu-22.04-arm","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"x86_64-gnu-llvm-18-1","full_name":"auto - x86_64-gnu-llvm-18-1","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","DOCKER_SCRIPT":"stage_2_test_set1.sh","IMAGE":"x86_64-gnu-llvm-18","READ_ONLY_SRC":"0","RUST_BACKTRACE":1,"TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"aarch64-apple","full_name":"auto - aarch64-apple","os":"macos-14","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","MACOSX_DEPLOYMENT_TARGET":11.0,"MACOSX_STD_DEPLOYMENT_TARGET":11.0,"NO_DEBUG_ASSERTIONS":1,"NO_LLVM_ASSERTIONS":1,"NO_OVERFLOW_CHECKS":1,"RUSTC_RETRY_LINKER_ON_SEGFAULT":1,"RUST_CONFIGURE_ARGS":"--enable-sanitizers --enable-profiler --set rust.jemalloc","SCRIPT":"./x.py --stage 2 test --host=aarch64-apple-darwin --target=aarch64-apple-darwin","SELECT_XCODE":"/Applications/Xcode_15.4.app","TOOLSTATE_PUBLISH":1,"USE_XCODE_CLANG":1}},{"name":"dist-i686-msvc","full_name":"auto - dist-i686-msvc","os":"windows-2022","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","CODEGEN_BACKENDS":"llvm,cranelift","DEPLOY_BUCKET":"rust-lang-ci2","DIST_REQUIRE_ALL_TOOLS":1,"RUST_CONFIGURE_ARGS":"--build=i686-pc-windows-msvc --host=i686-pc-windows-msvc --target=i686-pc-windows-msvc,i586-pc-windows-msvc --enable-full-tools --enable-profiler","SCRIPT":"python x.py dist bootstrap --include-default-paths","TOOLSTATE_PUBLISH":1}}] + jobs=[{"name":"aarch64-gnu","full_name":"auto - aarch64-gnu","os":"ubuntu-22.04-arm","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"x86_64-gnu-llvm-18-1","full_name":"auto - x86_64-gnu-llvm-18-1","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","DOCKER_SCRIPT":"stage_2_test_set1.sh","IMAGE":"x86_64-gnu-llvm-18","READ_ONLY_SRC":"0","RUST_BACKTRACE":1,"TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"aarch64-apple","full_name":"auto - aarch64-apple","os":"macos-14","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","MACOSX_DEPLOYMENT_TARGET":11.0,"MACOSX_STD_DEPLOYMENT_TARGET":11.0,"NO_DEBUG_ASSERTIONS":1,"NO_LLVM_ASSERTIONS":1,"NO_OVERFLOW_CHECKS":1,"RUSTC_RETRY_LINKER_ON_SEGFAULT":1,"RUST_CONFIGURE_ARGS":"--enable-sanitizers --enable-profiler --set rust.jemalloc","SCRIPT":"./x.py --stage 2 test --host=aarch64-apple-darwin --target=aarch64-apple-darwin","SELECT_XCODE":"/Applications/Xcode_15.4.app","TOOLSTATE_PUBLISH":1,"USE_XCODE_CLANG":1}},{"name":"dist-i686-msvc","full_name":"auto - dist-i686-msvc","os":"windows-2022","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","CODEGEN_BACKENDS":"llvm,cranelift","DEPLOY_BUCKET":"rust-lang-ci2","DIST_REQUIRE_ALL_TOOLS":1,"RUST_CONFIGURE_ARGS":"--build=i686-pc-windows-msvc --host=i686-pc-windows-msvc --target=i686-pc-windows-msvc,i586-pc-windows-msvc --enable-full-tools --enable-profiler","SCRIPT":"python x.py dist bootstrap --include-default-paths","TOOLSTATE_PUBLISH":1}},{"name":"pr-check-1","full_name":"auto - pr-check-1","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true},{"name":"pr-check-2","full_name":"auto - pr-check-2","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true},{"name":"tidy","full_name":"auto - tidy","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true,"doc_url":"https://foo.bar"}] run_type=auto "#); } From fc4bf03a81592b112abfd7274606af1c6919c3f6 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Mon, 21 Jul 2025 14:43:17 +0800 Subject: [PATCH 148/183] Remove spellcheck workflow Unfortunately, the separate spellcheck GHA workflow does not really work with homu, if we would like to enforce the invariant that PR CI is a subset of Full CI (modulo carve outs). This is not prejudice against a reland of a `typos`-based spellcheck, it just probably has to go through the "usual" CI flow with bootstrap, so that it can work with homu. --- .github/workflows/spellcheck.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/spellcheck.yml diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml deleted file mode 100644 index 7e21bb1b7ffb..000000000000 --- a/.github/workflows/spellcheck.yml +++ /dev/null @@ -1,23 +0,0 @@ -# This workflow runs spellcheck job - -name: Spellcheck -on: - pull_request: - branches: - - "**" - -jobs: - spellcheck: - name: run spellchecker - runs-on: ubuntu-latest - steps: - - name: Checkout the source code - uses: actions/checkout@v4 - - - name: check typos - # sync version with src/tools/tidy/src/ext_tool_checks.rs in spellcheck_runner - uses: crate-ci/typos@v1.34.0 - with: - # sync target files with src/tools/tidy/src/ext_tool_checks.rs in check_impl - files: ./compiler ./library ./src/bootstrap ./src/librustdoc - config: ./typos.toml From 523594d7aec3293c6f1926e4f1edcec141ef496b Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Mon, 21 Jul 2025 15:20:35 +0800 Subject: [PATCH 149/183] Update `jobs.yml` docs to reflect subset-modulo-carve-outs relationship --- src/ci/github-actions/jobs.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index 0a6ebe44b3d7..011688487b44 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -124,9 +124,16 @@ jobs: <<: *job-linux-36c-codebuild -# Jobs that run on each push to a pull request (PR) -# These jobs automatically inherit envs.pr, to avoid repeating -# it in each job definition. +# Jobs that run on each push to a pull request (PR). +# +# These jobs automatically inherit envs.pr, to avoid repeating it in each job +# definition. +# +# PR CI jobs will be automatically registered as Auto CI jobs or overriden. When +# automatically registered, the PR CI job configuration will be copied as an +# Auto CI job but with `continue_on_error` overriden to `false` (to fail-fast). +# When overriden, `citool` will check for equivalence between the PR and CI job +# of the same name modulo `continue_on_error` and `env`. pr: - name: pr-check-1 <<: *job-linux-4c @@ -177,9 +184,15 @@ optional: IMAGE: pr-check-1 <<: *job-linux-4c -# Main CI jobs that have to be green to merge a commit into master -# These jobs automatically inherit envs.auto, to avoid repeating -# it in each job definition. +# Main CI jobs that have to be green to merge a commit into master. +# +# These jobs automatically inherit envs.auto, to avoid repeating it in each job +# definition. +# +# Auto jobs may not specify `continue_on_error: true`, and thus will fail-fast. +# +# Unless explicitly overriden, PR CI jobs will be automatically registered as +# Auto CI jobs. auto: ############################# # Linux/Docker builders # From 58537fb869a8e08d5146e8feab982f17b3fd990a Mon Sep 17 00:00:00 2001 From: roblabla Date: Mon, 21 Jul 2025 01:32:26 +0200 Subject: [PATCH 150/183] Fix broken TLS destructors on 32-bit win7 On the 32-bit win7 target, we use OS TLS instead of native TLS, due to issues with how the OS handles alignment. Unfortunately, this caused issues due to the TLS destructors not running, causing memory leaks among other problems. On Windows, to support OS TLS, the TlsAlloc family of function is used by Rust. This function does not support TLS destructors at all. However, rust has some code to emulate those destructors, by leveraging the TLS support functionality found in the MSVC CRT (specifically, in tlssup.c of the CRT). Specifically, the CRT provides the ability to register callbacks that are called (among other things) on thread destruction. By registering our own callback, we can run through a list of registered destructors functions to execute. To use this functionality, the user must do two things: 1. They must put the address to their callback in a section between `.CRT$XLB` and `.CRT$XLY`. 2. They must add a reference to `_tls_used` (or `__tls_used` on x86) to make sure the TLS support code in tlssup.c isn't garbage collected by the linker. Prior to this commit, this second bit wasn't being done properly by the Rust TLS support code. Instead of adding a reference to _tls_used, it instead had a reference to its own callback to prevent it from getting GC'd by the linker. While this is _also_ necessary, not having a reference on _tls_used made the entire support non-functional. This commit reworks the code to: 1. Add an unconditional `#[used]` attribute on the CALLBACK, which should be enough to prevent it from getting GC'd by the linker. 2. Add a reference to `_tls_used`, which should pull the TLS support code into the Rust programs and not let it be GC'd by the linker. --- .../std/src/sys/thread_local/guard/windows.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/library/std/src/sys/thread_local/guard/windows.rs b/library/std/src/sys/thread_local/guard/windows.rs index b15a0d7c0bdf..f747129465d6 100644 --- a/library/std/src/sys/thread_local/guard/windows.rs +++ b/library/std/src/sys/thread_local/guard/windows.rs @@ -58,7 +58,7 @@ //! We don't actually use the `/INCLUDE` linker flag here like the article //! mentions because the Rust compiler doesn't propagate linker flags, but //! instead we use a shim function which performs a volatile 1-byte load from -//! the address of the symbol to ensure it sticks around. +//! the address of the _tls_used symbol to ensure it sticks around. //! //! [1]: https://www.codeproject.com/Articles/8113/Thread-Local-Storage-The-C-Way //! [2]: https://github.com/ChromiumWebApps/chromium/blob/master/base/threading/thread_local_storage_win.cc#L42 @@ -68,9 +68,20 @@ use core::ffi::c_void; use crate::ptr; use crate::sys::c; +unsafe extern "C" { + #[link_name = "_tls_used"] + static TLS_USED: u8; +} pub fn enable() { - // When destructors are used, we don't want LLVM eliminating CALLBACK for any - // reason. Once the symbol makes it to the linker, it will do the rest. + // When destructors are used, we need to add a reference to the _tls_used + // symbol provided by the CRT, otherwise the TLS support code will get + // GC'd by the linker and our callback won't be called. + unsafe { ptr::from_ref(&TLS_USED).read_volatile() }; + // We also need to reference CALLBACK to make sure it does not get GC'd + // by the compiler/LLVM. The callback will end up inside the TLS + // callback array pointed to by _TLS_USED through linker shenanigans, + // but as far as the compiler is concerned, it looks like the data is + // unused, so we need this hack to prevent it from disappearing. unsafe { ptr::from_ref(&CALLBACK).read_volatile() }; } From c193f3039f561aad497fdaced3f320bd889bdb0d Mon Sep 17 00:00:00 2001 From: Maksim Bondarenkov Date: Mon, 21 Jul 2025 15:47:37 +0300 Subject: [PATCH 151/183] opt-dist: make `artifact-dir` an absolute path for `opt-dist local` ...like for CI environments. the same logic applied as for `build_dir`. fixes the issue where some intermediate steps fail due to path being relative to an active directory --- src/tools/opt-dist/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/opt-dist/src/main.rs b/src/tools/opt-dist/src/main.rs index d0e6badede6e..42170ff39d72 100644 --- a/src/tools/opt-dist/src/main.rs +++ b/src/tools/opt-dist/src/main.rs @@ -62,7 +62,7 @@ enum EnvironmentCmd { python: String, /// Directory where artifacts (like PGO profiles or rustc-perf) of this workflow - /// will be stored. + /// will be stored. Relative to `checkout_dir` #[arg(long, default_value = "opt-artifacts")] artifact_dir: Utf8PathBuf, @@ -150,7 +150,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec)> .python_binary(python) .checkout_dir(checkout_dir.clone()) .host_llvm_dir(llvm_dir) - .artifact_dir(artifact_dir) + .artifact_dir(checkout_dir.join(artifact_dir)) .build_dir(checkout_dir.join(build_dir)) .prebuilt_rustc_perf(rustc_perf_checkout_dir) .shared_llvm(llvm_shared) From fa924641d67a510a1101b79bbc2cea4f5360135e Mon Sep 17 00:00:00 2001 From: Maksim Bondarenkov Date: Mon, 21 Jul 2025 15:58:38 +0300 Subject: [PATCH 152/183] opt-dist: add an option for setting path to stage0 root in MSYS2 we have problems with stage0 for *-gnullvm hosts because prebuilt dist tarballs will be available starting from 1.90.0-beta. also this change helps to match bootstrap.toml config --- src/tools/opt-dist/src/environment.rs | 16 ++++++++-------- src/tools/opt-dist/src/main.rs | 6 ++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/tools/opt-dist/src/environment.rs b/src/tools/opt-dist/src/environment.rs index e6e4c711c0cb..2cae0785f33b 100644 --- a/src/tools/opt-dist/src/environment.rs +++ b/src/tools/opt-dist/src/environment.rs @@ -28,6 +28,8 @@ pub struct Environment { run_tests: bool, fast_try_build: bool, build_llvm: bool, + #[builder(default)] + stage0_root: Option, } impl Environment { @@ -56,17 +58,11 @@ impl Environment { } pub fn cargo_stage_0(&self) -> Utf8PathBuf { - self.build_artifacts() - .join("stage0") - .join("bin") - .join(format!("cargo{}", executable_extension())) + self.stage0().join("bin").join(format!("cargo{}", executable_extension())) } pub fn rustc_stage_0(&self) -> Utf8PathBuf { - self.build_artifacts() - .join("stage0") - .join("bin") - .join(format!("rustc{}", executable_extension())) + self.stage0().join("bin").join(format!("rustc{}", executable_extension())) } pub fn rustc_stage_2(&self) -> Utf8PathBuf { @@ -116,6 +112,10 @@ impl Environment { pub fn build_llvm(&self) -> bool { self.build_llvm } + + pub fn stage0(&self) -> Utf8PathBuf { + self.stage0_root.clone().unwrap_or_else(|| self.build_artifacts().join("stage0")) + } } /// What is the extension of binary executables on this platform? diff --git a/src/tools/opt-dist/src/main.rs b/src/tools/opt-dist/src/main.rs index d0e6badede6e..f46a86f507cc 100644 --- a/src/tools/opt-dist/src/main.rs +++ b/src/tools/opt-dist/src/main.rs @@ -107,6 +107,10 @@ enum EnvironmentCmd { /// in bootstrap.toml via `build.build-dir` option #[arg(long, default_value = "build")] build_dir: Utf8PathBuf, + + /// Path to custom stage0 root + #[arg(long)] + stage0_root: Option, }, /// Perform an optimized build on Linux CI, from inside Docker. LinuxCi { @@ -144,6 +148,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec)> run_tests, build_llvm, build_dir, + stage0_root, } => { let env = EnvironmentBuilder::default() .host_tuple(target_triple) @@ -160,6 +165,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec)> .run_tests(run_tests) .fast_try_build(is_fast_try_build) .build_llvm(build_llvm) + .stage0_root(stage0_root) .build()?; (env, shared.build_args) From b2f8b406335310f885a0d2d21ff8472b6a5f9ce5 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 21 Jul 2025 13:16:10 +0000 Subject: [PATCH 153/183] Don't ICE on non-TypeId metadata within TypeId --- .../rustc_const_eval/src/interpret/memory.rs | 2 +- tests/ui/consts/const_transmute_type_id6.rs | 16 ++++++++++++++++ tests/ui/consts/const_transmute_type_id6.stderr | 15 +++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/ui/consts/const_transmute_type_id6.rs create mode 100644 tests/ui/consts/const_transmute_type_id6.stderr diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index 20c8e983ceae..20825d2ad9b5 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -997,7 +997,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { ptr: Pointer>, ) -> InterpResult<'tcx, (Ty<'tcx>, u64)> { let (alloc_id, offset, _meta) = self.ptr_get_alloc_id(ptr, 0)?; - let GlobalAlloc::TypeId { ty } = self.tcx.global_alloc(alloc_id) else { + let Some(GlobalAlloc::TypeId { ty }) = self.tcx.try_get_global_alloc(alloc_id) else { throw_ub_format!("invalid `TypeId` value: not all bytes carry type id metadata") }; interp_ok((ty, offset.bytes())) diff --git a/tests/ui/consts/const_transmute_type_id6.rs b/tests/ui/consts/const_transmute_type_id6.rs new file mode 100644 index 000000000000..668eb0bb2b0f --- /dev/null +++ b/tests/ui/consts/const_transmute_type_id6.rs @@ -0,0 +1,16 @@ +//! Test that we do not ICE and that we do report an error +//! when placing non-TypeId provenance into a TypeId. + +#![feature(const_trait_impl, const_cmp)] + +use std::any::TypeId; +use std::mem::transmute; + +const X: bool = { + let a = (); + let id: TypeId = unsafe { transmute([&raw const a; 16 / size_of::<*const ()>()]) }; + id == id + //~^ ERROR: invalid `TypeId` value: not all bytes carry type id metadata +}; + +fn main() {} diff --git a/tests/ui/consts/const_transmute_type_id6.stderr b/tests/ui/consts/const_transmute_type_id6.stderr new file mode 100644 index 000000000000..f5d90256e7c6 --- /dev/null +++ b/tests/ui/consts/const_transmute_type_id6.stderr @@ -0,0 +1,15 @@ +error[E0080]: invalid `TypeId` value: not all bytes carry type id metadata + --> $DIR/const_transmute_type_id6.rs:12:5 + | +LL | id == id + | ^^^^^^^^ evaluation of `X` failed inside this call + | +note: inside `::eq` + --> $SRC_DIR/core/src/any.rs:LL:COL +note: inside `::eq::compiletime` + --> $SRC_DIR/core/src/any.rs:LL:COL + = note: this error originates in the macro `$crate::intrinsics::const_eval_select` which comes from the expansion of the macro `crate::intrinsics::const_eval_select` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. From 4ca5afdc7ac807da8e1beac0813515cc36ef1ac0 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 18 Jul 2025 17:09:29 +0530 Subject: [PATCH 154/183] add default_lld_opt_in_targets method and modified test accordingly add test for lld opt in and also add thread_local defined state to change opt in targets make the config lld test parameter smoother to work, and have no_llvm_config set even when target_config is not present --- src/bootstrap/src/core/builder/tests.rs | 25 ++++++++++++++++-- src/bootstrap/src/core/config/toml/rust.rs | 30 ++++++++++++++++++++-- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 7f0c6fbd8545..81a526593b4d 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -642,6 +642,7 @@ mod snapshot { }; use crate::core::builder::{Builder, Kind, StepDescription, StepMetadata}; use crate::core::config::TargetSelection; + use crate::core::config::toml::rust::with_lld_opt_in_targets; use crate::utils::cache::Cache; use crate::utils::helpers::get_host_target; use crate::utils::tests::{ConfigBuilder, TestCtx}; @@ -1638,12 +1639,33 @@ mod snapshot { .render_steps(), @r" [build] llvm [build] rustc 0 -> rustc 1 - [build] rustc 0 -> LldWrapper 1 [build] rustdoc 0 [doc] std 1 crates=[core] "); } + #[test] + fn test_lld_opt_in() { + let target: &'static str = Box::leak(Box::new(host_target())); + let slice: &'static [&'static str] = Box::leak(Box::new([target])); + + with_lld_opt_in_targets(slice, || { + let ctx = TestCtx::new(); + + insta::assert_snapshot!( + ctx.config("doc") + .path("core") + .override_target_no_std(&host_target()) + .render_steps(), @r" + [build] llvm + [build] rustc 0 -> rustc 1 + [build] rustc 0 -> LldWrapper 1 + [build] rustdoc 0 + [doc] std 1 crates=[core] + "); + }); + } + #[test] fn doc_library_no_std_target() { let ctx = TestCtx::new(); @@ -1654,7 +1676,6 @@ mod snapshot { .render_steps(), @r" [build] llvm [build] rustc 0 -> rustc 1 - [build] rustc 0 -> LldWrapper 1 [build] rustdoc 0 [doc] std 1 crates=[alloc,core] "); diff --git a/src/bootstrap/src/core/config/toml/rust.rs b/src/bootstrap/src/core/config/toml/rust.rs index 307aa52294ba..60484ee9e907 100644 --- a/src/bootstrap/src/core/config/toml/rust.rs +++ b/src/bootstrap/src/core/config/toml/rust.rs @@ -410,6 +410,31 @@ pub(crate) fn validate_codegen_backends(backends: Vec, section: &str) -> backends } +#[cfg(not(test))] +fn default_lld_opt_in_targets() -> Vec { + vec!["x86_64-unknown-linux-gnu".to_string()] +} + +#[cfg(test)] +thread_local! { + static TEST_LLD_OPT_IN_TARGETS: std::cell::RefCell>> = std::cell::RefCell::new(None); +} + +#[cfg(test)] +fn default_lld_opt_in_targets() -> Vec { + TEST_LLD_OPT_IN_TARGETS.with(|cell| cell.borrow().clone()).unwrap_or_default() +} + +#[cfg(test)] +pub fn with_lld_opt_in_targets(targets: Vec, f: impl FnOnce() -> R) -> R { + TEST_LLD_OPT_IN_TARGETS.with(|cell| { + let prev = cell.replace(Some(targets)); + let result = f(); + cell.replace(prev); + result + }) +} + impl Config { pub fn apply_rust_config(&mut self, toml_rust: Option, warnings: Warnings) { let mut debug = None; @@ -609,12 +634,13 @@ impl Config { // thus, disabled // - similarly, lld will not be built nor used by default when explicitly asked not to, e.g. // when the config sets `rust.lld = false` - if self.host_target.triple == "x86_64-unknown-linux-gnu" && self.hosts == [self.host_target] + if default_lld_opt_in_targets().contains(&self.host_target.triple.to_string()) + && self.hosts == [self.host_target] { let no_llvm_config = self .target_config .get(&self.host_target) - .is_some_and(|target_config| target_config.llvm_config.is_none()); + .is_none_or(|target_config| target_config.llvm_config.is_none()); let enable_lld = self.llvm_from_ci || no_llvm_config; // Prefer the config setting in case an explicit opt-out is needed. self.lld_enabled = lld_enabled.unwrap_or(enable_lld); From fb10084b84b23e042c8888490c771ae5a315cfab Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Mon, 21 Jul 2025 20:10:58 +0530 Subject: [PATCH 155/183] add test_lld_opt_in test --- src/bootstrap/src/core/builder/tests.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 81a526593b4d..4cc57996f3ff 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -1646,22 +1646,15 @@ mod snapshot { #[test] fn test_lld_opt_in() { - let target: &'static str = Box::leak(Box::new(host_target())); - let slice: &'static [&'static str] = Box::leak(Box::new([target])); - - with_lld_opt_in_targets(slice, || { + with_lld_opt_in_targets(vec![host_target()], || { let ctx = TestCtx::new(); - insta::assert_snapshot!( - ctx.config("doc") - .path("core") - .override_target_no_std(&host_target()) + ctx.config("build") + .path("compiler") .render_steps(), @r" [build] llvm [build] rustc 0 -> rustc 1 [build] rustc 0 -> LldWrapper 1 - [build] rustdoc 0 - [doc] std 1 crates=[core] "); }); } From b5d36e5294d3354ad8feec86b27c698e368c88a6 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 21 Jul 2025 16:07:12 +0000 Subject: [PATCH 156/183] Dont ICE on copy error being suppressed due to overflow --- .../src/diagnostics/move_errors.rs | 9 +++++---- tests/ui/borrowck/copy-overflow.rs | 16 ++++++++++++++++ tests/ui/borrowck/copy-overflow.stderr | 15 +++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 tests/ui/borrowck/copy-overflow.rs create mode 100644 tests/ui/borrowck/copy-overflow.stderr diff --git a/compiler/rustc_borrowck/src/diagnostics/move_errors.rs b/compiler/rustc_borrowck/src/diagnostics/move_errors.rs index 92ca868eb992..447bf7d091a7 100644 --- a/compiler/rustc_borrowck/src/diagnostics/move_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/move_errors.rs @@ -303,10 +303,11 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { } fn has_ambiguous_copy(&mut self, ty: Ty<'tcx>) -> bool { - let Some(copy_trait_def) = self.infcx.tcx.lang_items().copy_trait() else { return false }; - // This is only going to be ambiguous if there are incoherent impls, because otherwise - // ambiguity should never happen in MIR. - self.infcx.type_implements_trait(copy_trait_def, [ty], self.infcx.param_env).may_apply() + let Some(copy_def_id) = self.infcx.tcx.lang_items().copy_trait() else { return false }; + + // Avoid bogus move errors because of an incoherent `Copy` impl. + self.infcx.type_implements_trait(copy_def_id, [ty], self.infcx.param_env).may_apply() + && self.infcx.tcx.coherent_trait(copy_def_id).is_err() } fn report_cannot_move_from_static(&mut self, place: Place<'tcx>, span: Span) -> Diag<'infcx> { diff --git a/tests/ui/borrowck/copy-overflow.rs b/tests/ui/borrowck/copy-overflow.rs new file mode 100644 index 000000000000..5aa1afdee68e --- /dev/null +++ b/tests/ui/borrowck/copy-overflow.rs @@ -0,0 +1,16 @@ +// Regression test for . + +// We were previously suppressing the copy error in the `Clone` impl because we assumed +// that the only way we get `Copy` ambiguity errors was due to incoherent impls. This is +// not true, since ambiguities can be encountered due to overflows (among other ways). + +struct S(Option<&'static T>); + +impl Copy for S where S: Copy + Clone {} +impl Clone for S { + fn clone(&self) -> Self { + *self + //~^ ERROR cannot move out of `*self` which is behind a shared reference + } +} +fn main() {} diff --git a/tests/ui/borrowck/copy-overflow.stderr b/tests/ui/borrowck/copy-overflow.stderr new file mode 100644 index 000000000000..3f601276f8fd --- /dev/null +++ b/tests/ui/borrowck/copy-overflow.stderr @@ -0,0 +1,15 @@ +error[E0507]: cannot move out of `*self` which is behind a shared reference + --> $DIR/copy-overflow.rs:12:9 + | +LL | *self + | ^^^^^ move occurs because `*self` has type `S`, which does not implement the `Copy` trait + | +help: consider cloning the value if the performance cost is acceptable + | +LL - *self +LL + self.clone() + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0507`. From b1d88ba086ee6f34584ed4e8eb09761a03fe249d Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Tue, 22 Jul 2025 01:43:44 +0000 Subject: [PATCH 157/183] Keep elaborating predicates. --- .../src/impossible_predicates.rs | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/compiler/rustc_mir_transform/src/impossible_predicates.rs b/compiler/rustc_mir_transform/src/impossible_predicates.rs index 9a0de3c93263..b03518de00a9 100644 --- a/compiler/rustc_mir_transform/src/impossible_predicates.rs +++ b/compiler/rustc_mir_transform/src/impossible_predicates.rs @@ -41,18 +41,15 @@ impl<'tcx> MirPass<'tcx> for ImpossiblePredicates { tracing::trace!(def_id = ?body.source.def_id()); let predicates = tcx.predicates_of(body.source.def_id()).instantiate_identity(tcx); tracing::trace!(?predicates); - let predicates: Vec<_> = predicates - .predicates - .into_iter() - .filter(|p| { - !p.has_type_flags( - // Only consider global clauses to simplify. - TypeFlags::HAS_FREE_LOCAL_NAMES - // Clauses that refer to unevaluated constants as they cause cycles. - | TypeFlags::HAS_CT_PROJECTION, - ) - }) - .collect(); + let predicates = predicates.predicates.into_iter().filter(|p| { + !p.has_type_flags( + // Only consider global clauses to simplify. + TypeFlags::HAS_FREE_LOCAL_NAMES + // Clauses that refer to unevaluated constants as they cause cycles. + | TypeFlags::HAS_CT_PROJECTION, + ) + }); + let predicates: Vec<_> = traits::elaborate(tcx, predicates).collect(); tracing::trace!(?predicates); if predicates.references_error() || traits::impossible_predicates(tcx, predicates) { trace!("found unsatisfiable predicates"); From 3c81faec23161d3f997666e90e6e34747ace6d28 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Thu, 3 Jul 2025 22:24:21 +0000 Subject: [PATCH 158/183] Implement AST visitors using a derive macro. --- compiler/rustc_ast/src/ast.rs | 285 +-- compiler/rustc_ast/src/format.rs | 20 +- compiler/rustc_ast/src/mut_visit.rs | 259 ++- compiler/rustc_ast/src/tokenstream.rs | 4 +- compiler/rustc_ast/src/visit.rs | 2233 ++++++++---------------- compiler/rustc_macros/src/lib.rs | 11 + compiler/rustc_macros/src/visitable.rs | 82 + 7 files changed, 1219 insertions(+), 1675 deletions(-) create mode 100644 compiler/rustc_macros/src/visitable.rs diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 8c2b521c560d..97e070958751 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -28,7 +28,7 @@ use rustc_data_structures::packed::Pu128; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_data_structures::tagged_ptr::Tag; -use rustc_macros::{Decodable, Encodable, HashStable_Generic}; +use rustc_macros::{Decodable, Encodable, HashStable_Generic, Walkable}; pub use rustc_span::AttrId; use rustc_span::source_map::{Spanned, respan}; use rustc_span::{ByteSymbol, DUMMY_SP, ErrorGuaranteed, Ident, Span, Symbol, kw, sym}; @@ -39,6 +39,7 @@ use crate::ptr::P; use crate::token::{self, CommentKind, Delimiter}; use crate::tokenstream::{DelimSpan, LazyAttrTokenStream, TokenStream}; use crate::util::parser::{ExprPrecedence, Fixity}; +use crate::visit::{AssocCtxt, BoundKind, LifetimeCtxt}; /// A "Label" is an identifier of some point in sources, /// e.g. in the following code: @@ -50,7 +51,7 @@ use crate::util::parser::{ExprPrecedence, Fixity}; /// ``` /// /// `'outer` is a label. -#[derive(Clone, Encodable, Decodable, Copy, HashStable_Generic, Eq, PartialEq)] +#[derive(Clone, Encodable, Decodable, Copy, HashStable_Generic, Eq, PartialEq, Walkable)] pub struct Label { pub ident: Ident, } @@ -63,7 +64,7 @@ impl fmt::Debug for Label { /// A "Lifetime" is an annotation of the scope in which variable /// can be used, e.g. `'a` in `&'a i32`. -#[derive(Clone, Encodable, Decodable, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, Encodable, Decodable, Copy, PartialEq, Eq, Hash, Walkable)] pub struct Lifetime { pub id: NodeId, pub ident: Ident, @@ -87,7 +88,7 @@ impl fmt::Display for Lifetime { /// along with a bunch of supporting information. /// /// E.g., `std::cmp::PartialEq`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Path { pub span: Span, /// The segments in the path: the things separated by `::`. @@ -211,7 +212,7 @@ pub fn join_path_idents(path: impl IntoIterator>) -> S /// A segment of a path: an identifier, an optional lifetime, and a set of types. /// /// E.g., `std`, `String` or `Box`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct PathSegment { /// The identifier portion of this path segment. pub ident: Ident, @@ -255,7 +256,7 @@ impl PathSegment { /// The generic arguments and associated item constraints of a path segment. /// /// E.g., `` as in `Foo` or `(A, B)` as in `Foo(A, B)`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum GenericArgs { /// The `<'a, A, B, C>` in `foo::bar::baz::<'a, A, B, C>`. AngleBracketed(AngleBracketedArgs), @@ -280,10 +281,10 @@ impl GenericArgs { } /// Concrete argument in the sequence of generic args. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum GenericArg { /// `'a` in `Foo<'a>`. - Lifetime(Lifetime), + Lifetime(#[visitable(extra = LifetimeCtxt::GenericArg)] Lifetime), /// `Bar` in `Foo`. Type(P), /// `1` in `Foo<1>`. @@ -301,7 +302,7 @@ impl GenericArg { } /// A path like `Foo<'a, T>`. -#[derive(Clone, Encodable, Decodable, Debug, Default)] +#[derive(Clone, Encodable, Decodable, Debug, Default, Walkable)] pub struct AngleBracketedArgs { /// The overall span. pub span: Span, @@ -310,7 +311,7 @@ pub struct AngleBracketedArgs { } /// Either an argument for a generic parameter or a constraint on an associated item. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum AngleBracketedArg { /// A generic argument for a generic parameter. Arg(GenericArg), @@ -340,7 +341,7 @@ impl From for P { } /// A path like `Foo(A, B) -> C`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct ParenthesizedArgs { /// ```text /// Foo(A, B) -> C @@ -376,7 +377,7 @@ impl ParenthesizedArgs { pub use crate::node_id::{CRATE_NODE_ID, DUMMY_NODE_ID, NodeId}; /// Modifiers on a trait bound like `[const]`, `?` and `!`. -#[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, Walkable)] pub struct TraitBoundModifiers { pub constness: BoundConstness, pub asyncness: BoundAsyncness, @@ -391,10 +392,10 @@ impl TraitBoundModifiers { }; } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum GenericBound { Trait(PolyTraitRef), - Outlives(Lifetime), + Outlives(#[visitable(extra = LifetimeCtxt::Bound)] Lifetime), /// Precise capturing syntax: `impl Sized + use<'a>` Use(ThinVec, Span), } @@ -429,7 +430,7 @@ impl fmt::Display for ParamKindOrd { } } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum GenericParamKind { /// A lifetime definition (e.g., `'a: 'b + 'c + 'd`). Lifetime, @@ -445,11 +446,12 @@ pub enum GenericParamKind { }, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct GenericParam { pub id: NodeId, pub ident: Ident, pub attrs: AttrVec, + #[visitable(extra = BoundKind::Bound)] pub bounds: GenericBounds, pub is_placeholder: bool, pub kind: GenericParamKind, @@ -470,7 +472,7 @@ impl GenericParam { /// Represents lifetime, type and const parameters attached to a declaration of /// a function, enum, trait, etc. -#[derive(Clone, Encodable, Decodable, Debug, Default)] +#[derive(Clone, Encodable, Decodable, Debug, Default, Walkable)] pub struct Generics { pub params: ThinVec, pub where_clause: WhereClause, @@ -478,7 +480,7 @@ pub struct Generics { } /// A where-clause in a definition. -#[derive(Clone, Encodable, Decodable, Debug, Default)] +#[derive(Clone, Encodable, Decodable, Debug, Default, Walkable)] pub struct WhereClause { /// `true` if we ate a `where` token. /// @@ -496,7 +498,7 @@ impl WhereClause { } /// A single predicate in a where-clause. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct WherePredicate { pub attrs: AttrVec, pub kind: WherePredicateKind, @@ -506,7 +508,7 @@ pub struct WherePredicate { } /// Predicate kind in where-clause. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum WherePredicateKind { /// A type bound (e.g., `for<'c> Foo: Send + Clone + 'c`). BoundPredicate(WhereBoundPredicate), @@ -519,42 +521,45 @@ pub enum WherePredicateKind { /// A type bound. /// /// E.g., `for<'c> Foo: Send + Clone + 'c`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct WhereBoundPredicate { /// Any generics from a `for` binding. pub bound_generic_params: ThinVec, /// The type being bounded. pub bounded_ty: P, /// Trait and lifetime bounds (`Clone + Send + 'static`). + #[visitable(extra = BoundKind::Bound)] pub bounds: GenericBounds, } /// A lifetime predicate. /// /// E.g., `'a: 'b + 'c`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct WhereRegionPredicate { + #[visitable(extra = LifetimeCtxt::Bound)] pub lifetime: Lifetime, + #[visitable(extra = BoundKind::Bound)] pub bounds: GenericBounds, } /// An equality predicate (unsupported). /// /// E.g., `T = int`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct WhereEqPredicate { pub lhs_ty: P, pub rhs_ty: P, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Crate { - pub attrs: AttrVec, - pub items: ThinVec>, - pub spans: ModSpans, /// Must be equal to `CRATE_NODE_ID` after the crate root is expanded, but may hold /// expansion placeholders or an unassigned value (`DUMMY_NODE_ID`) before that. pub id: NodeId, + pub attrs: AttrVec, + pub items: ThinVec>, + pub spans: ModSpans, pub is_placeholder: bool, } @@ -608,7 +613,7 @@ pub enum MetaItemInner { /// A block (`{ .. }`). /// /// E.g., `{ .. }` as in `fn foo() { .. }`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Block { /// The statements in the block. pub stmts: ThinVec, @@ -622,7 +627,7 @@ pub struct Block { /// A match pattern. /// /// Patterns appear in match statements and some other contexts, such as `let` and `if let`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Pat { pub id: NodeId, pub kind: PatKind, @@ -770,7 +775,7 @@ impl From> for Pat { /// Patterns like the fields of `Foo { x, ref y, ref mut z }` /// are treated the same as `x: x, y: ref y, z: ref mut z`, /// except when `is_shorthand` is true. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct PatField { /// The identifier for the field. pub ident: Ident, @@ -784,7 +789,7 @@ pub struct PatField { } #[derive(Clone, Copy, Debug, Eq, PartialEq)] -#[derive(Encodable, Decodable, HashStable_Generic)] +#[derive(Encodable, Decodable, HashStable_Generic, Walkable)] pub enum ByRef { Yes(Mutability), No, @@ -806,7 +811,7 @@ impl ByRef { /// `.0` is the by-reference mode (`ref`, `ref mut`, or by value), /// `.1` is the mutability of the binding. #[derive(Clone, Copy, Debug, Eq, PartialEq)] -#[derive(Encodable, Decodable, HashStable_Generic)] +#[derive(Encodable, Decodable, HashStable_Generic, Walkable)] pub struct BindingMode(pub ByRef, pub Mutability); impl BindingMode { @@ -829,7 +834,7 @@ impl BindingMode { } } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum RangeEnd { /// `..=` or `...` Included(RangeSyntax), @@ -837,7 +842,7 @@ pub enum RangeEnd { Excluded, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum RangeSyntax { /// `...` DotDotDot, @@ -848,7 +853,7 @@ pub enum RangeSyntax { /// All the different flavors of pattern that Rust recognizes. // // Adding a new variant? Please update `test_pat` in `tests/ui/macros/stringify.rs`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum PatKind { /// A missing pattern, e.g. for an anonymous param in a bare fn like `fn f(u32)`. Missing, @@ -930,7 +935,7 @@ pub enum PatKind { } /// Whether the `..` is present in a struct fields pattern. -#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq, Walkable)] pub enum PatFieldsRest { /// `module::StructName { field, ..}` Rest, @@ -943,7 +948,7 @@ pub enum PatFieldsRest { /// The kind of borrow in an `AddrOf` expression, /// e.g., `&place` or `&raw const place`. #[derive(Clone, Copy, PartialEq, Eq, Debug)] -#[derive(Encodable, Decodable, HashStable_Generic)] +#[derive(Encodable, Decodable, HashStable_Generic, Walkable)] pub enum BorrowKind { /// A normal borrow, `&$expr` or `&mut $expr`. /// The resulting type is either `&'a T` or `&'a mut T` @@ -959,7 +964,7 @@ pub enum BorrowKind { Pin, } -#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic)] +#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic, Walkable)] pub enum BinOpKind { /// The `+` operator (addition) Add, @@ -1089,7 +1094,7 @@ impl From for BinOpKind { } } -#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic)] +#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic, Walkable)] pub enum AssignOpKind { /// The `+=` operator (addition) AddAssign, @@ -1141,7 +1146,7 @@ pub type AssignOp = Spanned; /// Unary operator. /// /// Note that `&data` is not an operator, it's an `AddrOf` expression. -#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic)] +#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic, Walkable)] pub enum UnOp { /// The `*` operator for dereferencing Deref, @@ -1215,7 +1220,7 @@ impl Stmt { } // Adding a new variant? Please update `test_stmt` in `tests/ui/macros/stringify.rs`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum StmtKind { /// A local (let) binding. Let(P), @@ -1231,7 +1236,7 @@ pub enum StmtKind { MacCall(P), } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct MacCallStmt { pub mac: P, pub style: MacStmtStyle, @@ -1239,7 +1244,7 @@ pub struct MacCallStmt { pub tokens: Option, } -#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug)] +#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, Walkable)] pub enum MacStmtStyle { /// The macro statement had a trailing semicolon (e.g., `foo! { ... };` /// `foo!(...);`, `foo![...];`). @@ -1253,7 +1258,7 @@ pub enum MacStmtStyle { } /// Local represents a `let` statement, e.g., `let : = ;`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Local { pub id: NodeId, pub super_: Option, @@ -1266,7 +1271,7 @@ pub struct Local { pub tokens: Option, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum LocalKind { /// Local declaration. /// Example: `let x;` @@ -1306,7 +1311,7 @@ impl LocalKind { /// _ => { println!("no match!") }, /// } /// ``` -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Arm { pub attrs: AttrVec, /// Match arm pattern, e.g. `10` in `match foo { 10 => {}, _ => {} }`. @@ -1321,7 +1326,7 @@ pub struct Arm { } /// A single field in a struct expression, e.g. `x: value` and `y` in `Foo { x: value, y }`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct ExprField { pub attrs: AttrVec, pub id: NodeId, @@ -1332,13 +1337,13 @@ pub struct ExprField { pub is_placeholder: bool, } -#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Copy)] +#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Copy, Walkable)] pub enum BlockCheckMode { Default, Unsafe(UnsafeSource), } -#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Copy)] +#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Copy, Walkable)] pub enum UnsafeSource { CompilerGenerated, UserProvided, @@ -1349,7 +1354,7 @@ pub enum UnsafeSource { /// These are usually found nested inside types (e.g., array lengths) /// or expressions (e.g., repeat counts), and also used to define /// explicit discriminant values for enum variants. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct AnonConst { pub id: NodeId, pub value: P, @@ -1633,7 +1638,7 @@ impl From> for Expr { } } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Closure { pub binder: ClosureBinder, pub capture_clause: CaptureBy, @@ -1649,7 +1654,7 @@ pub struct Closure { } /// Limit types of a range (inclusive or exclusive). -#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, Walkable)] pub enum RangeLimits { /// Inclusive at the beginning, exclusive at the end. HalfOpen, @@ -1680,7 +1685,7 @@ pub struct MethodCall { pub span: Span, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum StructRest { /// `..x`. Base(P), @@ -1690,7 +1695,7 @@ pub enum StructRest { None, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct StructExpr { pub qself: Option>, pub path: Path, @@ -1880,14 +1885,14 @@ pub enum ExprKind { } /// Used to differentiate between `for` loops and `for await` loops. -#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq, Eq)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq, Eq, Walkable)] pub enum ForLoopKind { For, ForAwait, } /// Used to differentiate between `async {}` blocks and `gen {}` blocks. -#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq)] +#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq, Walkable)] pub enum GenBlockKind { Async, Gen, @@ -1912,7 +1917,7 @@ impl GenBlockKind { /// Whether we're unwrapping or wrapping an unsafe binder #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[derive(Encodable, Decodable, HashStable_Generic)] +#[derive(Encodable, Decodable, HashStable_Generic, Walkable)] pub enum UnsafeBinderCastKind { // e.g. `&i32` -> `unsafe<'a> &'a i32` Wrap, @@ -1934,7 +1939,7 @@ pub enum UnsafeBinderCastKind { /// ^~~~~ ^ /// ty position = 0 /// ``` -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct QSelf { pub ty: P, @@ -1946,7 +1951,7 @@ pub struct QSelf { } /// A capture clause used in closures and `async` blocks. -#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] pub enum CaptureBy { /// `move |x| y + x`. Value { @@ -1967,7 +1972,7 @@ pub enum CaptureBy { } /// Closure lifetime binder, `for<'a, 'b>` in `for<'a, 'b> |_: &'a (), _: &'b ()|`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum ClosureBinder { /// The binder is not present, all closure lifetimes are inferred. NotPresent, @@ -1993,7 +1998,7 @@ pub enum ClosureBinder { /// Represents a macro invocation. The `path` indicates which macro /// is being invoked, and the `args` are arguments passed to it. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct MacCall { pub path: Path, pub args: P, @@ -2006,7 +2011,7 @@ impl MacCall { } /// Arguments passed to an attribute macro. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum AttrArgs { /// No arguments: `#[attr]`. Empty, @@ -2041,7 +2046,7 @@ impl AttrArgs { } /// Delimited arguments, as used in `#[attr()/[]/{}]` or `mac!()/[]/{}`. -#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] pub struct DelimArgs { pub dspan: DelimSpan, pub delim: Delimiter, // Note: `Delimiter::Invisible` never occurs @@ -2057,7 +2062,7 @@ impl DelimArgs { } /// Represents a macro definition. -#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] pub struct MacroDef { pub body: P, /// `true` if macro was defined with `macro_rules`. @@ -2065,7 +2070,7 @@ pub struct MacroDef { } #[derive(Clone, Encodable, Decodable, Debug, Copy, Hash, Eq, PartialEq)] -#[derive(HashStable_Generic)] +#[derive(HashStable_Generic, Walkable)] pub enum StrStyle { /// A regular string, like `"foo"`. Cooked, @@ -2076,7 +2081,7 @@ pub enum StrStyle { } /// The kind of match expression -#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq, Walkable)] pub enum MatchKind { /// match expr { ... } Prefix, @@ -2085,7 +2090,7 @@ pub enum MatchKind { } /// The kind of yield expression -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum YieldKind { /// yield expr { ... } Prefix(Option>), @@ -2136,7 +2141,7 @@ pub struct MetaItemLit { } /// Similar to `MetaItemLit`, but restricted to string literals. -#[derive(Clone, Copy, Encodable, Decodable, Debug)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, Walkable)] pub struct StrLit { /// The original literal as written in source code. pub symbol: Symbol, @@ -2265,7 +2270,7 @@ impl LitKind { // N.B., If you change this, you'll probably want to change the corresponding // type structure in `middle/ty.rs` as well. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct MutTy { pub ty: P, pub mutbl: Mutability, @@ -2389,7 +2394,7 @@ impl UintTy { /// * the `RetTy` in `Trait(ArgTy, ArgTy) -> RetTy` /// * the `C = { Ct }` in `Trait` (feature `associated_const_equality`) /// * the `f(..): Bound` in `Trait` (feature `return_type_notation`) -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct AssocItemConstraint { pub id: NodeId, pub ident: Ident, @@ -2398,7 +2403,7 @@ pub struct AssocItemConstraint { pub span: Span, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum Term { Ty(P), Const(AnonConst), @@ -2417,7 +2422,7 @@ impl From for Term { } /// The kind of [associated item constraint][AssocItemConstraint]. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum AssocItemConstraintKind { /// An equality constraint for an associated item (e.g., `AssocTy = Ty` in `Trait`). /// @@ -2427,10 +2432,13 @@ pub enum AssocItemConstraintKind { /// bindings*. Similarly with associated const equality constraints and *associated const bindings*. Equality { term: Term }, /// A bound on an associated type (e.g., `AssocTy: Bound` in `Trait`). - Bound { bounds: GenericBounds }, + Bound { + #[visitable(extra = BoundKind::Bound)] + bounds: GenericBounds, + }, } -#[derive(Encodable, Decodable, Debug)] +#[derive(Encodable, Decodable, Debug, Walkable)] pub struct Ty { pub id: NodeId, pub kind: TyKind, @@ -2474,7 +2482,7 @@ impl Ty { } } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct FnPtrTy { pub safety: Safety, pub ext: Extern, @@ -2485,7 +2493,7 @@ pub struct FnPtrTy { pub decl_span: Span, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct UnsafeBinderTy { pub generic_params: ThinVec, pub inner_ty: P, @@ -2494,7 +2502,7 @@ pub struct UnsafeBinderTy { /// The various kinds of type recognized by the compiler. // // Adding a new variant? Please update `test_ty` in `tests/ui/macros/stringify.rs`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum TyKind { /// A variable-length slice (`[T]`). Slice(P), @@ -2503,11 +2511,11 @@ pub enum TyKind { /// A raw pointer (`*const T` or `*mut T`). Ptr(MutTy), /// A reference (`&'a T` or `&'a mut T`). - Ref(Option, MutTy), + Ref(#[visitable(extra = LifetimeCtxt::Ref)] Option, MutTy), /// A pinned reference (`&'a pin const T` or `&'a pin mut T`). /// /// Desugars into `Pin<&'a T>` or `Pin<&'a mut T>`. - PinnedRef(Option, MutTy), + PinnedRef(#[visitable(extra = LifetimeCtxt::Ref)] Option, MutTy), /// A function pointer type (e.g., `fn(usize) -> bool`). FnPtr(P), /// An unsafe existential lifetime binder (e.g., `unsafe<'a> &'a ()`). @@ -2523,14 +2531,14 @@ pub enum TyKind { Path(Option>, Path), /// A trait object type `Bound1 + Bound2 + Bound3` /// where `Bound` is a trait or a lifetime. - TraitObject(GenericBounds, TraitObjectSyntax), + TraitObject(#[visitable(extra = BoundKind::TraitObject)] GenericBounds, TraitObjectSyntax), /// An `impl Bound1 + Bound2 + Bound3` type /// where `Bound` is a trait or a lifetime. /// /// The `NodeId` exists to prevent lowering from having to /// generate `NodeId`s on the fly, which would complicate /// the generation of opaque `type Foo = impl Trait` items significantly. - ImplTrait(NodeId, GenericBounds), + ImplTrait(NodeId, #[visitable(extra = BoundKind::Impl)] GenericBounds), /// No-op; kept solely so that we can pretty-print faithfully. Paren(P), /// Unused for now. @@ -2608,7 +2616,7 @@ impl TyKind { } /// A pattern type pattern. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct TyPat { pub id: NodeId, pub kind: TyPatKind, @@ -2619,7 +2627,7 @@ pub struct TyPat { /// All the different flavors of pattern that Rust recognizes. // // Adding a new variant? Please update `test_pat` in `tests/ui/macros/stringify.rs`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum TyPatKind { /// A range pattern (e.g., `1...2`, `1..2`, `1..`, `..2`, `1..=2`, `..=2`). Range(Option>, Option>, Spanned), @@ -2631,7 +2639,7 @@ pub enum TyPatKind { } /// Syntax used to declare a trait object. -#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] #[repr(u8)] pub enum TraitObjectSyntax { // SAFETY: When adding new variants make sure to update the `Tag` impl. @@ -2658,10 +2666,10 @@ unsafe impl Tag for TraitObjectSyntax { } } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum PreciseCapturingArg { /// Lifetime parameter. - Lifetime(Lifetime), + Lifetime(#[visitable(extra = LifetimeCtxt::GenericArg)] Lifetime), /// Type or const parameter. Arg(Path, NodeId), } @@ -2669,7 +2677,7 @@ pub enum PreciseCapturingArg { /// Inline assembly operand explicit register or register class. /// /// E.g., `"eax"` as in `asm!("mov eax, 2", out("eax") result)`. -#[derive(Clone, Copy, Encodable, Decodable, Debug)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, Walkable)] pub enum InlineAsmRegOrRegClass { Reg(Symbol), RegClass(Symbol), @@ -2738,7 +2746,7 @@ impl std::fmt::Debug for InlineAsmOptions { } } -#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Hash, HashStable_Generic)] +#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Hash, HashStable_Generic, Walkable)] pub enum InlineAsmTemplatePiece { String(Cow<'static, str>), Placeholder { operand_idx: usize, modifier: Option, span: Span }, @@ -2786,7 +2794,7 @@ impl InlineAsmTemplatePiece { /// `DefCollector`. Instead this is deferred until AST lowering where we /// lower it to an `AnonConst` (for functions) or a `Path` (for statics) /// depending on what the path resolves to. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct InlineAsmSym { pub id: NodeId, pub qself: Option>, @@ -2796,7 +2804,7 @@ pub struct InlineAsmSym { /// Inline assembly operand. /// /// E.g., `out("eax") result` as in `asm!("mov eax, 2", out("eax") result)`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum InlineAsmOperand { In { reg: InlineAsmRegOrRegClass, @@ -2841,7 +2849,7 @@ impl InlineAsmOperand { } } -#[derive(Clone, Copy, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] pub enum AsmMacro { /// The `asm!` macro Asm, @@ -2880,13 +2888,14 @@ impl AsmMacro { /// Inline assembly. /// /// E.g., `asm!("NOP");`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct InlineAsm { pub asm_macro: AsmMacro, pub template: Vec, pub template_strs: Box<[(Symbol, Option, Span)]>, pub operands: Vec<(InlineAsmOperand, Span)>, pub clobber_abis: Vec<(Symbol, Span)>, + #[visitable(ignore)] pub options: InlineAsmOptions, pub line_spans: Vec, } @@ -2894,7 +2903,7 @@ pub struct InlineAsm { /// A parameter in a function header. /// /// E.g., `bar: usize` as in `fn foo(bar: usize)`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Param { pub attrs: AttrVec, pub ty: P, @@ -3022,7 +3031,7 @@ impl Param { /// /// Please note that it's different from `FnHeader` structure /// which contains metadata about function safety, asyncness, constness and ABI. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct FnDecl { pub inputs: ThinVec, pub output: FnRetTy, @@ -3038,7 +3047,7 @@ impl FnDecl { } /// Is the trait definition an auto trait? -#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] pub enum IsAuto { Yes, No, @@ -3046,7 +3055,7 @@ pub enum IsAuto { /// Safety of items. #[derive(Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable, Debug)] -#[derive(HashStable_Generic)] +#[derive(HashStable_Generic, Walkable)] pub enum Safety { /// `unsafe` an item is explicitly marked as `unsafe`. Unsafe(Span), @@ -3062,7 +3071,7 @@ pub enum Safety { /// Coroutine markers are things that cause the function to generate a coroutine, such as `async`, /// which makes the function return `impl Future`, or `gen`, which makes the function return `impl /// Iterator`. -#[derive(Copy, Clone, Encodable, Decodable, Debug)] +#[derive(Copy, Clone, Encodable, Decodable, Debug, Walkable)] pub enum CoroutineKind { /// `async`, which returns an `impl Future`. Async { span: Span, closure_id: NodeId, return_impl_trait_id: NodeId }, @@ -3111,7 +3120,7 @@ impl CoroutineKind { } #[derive(Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable, Debug)] -#[derive(HashStable_Generic)] +#[derive(HashStable_Generic, Walkable)] pub enum Const { Yes(Span), No, @@ -3119,13 +3128,13 @@ pub enum Const { /// Item defaultness. /// For details see the [RFC #2532](https://github.com/rust-lang/rfcs/pull/2532). -#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] pub enum Defaultness { Default(Span), Final, } -#[derive(Copy, Clone, PartialEq, Encodable, Decodable, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable, HashStable_Generic, Walkable)] pub enum ImplPolarity { /// `impl Trait for Type` Positive, @@ -3144,7 +3153,7 @@ impl fmt::Debug for ImplPolarity { /// The polarity of a trait bound. #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, Hash)] -#[derive(HashStable_Generic)] +#[derive(HashStable_Generic, Walkable)] pub enum BoundPolarity { /// `Type: Trait` Positive, @@ -3166,7 +3175,7 @@ impl BoundPolarity { /// The constness of a trait bound. #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, Hash)] -#[derive(HashStable_Generic)] +#[derive(HashStable_Generic, Walkable)] pub enum BoundConstness { /// `Type: Trait` Never, @@ -3188,7 +3197,7 @@ impl BoundConstness { /// The asyncness of a trait bound. #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug)] -#[derive(HashStable_Generic)] +#[derive(HashStable_Generic, Walkable)] pub enum BoundAsyncness { /// `Type: Trait` Normal, @@ -3205,7 +3214,7 @@ impl BoundAsyncness { } } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum FnRetTy { /// Returns type is not specified. /// @@ -3225,14 +3234,14 @@ impl FnRetTy { } } -#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug)] +#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, Walkable)] pub enum Inline { Yes, No, } /// Module item kind. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum ModKind { /// Module with inlined definition `mod foo { ... }`, /// or with definition outlined to a separate file `mod foo;` and already loaded from it. @@ -3243,7 +3252,7 @@ pub enum ModKind { Unloaded, } -#[derive(Copy, Clone, Encodable, Decodable, Debug, Default)] +#[derive(Copy, Clone, Encodable, Decodable, Debug, Default, Walkable)] pub struct ModSpans { /// `inner_span` covers the body of the module; for a file module, its the whole file. /// For an inline module, its the span inside the `{ ... }`, not including the curly braces. @@ -3254,7 +3263,7 @@ pub struct ModSpans { /// Foreign module declaration. /// /// E.g., `extern { .. }` or `extern "C" { .. }`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct ForeignMod { /// Span of the `extern` keyword. pub extern_span: Span, @@ -3265,12 +3274,13 @@ pub struct ForeignMod { pub items: ThinVec>, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct EnumDef { pub variants: ThinVec, } + /// Enum variant. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Variant { /// Attributes of the variant. pub attrs: AttrVec, @@ -3292,7 +3302,7 @@ pub struct Variant { } /// Part of `use` item to the right of its prefix. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum UseTreeKind { /// `use prefix` or `use prefix as rename` Simple(Option), @@ -3311,7 +3321,7 @@ pub enum UseTreeKind { /// A tree of paths sharing common prefixes. /// Used in `use` items both at top-level and inside of braces in import groups. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct UseTree { pub prefix: Path, pub kind: UseTreeKind, @@ -3333,7 +3343,7 @@ impl UseTree { /// Distinguishes between `Attribute`s that decorate items and Attributes that /// are contained as statements within items. These two cases need to be /// distinguished for pretty-printing. -#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Copy, HashStable_Generic)] +#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Copy, HashStable_Generic, Walkable)] pub enum AttrStyle { Outer, Inner, @@ -3343,7 +3353,7 @@ pub enum AttrStyle { pub type AttrVec = ThinVec; /// A syntax-level representation of an attribute. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Attribute { pub kind: AttrKind, pub id: AttrId, @@ -3353,7 +3363,7 @@ pub struct Attribute { pub span: Span, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum AttrKind { /// A normal attribute. Normal(P), @@ -3364,7 +3374,7 @@ pub enum AttrKind { DocComment(CommentKind, Symbol), } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct NormalAttr { pub item: AttrItem, // Tokens for the full attribute, e.g. `#[foo]`, `#![bar]`. @@ -3385,7 +3395,7 @@ impl NormalAttr { } } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct AttrItem { pub unsafety: Safety, pub path: Path, @@ -3411,20 +3421,20 @@ impl AttrItem { /// that the `ref_id` is for. The `impl_id` maps to the "self type" of this impl. /// If this impl is an `ItemKind::Impl`, the `impl_id` is redundant (it could be the /// same as the impl's `NodeId`). -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct TraitRef { pub path: Path, pub ref_id: NodeId, } /// Whether enclosing parentheses are present or not. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum Parens { Yes, No, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct PolyTraitRef { /// The `'a` in `for<'a> Foo<&'a T>`. pub bound_generic_params: ThinVec, @@ -3460,14 +3470,14 @@ impl PolyTraitRef { } } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Visibility { pub kind: VisibilityKind, pub span: Span, pub tokens: Option, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum VisibilityKind { Public, Restricted { path: P, id: NodeId, shorthand: bool }, @@ -3483,7 +3493,7 @@ impl VisibilityKind { /// Field definition in a struct, variant or union. /// /// E.g., `bar: usize` as in `struct Foo { bar: usize }`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct FieldDef { pub attrs: AttrVec, pub id: NodeId, @@ -3498,14 +3508,14 @@ pub struct FieldDef { } /// Was parsing recovery performed? -#[derive(Copy, Clone, Debug, Encodable, Decodable, HashStable_Generic)] +#[derive(Copy, Clone, Debug, Encodable, Decodable, HashStable_Generic, Walkable)] pub enum Recovered { No, Yes(ErrorGuaranteed), } /// Fields and constructor ids of enum variants and structs. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum VariantData { /// Struct variant. /// @@ -3591,7 +3601,7 @@ impl Item { } /// `extern` qualifier on a function item or function type. -#[derive(Clone, Copy, Encodable, Decodable, Debug)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, Walkable)] pub enum Extern { /// No explicit extern keyword was used. /// @@ -3622,7 +3632,7 @@ impl Extern { /// /// All the information between the visibility and the name of the function is /// included in this struct (e.g., `async unsafe fn` or `const extern "C" fn`). -#[derive(Clone, Copy, Encodable, Decodable, Debug)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, Walkable)] pub struct FnHeader { /// Whether this is `unsafe`, or has a default safety. pub safety: Safety, @@ -3688,14 +3698,16 @@ impl Default for FnHeader { } } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Trait { pub constness: Const, pub safety: Safety, pub is_auto: IsAuto, pub ident: Ident, pub generics: Generics, + #[visitable(extra = BoundKind::SuperTraits)] pub bounds: GenericBounds, + #[visitable(extra = AssocCtxt::Trait)] pub items: ThinVec>, } @@ -3717,14 +3729,14 @@ pub struct Trait { /// ``` /// /// If there is no where clause, then this is `false` with `DUMMY_SP`. -#[derive(Copy, Clone, Encodable, Decodable, Debug, Default)] +#[derive(Copy, Clone, Encodable, Decodable, Debug, Default, Walkable)] pub struct TyAliasWhereClause { pub has_where_token: bool, pub span: Span, } /// The span information for the two where clauses on a `TyAlias`. -#[derive(Copy, Clone, Encodable, Decodable, Debug, Default)] +#[derive(Copy, Clone, Encodable, Decodable, Debug, Default, Walkable)] pub struct TyAliasWhereClauses { /// Before the equals sign. pub before: TyAliasWhereClause, @@ -3736,12 +3748,13 @@ pub struct TyAliasWhereClauses { pub split: usize, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct TyAlias { pub defaultness: Defaultness, pub ident: Ident, pub generics: Generics, pub where_clauses: TyAliasWhereClauses, + #[visitable(extra = BoundKind::Bound)] pub bounds: GenericBounds, pub ty: Option>, } @@ -3759,7 +3772,7 @@ pub struct Impl { pub items: ThinVec>, } -#[derive(Clone, Encodable, Decodable, Debug, Default)] +#[derive(Clone, Encodable, Decodable, Debug, Default, Walkable)] pub struct FnContract { pub requires: Option>, pub ensures: Option>, @@ -3776,7 +3789,7 @@ pub struct Fn { pub body: Option>, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct Delegation { /// Path resolution id. pub id: NodeId, @@ -3789,7 +3802,7 @@ pub struct Delegation { pub from_glob: bool, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct DelegationMac { pub qself: Option>, pub prefix: Path, @@ -3798,7 +3811,7 @@ pub struct DelegationMac { pub body: Option>, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct StaticItem { pub ident: Ident, pub ty: P, @@ -3808,7 +3821,7 @@ pub struct StaticItem { pub define_opaque: Option>, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct ConstItem { pub defaultness: Defaultness, pub ident: Ident, diff --git a/compiler/rustc_ast/src/format.rs b/compiler/rustc_ast/src/format.rs index 28d260419c51..c2a1de60a981 100644 --- a/compiler/rustc_ast/src/format.rs +++ b/compiler/rustc_ast/src/format.rs @@ -1,5 +1,5 @@ use rustc_data_structures::fx::FxHashMap; -use rustc_macros::{Decodable, Encodable}; +use rustc_macros::{Decodable, Encodable, Walkable}; use rustc_span::{Ident, Span, Symbol}; use crate::Expr; @@ -41,7 +41,7 @@ use crate::token::LitKind; /// Basically the "AST" for a complete `format_args!()`. /// /// E.g., `format_args!("hello {name}");`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct FormatArgs { pub span: Span, pub template: Vec, @@ -63,7 +63,7 @@ pub struct FormatArgs { /// A piece of a format template string. /// /// E.g. "hello" or "{name}". -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum FormatArgsPiece { Literal(Symbol), Placeholder(FormatPlaceholder), @@ -73,7 +73,7 @@ pub enum FormatArgsPiece { /// /// E.g. `1, 2, name="ferris", n=3`, /// but also implicit captured arguments like `x` in `format_args!("{x}")`. -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct FormatArguments { arguments: Vec, num_unnamed_args: usize, @@ -144,13 +144,13 @@ impl FormatArguments { } } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct FormatArgument { pub kind: FormatArgumentKind, pub expr: P, } -#[derive(Clone, Encodable, Decodable, Debug)] +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub enum FormatArgumentKind { /// `format_args(…, arg)` Normal, @@ -170,24 +170,28 @@ impl FormatArgumentKind { } } -#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq)] +#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq, Walkable)] pub struct FormatPlaceholder { /// Index into [`FormatArgs::arguments`]. pub argument: FormatArgPosition, /// The span inside the format string for the full `{…}` placeholder. pub span: Option, /// `{}`, `{:?}`, or `{:x}`, etc. + #[visitable(ignore)] pub format_trait: FormatTrait, /// `{}` or `{:.5}` or `{:-^20}`, etc. + #[visitable(ignore)] pub format_options: FormatOptions, } -#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq)] +#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq, Walkable)] pub struct FormatArgPosition { /// Which argument this position refers to (Ok), /// or would've referred to if it existed (Err). + #[visitable(ignore)] pub index: Result, /// What kind of position this is. See [`FormatArgPositionKind`]. + #[visitable(ignore)] pub kind: FormatArgPositionKind, /// The span of the name or number. pub span: Option, diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs index 3eae19f4daa1..06708e2e703a 100644 --- a/compiler/rustc_ast/src/mut_visit.rs +++ b/compiler/rustc_ast/src/mut_visit.rs @@ -12,14 +12,14 @@ use std::panic; use rustc_data_structures::flat_map_in_place::FlatMapInPlace; use rustc_span::source_map::Spanned; -use rustc_span::{Ident, Span}; +use rustc_span::{Ident, Span, Symbol}; use smallvec::{SmallVec, smallvec}; use thin_vec::ThinVec; use crate::ast::*; use crate::ptr::P; use crate::tokenstream::*; -use crate::visit::{AssocCtxt, BoundKind, FnCtxt, VisitorResult, try_visit, visit_opt, walk_list}; +use crate::visit::{AssocCtxt, BoundKind, FnCtxt, LifetimeCtxt, VisitorResult, try_visit}; mod sealed { use rustc_ast_ir::visit::VisitorResult; @@ -36,11 +36,249 @@ mod sealed { use sealed::MutVisitorResult; +pub(crate) trait MutVisitable { + type Extra: Copy; + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra); +} + +impl MutVisitable for P +where + T: MutVisitable, +{ + type Extra = T::Extra; + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { + (**self).visit_mut(visitor, extra) + } +} + +impl MutVisitable for Option +where + T: MutVisitable, +{ + type Extra = T::Extra; + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { + if let Some(this) = self { + this.visit_mut(visitor, extra) + } + } +} + +impl MutVisitable for Spanned +where + T: MutVisitable, +{ + type Extra = T::Extra; + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { + let Spanned { span, node } = self; + span.visit_mut(visitor, ()); + node.visit_mut(visitor, extra); + } +} + +impl MutVisitable for [T] +where + T: MutVisitable, +{ + type Extra = T::Extra; + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { + for item in self { + item.visit_mut(visitor, extra); + } + } +} + +impl MutVisitable for Vec +where + T: MutVisitable, +{ + type Extra = T::Extra; + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { + for item in self { + item.visit_mut(visitor, extra); + } + } +} + +impl MutVisitable for (T,) +where + T: MutVisitable, +{ + type Extra = T::Extra; + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { + self.0.visit_mut(visitor, extra); + } +} + +impl MutVisitable for (T1, T2) +where + T1: MutVisitable, + T2: MutVisitable, +{ + type Extra = (); + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { + self.0.visit_mut(visitor, extra); + self.1.visit_mut(visitor, extra); + } +} + +impl MutVisitable for (T1, T2, T3) +where + T1: MutVisitable, + T2: MutVisitable, + T3: MutVisitable, +{ + type Extra = (); + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { + self.0.visit_mut(visitor, extra); + self.1.visit_mut(visitor, extra); + self.2.visit_mut(visitor, extra); + } +} + +impl MutVisitable for (T1, T2, T3, T4) +where + T1: MutVisitable, + T2: MutVisitable, + T3: MutVisitable, + T4: MutVisitable, +{ + type Extra = (); + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { + self.0.visit_mut(visitor, extra); + self.1.visit_mut(visitor, extra); + self.2.visit_mut(visitor, extra); + self.3.visit_mut(visitor, extra); + } +} + +pub trait MutWalkable { + fn walk_mut(&mut self, visitor: &mut V); +} + +macro_rules! visit_visitable { + (mut $visitor:expr, $($expr:expr),* $(,)?) => {{ + $(MutVisitable::visit_mut($expr, $visitor, ());)* + }}; +} + +macro_rules! visit_visitable_with { + (mut $visitor:expr, $expr:expr, $extra:expr $(,)?) => { + MutVisitable::visit_mut($expr, $visitor, $extra) + }; +} + +macro_rules! walk_walkable { + ($visitor:expr, $expr:expr, mut) => { + MutWalkable::walk_mut($expr, $visitor) + }; +} + +macro_rules! impl_visitable { + (|&mut $self:ident: $self_ty:ty, + $vis:ident: &mut $vis_ty:ident, + $extra:ident: $extra_ty:ty| $block:block) => { + #[allow(unused_parens, non_local_definitions)] + impl<$vis_ty: MutVisitor> MutVisitable<$vis_ty> for $self_ty { + type Extra = $extra_ty; + fn visit_mut(&mut $self, $vis: &mut $vis_ty, $extra: Self::Extra) -> V::Result { + $block + } + } + }; +} + +macro_rules! impl_walkable { + ($(<$K:ident: $Kb:ident>)? |&mut $self:ident: $self_ty:ty, + $vis:ident: &mut $vis_ty:ident| $block:block) => { + #[allow(unused_parens, non_local_definitions)] + impl<$($K: $Kb,)? $vis_ty: MutVisitor> MutWalkable<$vis_ty> for $self_ty { + fn walk_mut(&mut $self, $vis: &mut $vis_ty) -> V::Result { + $block + } + } + }; +} + +macro_rules! impl_visitable_noop { + ( $($ty:ty,)*) => { + $( + impl_visitable!(|&mut self: $ty, _vis: &mut V, _extra: ()| {}); + )* + }; +} + +macro_rules! impl_visitable_list { + ( $($ty:ty,)*) => { + $(impl MutVisitable for $ty + where + for<'a> &'a mut $ty: IntoIterator, + T: MutVisitable, + { + type Extra = >::Extra; + + #[inline] + fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { + for i in self { + i.visit_mut(visitor, extra); + } + } + })* + } +} + +macro_rules! impl_visitable_direct { + ( $($ty:ty,)*) => { + $(impl_visitable!( + |&mut self: $ty, visitor: &mut V, _extra: ()| { + MutWalkable::walk_mut(self, visitor) + } + );)* + } +} + +macro_rules! impl_visitable_calling_walkable { + ( + $( fn $method:ident($ty:ty $(, $extra_name:ident: $extra_ty:ty)?); )* + ) => { + $(fn $method(&mut self, node: &mut $ty $(, $extra_name:$extra_ty)?) { + impl_visitable!(|&mut self: $ty, visitor: &mut V, extra: ($($extra_ty)?)| { + let ($($extra_name)?) = extra; + visitor.$method(self $(, $extra_name)?); + }); + walk_walkable!(self, node, mut) + })* + } +} + +macro_rules! define_named_walk { + ((mut) $Visitor:ident + $( pub fn $method:ident($ty:ty); )* + ) => { + $(pub fn $method(visitor: &mut V, node: &mut $ty) { + walk_walkable!(visitor, node, mut) + })* + }; +} + super::common_visitor_and_walkers!((mut) MutVisitor); macro_rules! generate_flat_map_visitor_fns { ($($name:ident, $Ty:ty, $flat_map_fn:ident$(, $param:ident: $ParamTy:ty)*;)+) => { $( + #[allow(unused_parens)] + impl MutVisitable for ThinVec<$Ty> { + type Extra = ($($ParamTy),*); + + #[inline] + fn visit_mut( + &mut self, + visitor: &mut V, + ($($param),*): Self::Extra, + ) -> V::Result { + $name(visitor, self $(, $param)*) + } + } + fn $name( vis: &mut V, values: &mut ThinVec<$Ty>, @@ -78,15 +316,6 @@ pub fn walk_flat_map_pat_field( smallvec![fp] } -fn visit_nested_use_tree( - vis: &mut V, - nested_tree: &mut UseTree, - nested_id: &mut NodeId, -) { - vis.visit_id(nested_id); - vis.visit_use_tree(nested_tree); -} - macro_rules! generate_walk_flat_map_fns { ($($fn_name:ident($Ty:ty$(,$extra_name:ident: $ExtraTy:ty)*) => $visit_fn_name:ident;)+) => {$( pub fn $fn_name(vis: &mut V, mut value: $Ty$(,$extra_name: $ExtraTy)*) -> SmallVec<[$Ty; 1]> { @@ -109,14 +338,6 @@ generate_walk_flat_map_fns! { walk_flat_map_assoc_item(P, ctxt: AssocCtxt) => visit_assoc_item; } -fn walk_ty_alias_where_clauses(vis: &mut T, tawcs: &mut TyAliasWhereClauses) { - let TyAliasWhereClauses { before, after, split: _ } = tawcs; - let TyAliasWhereClause { has_where_token: _, span: span_before } = before; - let TyAliasWhereClause { has_where_token: _, span: span_after } = after; - vis.visit_span(span_before); - vis.visit_span(span_after); -} - pub fn walk_filter_map_expr(vis: &mut T, mut e: P) -> Option> { vis.visit_expr(&mut e); Some(e) diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs index c60185cdde00..e55399adfb85 100644 --- a/compiler/rustc_ast/src/tokenstream.rs +++ b/compiler/rustc_ast/src/tokenstream.rs @@ -20,7 +20,7 @@ use std::{cmp, fmt, iter, mem}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::sync; -use rustc_macros::{Decodable, Encodable, HashStable_Generic}; +use rustc_macros::{Decodable, Encodable, HashStable_Generic, Walkable}; use rustc_serialize::{Decodable, Encodable}; use rustc_span::{DUMMY_SP, Span, SpanDecoder, SpanEncoder, Symbol, sym}; use thin_vec::ThinVec; @@ -977,7 +977,7 @@ impl TokenCursor { } } -#[derive(Debug, Copy, Clone, PartialEq, Encodable, Decodable, HashStable_Generic)] +#[derive(Debug, Copy, Clone, PartialEq, Encodable, Decodable, HashStable_Generic, Walkable)] pub struct DelimSpan { pub open: Span, pub close: Span, diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs index a344f23c345f..ab15cb28fa12 100644 --- a/compiler/rustc_ast/src/visit.rs +++ b/compiler/rustc_ast/src/visit.rs @@ -16,7 +16,7 @@ pub use rustc_ast_ir::visit::VisitorResult; pub use rustc_ast_ir::{try_visit, visit_opt, walk_list, walk_visitable_list}; use rustc_span::source_map::Spanned; -use rustc_span::{Ident, Span}; +use rustc_span::{Ident, Span, Symbol}; use thin_vec::ThinVec; use crate::ast::*; @@ -75,6 +75,241 @@ pub enum LifetimeCtxt { GenericArg, } +pub(crate) trait Visitable<'a, V: Visitor<'a>> { + type Extra: Copy; + + #[must_use] + fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result; +} + +impl<'a, V: Visitor<'a>, T: ?Sized> Visitable<'a, V> for P +where + T: Visitable<'a, V>, +{ + type Extra = T::Extra; + fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { + (**self).visit(visitor, extra) + } +} + +impl<'a, V: Visitor<'a>, T> Visitable<'a, V> for Option +where + T: Visitable<'a, V>, +{ + type Extra = T::Extra; + fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { + if let Some(this) = self { + try_visit!(this.visit(visitor, extra)); + } + V::Result::output() + } +} + +impl<'a, V: Visitor<'a>, T> Visitable<'a, V> for Spanned +where + T: Visitable<'a, V>, +{ + type Extra = T::Extra; + fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { + let Spanned { span: _, node } = self; + node.visit(visitor, extra) + } +} + +impl<'a, V: Visitor<'a>, T> Visitable<'a, V> for [T] +where + T: Visitable<'a, V>, +{ + type Extra = T::Extra; + fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { + for item in self { + try_visit!(item.visit(visitor, extra)); + } + V::Result::output() + } +} + +impl<'a, V: Visitor<'a>, T> Visitable<'a, V> for Vec +where + T: Visitable<'a, V>, +{ + type Extra = T::Extra; + fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { + for item in self { + try_visit!(item.visit(visitor, extra)); + } + V::Result::output() + } +} + +impl<'a, V: Visitor<'a>, T> Visitable<'a, V> for (T,) +where + T: Visitable<'a, V>, +{ + type Extra = T::Extra; + fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { + self.0.visit(visitor, extra) + } +} + +impl<'a, V: Visitor<'a>, T1, T2> Visitable<'a, V> for (T1, T2) +where + T1: Visitable<'a, V, Extra = ()>, + T2: Visitable<'a, V, Extra = ()>, +{ + type Extra = (); + fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { + try_visit!(self.0.visit(visitor, extra)); + try_visit!(self.1.visit(visitor, extra)); + V::Result::output() + } +} + +impl<'a, V: Visitor<'a>, T1, T2, T3> Visitable<'a, V> for (T1, T2, T3) +where + T1: Visitable<'a, V, Extra = ()>, + T2: Visitable<'a, V, Extra = ()>, + T3: Visitable<'a, V, Extra = ()>, +{ + type Extra = (); + fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { + try_visit!(self.0.visit(visitor, extra)); + try_visit!(self.1.visit(visitor, extra)); + try_visit!(self.2.visit(visitor, extra)); + V::Result::output() + } +} + +impl<'a, V: Visitor<'a>, T1, T2, T3, T4> Visitable<'a, V> for (T1, T2, T3, T4) +where + T1: Visitable<'a, V, Extra = ()>, + T2: Visitable<'a, V, Extra = ()>, + T3: Visitable<'a, V, Extra = ()>, + T4: Visitable<'a, V, Extra = ()>, +{ + type Extra = (); + fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { + try_visit!(self.0.visit(visitor, extra)); + try_visit!(self.1.visit(visitor, extra)); + try_visit!(self.2.visit(visitor, extra)); + try_visit!(self.3.visit(visitor, extra)); + V::Result::output() + } +} + +pub(crate) trait Walkable<'a, V: Visitor<'a>> { + #[must_use] + fn walk_ref(&'a self, visitor: &mut V) -> V::Result; +} + +macro_rules! visit_visitable { + ($visitor:expr, $($expr:expr),* $(,)?) => {{ + $(try_visit!(Visitable::visit($expr, $visitor, ()));)* + }}; +} + +macro_rules! visit_visitable_with { + ($visitor:expr, $expr:expr, $extra:expr $(,)?) => { + try_visit!(Visitable::visit($expr, $visitor, $extra)) + }; +} + +macro_rules! walk_walkable { + ($visitor:expr, $expr:expr, ) => { + Walkable::walk_ref($expr, $visitor) + }; +} + +macro_rules! impl_visitable { + (|&$lt:lifetime $self:ident: $self_ty:ty, + $vis:ident: &mut $vis_ty:ident, + $extra:ident: $extra_ty:ty| $block:block) => { + #[allow(unused_parens, non_local_definitions)] + impl<$lt, $vis_ty: Visitor<$lt>> Visitable<$lt, $vis_ty> for $self_ty { + type Extra = $extra_ty; + fn visit(&$lt $self, $vis: &mut $vis_ty, $extra: Self::Extra) -> V::Result { + $block + } + } + }; +} + +macro_rules! impl_walkable { + ($(<$K:ident: $Kb:ident>)? |&$lt:lifetime $self:ident: $self_ty:ty, + $vis:ident: &mut $vis_ty:ident| $block:block) => { + #[allow(unused_parens, non_local_definitions)] + impl<$($K: $Kb,)? $lt, $vis_ty: Visitor<$lt>> Walkable<$lt, $vis_ty> for $self_ty { + fn walk_ref(&$lt $self, $vis: &mut $vis_ty) -> V::Result { + $block + } + } + }; +} + +macro_rules! impl_visitable_noop { + (<$lt:lifetime> $($ty:ty,)*) => { + $( + impl_visitable!(|&$lt self: $ty, _vis: &mut V, _extra: ()| { + V::Result::output() + }); + )* + }; +} + +macro_rules! impl_visitable_list { + (<$lt:lifetime> $($ty:ty,)*) => { + $(impl<$lt, V: Visitor<$lt>, T> Visitable<$lt, V> for $ty + where + &$lt $ty: IntoIterator, + T: $lt + Visitable<$lt, V>, + { + type Extra = >::Extra; + + #[inline] + fn visit(&$lt self, visitor: &mut V, extra: Self::Extra) -> V::Result { + for i in self { + try_visit!(i.visit(visitor, extra)); + } + V::Result::output() + } + })* + }; +} + +macro_rules! impl_visitable_direct { + (<$lt:lifetime> $($ty:ty,)*) => { + $(impl_visitable!( + |&$lt self: $ty, visitor: &mut V, _extra: ()| { + Walkable::walk_ref(self, visitor) + } + );)* + }; +} + +macro_rules! impl_visitable_calling_walkable { + (<$lt:lifetime> + $( fn $method:ident($ty:ty $(, $extra_name:ident: $extra_ty:ty)?); )* + ) => { + $(fn $method(&mut self, node: &$lt $ty $(, $extra_name:$extra_ty)?) -> Self::Result { + impl_visitable!(|&$lt self: $ty, visitor: &mut V, extra: ($($extra_ty)?)| { + let ($($extra_name)?) = extra; + visitor.$method(self $(, $extra_name)?) + }); + walk_walkable!(self, node, ) + })* + }; +} + +macro_rules! define_named_walk { + ($Visitor:ident<$lt:lifetime> + $( pub fn $method:ident($ty:ty); )* + ) => { + $(pub fn $method<$lt, V: $Visitor<$lt>>(visitor: &mut V, node: &$lt $ty) -> V::Result { + walk_walkable!(visitor, node,) + })* + }; +} + #[macro_export] macro_rules! common_visitor_and_walkers { ($(($mut: ident))? $Visitor:ident$(<$lt:lifetime>)?) => { @@ -120,6 +355,139 @@ macro_rules! common_visitor_and_walkers { } } + // This macro generates `impl Visitable` and `impl MutVisitable` that do nothing. + impl_visitable_noop!(<$($lt)? $($mut)?> + AttrId, + bool, + rustc_span::ByteSymbol, + char, + crate::token::CommentKind, + crate::token::Delimiter, + crate::token::Lit, + crate::token::LitKind, + crate::tokenstream::LazyAttrTokenStream, + crate::tokenstream::TokenStream, + Movability, + Mutability, + Result<(), rustc_span::ErrorGuaranteed>, + rustc_data_structures::fx::FxHashMap, + rustc_span::ErrorGuaranteed, + std::borrow::Cow<'_, str>, + Symbol, + u8, + usize, + ); + // `Span` is only a no-op for the non-mutable visitor. + $(impl_visitable_noop!(<$lt> Span,);)? + + // This macro generates `impl Visitable` and `impl MutVisitable` that simply iterate over + // their contents. We do not use a generic impl for `ThinVec` because we want to allow + // custom visits for the `MutVisitor`. + impl_visitable_list!(<$($lt)? $($mut)?> + ThinVec, + ThinVec, + ThinVec<(Ident, Option)>, + ThinVec<(NodeId, Path)>, + ThinVec, + ThinVec, + ThinVec>, + ThinVec>, + ThinVec>, + ); + + // This macro generates `impl Visitable` and `impl MutVisitable` that forward to `Walkable` + // or `MutWalkable`. By default, all types that do not have a custom visit method in the + // visitor should appear here. + impl_visitable_direct!(<$($lt)? $($mut)?> + AngleBracketedArg, + AngleBracketedArgs, + AsmMacro, + AssignOpKind, + AssocItemConstraintKind, + AttrArgs, + AttrItem, + AttrKind, + AttrStyle, + FnPtrTy, + BindingMode, + GenBlockKind, + RangeLimits, + UnsafeBinderCastKind, + BinOpKind, + BlockCheckMode, + BorrowKind, + BoundAsyncness, + BoundConstness, + BoundPolarity, + ByRef, + Closure, + Const, + ConstItem, + Defaultness, + Delegation, + DelegationMac, + DelimArgs, + DelimSpan, + EnumDef, + Extern, + ForLoopKind, + FormatArgPosition, + FormatArgsPiece, + FormatArgument, + FormatArgumentKind, + FormatArguments, + FormatPlaceholder, + GenericParamKind, + Impl, + ImplPolarity, + Inline, + InlineAsmOperand, + InlineAsmRegOrRegClass, + InlineAsmTemplatePiece, + IsAuto, + LocalKind, + MacCallStmt, + MacStmtStyle, + MatchKind, + MethodCall, + ModKind, + ModSpans, + MutTy, + NormalAttr, + Parens, + ParenthesizedArgs, + PatFieldsRest, + PatKind, + RangeEnd, + RangeSyntax, + Recovered, + Safety, + StaticItem, + StrLit, + StrStyle, + StructExpr, + StructRest, + Term, + Trait, + TraitBoundModifiers, + TraitObjectSyntax, + TyAlias, + TyAliasWhereClause, + TyAliasWhereClauses, + TyKind, + TyPatKind, + UnOp, + UnsafeBinderTy, + UnsafeSource, + UseTreeKind, + VisibilityKind, + WhereBoundPredicate, + WhereClause, + WhereEqPredicate, + WhereRegionPredicate, + YieldKind, + ); + /// Each method of this trait is a hook to be potentially /// overridden. Each method's default implementation recursively visits /// the substructure of the input via the corresponding `walk` method; @@ -169,47 +537,82 @@ macro_rules! common_visitor_and_walkers { // field access version will continue working and it would be easy to // forget to add handling for it. fn visit_ident(&mut self, Ident { name: _, span }: &$($lt)? $($mut)? Ident) -> Self::Result { + impl_visitable!(|&$($lt)? $($mut)? self: Ident, visitor: &mut V, _extra: ()| { + visitor.visit_ident(self) + }); visit_span(self, span) } - fn visit_foreign_mod(&mut self, nm: &$($lt)? $($mut)? ForeignMod) -> Self::Result { - walk_foreign_mod(self, nm) - } + // This macro defines a custom visit method for each listed type. + // It implements `impl Visitable` and `impl MutVisitable` to call those methods on the + // visitor. + impl_visitable_calling_walkable!(<$($lt)? $($mut)?> + fn visit_anon_const(AnonConst); + fn visit_arm(Arm); + //fn visit_assoc_item(AssocItem, _ctxt: AssocCtxt); + fn visit_assoc_item_constraint(AssocItemConstraint); + fn visit_attribute(Attribute); + fn visit_block(Block); + //fn visit_nested_use_tree((UseTree, NodeId)); + fn visit_capture_by(CaptureBy); + fn visit_closure_binder(ClosureBinder); + fn visit_contract(FnContract); + fn visit_coroutine_kind(CoroutineKind); + fn visit_crate(Crate); + fn visit_expr(Expr); + fn visit_expr_field(ExprField); + fn visit_field_def(FieldDef); + fn visit_fn_decl(FnDecl); + fn visit_fn_header(FnHeader); + fn visit_fn_ret_ty(FnRetTy); + //fn visit_foreign_item(ForeignItem); + fn visit_foreign_mod(ForeignMod); + fn visit_format_args(FormatArgs); + fn visit_generic_arg(GenericArg); + fn visit_generic_args(GenericArgs); + fn visit_generic_param(GenericParam); + fn visit_generics(Generics); + fn visit_inline_asm(InlineAsm); + fn visit_inline_asm_sym(InlineAsmSym); + //fn visit_item(Item); + fn visit_label(Label); + fn visit_lifetime(Lifetime, _ctxt: LifetimeCtxt); + fn visit_local(Local); + fn visit_mac_call(MacCall); + fn visit_macro_def(MacroDef); + fn visit_param_bound(GenericBound, _ctxt: BoundKind); + fn visit_param(Param); + fn visit_pat_field(PatField); + fn visit_path(Path); + fn visit_path_segment(PathSegment); + fn visit_pat(Pat); + fn visit_poly_trait_ref(PolyTraitRef); + fn visit_precise_capturing_arg(PreciseCapturingArg); + fn visit_qself(QSelf); + fn visit_trait_ref(TraitRef); + fn visit_ty_pat(TyPat); + fn visit_ty(Ty); + fn visit_use_tree(UseTree); + fn visit_variant_data(VariantData); + fn visit_variant(Variant); + fn visit_vis(Visibility); + fn visit_where_predicate_kind(WherePredicateKind); + fn visit_where_predicate(WherePredicate); + ); - fn visit_foreign_item(&mut self, i: &$($lt)? $($mut)? ForeignItem) -> Self::Result { - walk_item(self, i) - } - - fn visit_item(&mut self, i: &$($lt)? $($mut)? Item) -> Self::Result { - walk_item(self, i) - } - - fn visit_local(&mut self, l: &$($lt)? $($mut)? Local) -> Self::Result { - walk_local(self, l) - } - - fn visit_block(&mut self, b: &$($lt)? $($mut)? Block) -> Self::Result { - walk_block(self, b) - } - - fn visit_param(&mut self, param: &$($lt)? $($mut)? Param) -> Self::Result { - walk_param(self, param) - } - - fn visit_arm(&mut self, a: &$($lt)? $($mut)? Arm) -> Self::Result { - walk_arm(self, a) - } - - fn visit_pat(&mut self, p: &$($lt)? $($mut)? Pat) -> Self::Result { - walk_pat(self, p) - } - - fn visit_anon_const(&mut self, c: &$($lt)? $($mut)? AnonConst) -> Self::Result { - walk_anon_const(self, c) - } - - fn visit_expr(&mut self, ex: &$($lt)? $($mut)? Expr) -> Self::Result { - walk_expr(self, ex) + // We want `Visitor` to take the `NodeId` by value. + fn visit_id(&mut self, _id: $(&$mut)? NodeId) -> Self::Result { + $(impl_visitable!( + |&$lt self: NodeId, visitor: &mut V, _extra: ()| { + visitor.visit_id(*self) + } + );)? + $(impl_visitable!( + |&$mut self: NodeId, visitor: &mut V, _extra: ()| { + visitor.visit_id(self) + } + );)? + Self::Result::output() } /// This method is a hack to workaround unstable of `stmt_expr_attributes`. @@ -218,34 +621,25 @@ macro_rules! common_visitor_and_walkers { self.visit_expr(ex) } - fn visit_ty(&mut self, t: &$($lt)? $($mut)? Ty) -> Self::Result { - walk_ty(self, t) + fn visit_item(&mut self, item: &$($lt)? $($mut)? Item) -> Self::Result { + impl_visitable!(|&$($lt)? $($mut)? self: Item, vis: &mut V, _extra: ()| { + vis.visit_item(self) + }); + walk_item(self, item) } - fn visit_ty_pat(&mut self, t: &$($lt)? $($mut)? TyPat) -> Self::Result { - walk_ty_pat(self, t) + fn visit_foreign_item(&mut self, item: &$($lt)? $($mut)? ForeignItem) -> Self::Result { + impl_visitable!(|&$($lt)? $($mut)? self: ForeignItem, vis: &mut V, _extra: ()| { + vis.visit_foreign_item(self) + }); + walk_item(self, item) } - fn visit_generic_param(&mut self, param: &$($lt)? $($mut)? GenericParam) -> Self::Result { - walk_generic_param(self, param) - } - - fn visit_generics(&mut self, g: &$($lt)? $($mut)? Generics) -> Self::Result { - walk_generics(self, g) - } - fn visit_closure_binder(&mut self, b: &$($lt)? $($mut)? ClosureBinder) -> Self::Result { - walk_closure_binder(self, b) - } - fn visit_contract(&mut self, c: &$($lt)? $($mut)? FnContract) -> Self::Result { - walk_contract(self, c) - } - - fn visit_where_predicate(&mut self, p: &$($lt)? $($mut)? WherePredicate) -> Self::Result { - walk_where_predicate(self, p) - } - - fn visit_where_predicate_kind(&mut self, k: &$($lt)? $($mut)? WherePredicateKind) -> Self::Result { - walk_where_predicate_kind(self, k) + fn visit_assoc_item(&mut self, item: &$($lt)? $($mut)? AssocItem, ctxt: AssocCtxt) -> Self::Result { + impl_visitable!(|&$($lt)? $($mut)? self: AssocItem, vis: &mut V, ctxt: AssocCtxt| { + vis.visit_assoc_item(self, ctxt) + }); + walk_assoc_item(self, item, ctxt) } // for `MutVisitor`: `Span` and `NodeId` are mutated at the caller site. @@ -258,141 +652,6 @@ macro_rules! common_visitor_and_walkers { walk_fn(self, fk) } - fn visit_assoc_item(&mut self, i: &$($lt)? $($mut)? AssocItem, ctxt: AssocCtxt) -> Self::Result { - walk_assoc_item(self, i, ctxt) - } - - fn visit_trait_ref(&mut self, t: &$($lt)? $($mut)? TraitRef) -> Self::Result { - walk_trait_ref(self, t) - } - - fn visit_param_bound(&mut self, bounds: &$($lt)? $($mut)? GenericBound, _ctxt: BoundKind) -> Self::Result { - walk_param_bound(self, bounds) - } - - fn visit_precise_capturing_arg(&mut self, arg: &$($lt)? $($mut)? PreciseCapturingArg) -> Self::Result { - walk_precise_capturing_arg(self, arg) - } - - fn visit_poly_trait_ref(&mut self, t: &$($lt)? $($mut)? PolyTraitRef) -> Self::Result { - walk_poly_trait_ref(self, t) - } - - fn visit_variant_data(&mut self, s: &$($lt)? $($mut)? VariantData) -> Self::Result { - walk_variant_data(self, s) - } - - fn visit_field_def(&mut self, s: &$($lt)? $($mut)? FieldDef) -> Self::Result { - walk_field_def(self, s) - } - - fn visit_variant(&mut self, v: &$($lt)? $($mut)? Variant) -> Self::Result { - walk_variant(self, v) - } - - fn visit_label(&mut self, label: &$($lt)? $($mut)? Label) -> Self::Result { - walk_label(self, label) - } - - fn visit_lifetime(&mut self, lifetime: &$($lt)? $($mut)? Lifetime, $(${ignore($lt)} _: LifetimeCtxt )?) -> Self::Result { - walk_lifetime(self, lifetime) - } - - fn visit_mac_call(&mut self, mac: &$($lt)? $($mut)? MacCall) -> Self::Result { - walk_mac(self, mac) - } - - fn visit_id(&mut self, _id: $(&$mut)? NodeId) -> Self::Result { - Self::Result::output() - } - - fn visit_macro_def(&mut self, macro_def: &$($lt)? $($mut)? MacroDef) -> Self::Result { - walk_macro_def(self, macro_def) - } - - fn visit_path(&mut self, path: &$($lt)? $($mut)? Path) -> Self::Result { - walk_path(self, path) - } - - fn visit_use_tree(&mut self, use_tree: &$($lt)? $($mut)? UseTree) -> Self::Result { - walk_use_tree(self, use_tree) - } - - fn visit_path_segment(&mut self, path_segment: &$($lt)? $($mut)? PathSegment) -> Self::Result { - walk_path_segment(self, path_segment) - } - - fn visit_generic_args(&mut self, generic_args: &$($lt)? $($mut)? GenericArgs) -> Self::Result { - walk_generic_args(self, generic_args) - } - - fn visit_generic_arg(&mut self, generic_arg: &$($lt)? $($mut)? GenericArg) -> Self::Result { - walk_generic_arg(self, generic_arg) - } - - fn visit_assoc_item_constraint( - &mut self, - constraint: &$($lt)? $($mut)? AssocItemConstraint, - ) -> Self::Result { - walk_assoc_item_constraint(self, constraint) - } - - fn visit_attribute(&mut self, attr: &$($lt)? $($mut)? Attribute) -> Self::Result { - walk_attribute(self, attr) - } - - fn visit_vis(&mut self, vis: &$($lt)? $($mut)? Visibility) -> Self::Result { - walk_vis(self, vis) - } - - fn visit_fn_ret_ty(&mut self, ret_ty: &$($lt)? $($mut)? FnRetTy) -> Self::Result { - walk_fn_ret_ty(self, ret_ty) - } - - fn visit_fn_header(&mut self, header: &$($lt)? $($mut)? FnHeader) -> Self::Result { - walk_fn_header(self, header) - } - - fn visit_expr_field(&mut self, f: &$($lt)? $($mut)? ExprField) -> Self::Result { - walk_expr_field(self, f) - } - - fn visit_pat_field(&mut self, fp: &$($lt)? $($mut)? PatField) -> Self::Result { - walk_pat_field(self, fp) - } - - fn visit_crate(&mut self, krate: &$($lt)? $($mut)? Crate) -> Self::Result { - walk_crate(self, krate) - } - - fn visit_inline_asm(&mut self, asm: &$($lt)? $($mut)? InlineAsm) -> Self::Result { - walk_inline_asm(self, asm) - } - - fn visit_format_args(&mut self, fmt: &$($lt)? $($mut)? FormatArgs) -> Self::Result { - walk_format_args(self, fmt) - } - - fn visit_inline_asm_sym(&mut self, sym: &$($lt)? $($mut)? InlineAsmSym) -> Self::Result { - walk_inline_asm_sym(self, sym) - } - - fn visit_capture_by(&mut self, capture_by: &$($lt)? $($mut)? CaptureBy) -> Self::Result { - walk_capture_by(self, capture_by) - } - - fn visit_coroutine_kind(&mut self, coroutine_kind: &$($lt)? $($mut)? CoroutineKind) -> Self::Result { - walk_coroutine_kind(self, coroutine_kind) - } - - fn visit_fn_decl(&mut self, fn_decl: &$($lt)? $($mut)? FnDecl) -> Self::Result { - walk_fn_decl(self, fn_decl) - } - - fn visit_qself(&mut self, qs: &$($lt)? $($mut)? Option>) -> Self::Result { - walk_qself(self, qs) - } - // (non-mut) `Visitor`-only methods $( fn visit_stmt(&mut self, s: &$lt Stmt) -> Self::Result { @@ -407,6 +666,16 @@ macro_rules! common_visitor_and_walkers { // `MutVisitor`-only methods $( + // Span visiting is no longer used, but we keep it for now, + // in case it's needed for something like #127241. + #[inline] + fn visit_span(&mut self, _sp: &$mut Span) { + impl_visitable!(|&mut self: Span, visitor: &mut V, _extra: ()| { + visitor.visit_span(self) + }); + // Do nothing. + } + fn flat_map_foreign_item(&mut self, ni: P) -> SmallVec<[P; 1]> { walk_flat_map_foreign_item(self, ni) } @@ -462,12 +731,6 @@ macro_rules! common_visitor_and_walkers { walk_flat_map_where_predicate(self, where_predicate) } - // Span visiting is no longer used, but we keep it for now, - // in case it's needed for something like #127241. - fn visit_span(&mut self, _sp: &$mut Span) { - // Do nothing. - } - fn flat_map_pat_field(&mut self, fp: PatField) -> SmallVec<[PatField; 1]> { walk_flat_map_pat_field(self, fp) } @@ -492,148 +755,45 @@ macro_rules! common_visitor_and_walkers { #[inline] )? fn visit_span<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, span: &$($lt)? $($mut)? Span) -> V::Result { - $( - ${ignore($mut)} - vis.visit_span(span); - )? + $(${ignore($mut)} vis.visit_span(span))?; V::Result::output() } - /// helper since `Visitor` wants `NodeId` but `MutVisitor` wants `&mut NodeId` - $(${ignore($lt)} - #[expect(rustc::pass_by_value)] - )? - #[inline] - fn visit_id<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, id: &$($lt)? $($mut)? NodeId) -> V::Result { - // deref `&NodeId` into `NodeId` only for `Visitor` - vis.visit_id( $(${ignore($lt)} * )? id) - } - - // this is only used by the MutVisitor. We include this symmetry here to make writing other functions easier - fn visit_safety<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, safety: &$($lt)? $($mut)? Safety) -> V::Result { - match safety { - Safety::Unsafe(span) => visit_span(vis, span), - Safety::Safe(span) => visit_span(vis, span), - Safety::Default => { V::Result::output() } - } - } - - fn visit_constness<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, constness: &$($lt)? $($mut)? Const) -> V::Result { - match constness { - Const::Yes(span) => visit_span(vis, span), - Const::No => { - V::Result::output() - } - } - } - - fn visit_defaultness<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, defaultness: &$($lt)? $($mut)? Defaultness) -> V::Result { - match defaultness { - Defaultness::Default(span) => visit_span(vis, span), - Defaultness::Final => { - V::Result::output() - } - } - } - - fn visit_polarity<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - polarity: &$($lt)? $($mut)? ImplPolarity, - ) -> V::Result { - match polarity { - ImplPolarity::Positive => { V::Result::output() } - ImplPolarity::Negative(span) => visit_span(vis, span), - } - } - - $(${ignore($lt)} - #[inline] - )? - fn visit_modifiers<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - m: &$($lt)? $($mut)? TraitBoundModifiers - ) -> V::Result { - let TraitBoundModifiers { constness, asyncness, polarity } = m; - match constness { - BoundConstness::Never => {} - BoundConstness::Always(span) | BoundConstness::Maybe(span) => try_visit!(visit_span(vis, span)), - } - match asyncness { - BoundAsyncness::Normal => {} - BoundAsyncness::Async(span) => try_visit!(visit_span(vis, span)), - } - match polarity { - BoundPolarity::Positive => {} - BoundPolarity::Negative(span) | BoundPolarity::Maybe(span) => try_visit!(visit_span(vis, span)), + $(impl_visitable!(|&$lt self: ThinVec<(UseTree, NodeId)>, vis: &mut V, _extra: ()| { + for (nested_tree, nested_id) in self { + try_visit!(vis.visit_nested_use_tree(nested_tree, *nested_id)); } V::Result::output() - } + });)? + $(impl_visitable_list!(<$mut> ThinVec<(UseTree, NodeId)>,);)? - $(${ignore($lt)} - #[inline] - )? - fn walk_capture_by<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - capture_by: &$($lt)? $($mut)? CaptureBy - ) -> V::Result { - match capture_by { - CaptureBy::Ref => { V::Result::output() } - CaptureBy::Value { move_kw } => { - visit_span(vis, move_kw) - } - CaptureBy::Use { use_kw } => { - visit_span(vis, use_kw) - } - } - } - - fn visit_bounds<$($lt,)? V: $Visitor$(<$lt>)?>(visitor: &mut V, bounds: &$($lt)? $($mut)? GenericBounds, ctxt: BoundKind) -> V::Result { - walk_list!(visitor, visit_param_bound, bounds, ctxt); - V::Result::output() - } - - pub fn walk_label<$($lt,)? V: $Visitor$(<$lt>)?>(visitor: &mut V, Label { ident }: &$($lt)? $($mut)? Label) -> V::Result { - visitor.visit_ident(ident) - } - - pub fn walk_fn_header<$($lt,)? V: $Visitor$(<$lt>)?>(visitor: &mut V, header: &$($lt)? $($mut)? FnHeader) -> V::Result { - let FnHeader { safety, coroutine_kind, constness, ext: _ } = header; - try_visit!(visit_constness(visitor, constness)); - visit_opt!(visitor, visit_coroutine_kind, coroutine_kind); - visit_safety(visitor, safety) - } - - pub fn walk_lifetime<$($lt,)? V: $Visitor$(<$lt>)?>(visitor: &mut V, Lifetime { id, ident }: &$($lt)? $($mut)? Lifetime) -> V::Result { - try_visit!(visit_id(visitor, id)); - visitor.visit_ident(ident) - } - - fn walk_item_ctxt<$($lt,)? V: $Visitor$(<$lt>)?, K: WalkItemKind>( + fn walk_item_inner<$($lt,)? K: WalkItemKind, V: $Visitor$(<$lt>)?>( visitor: &mut V, item: &$($mut)? $($lt)? Item, ctxt: K::Ctxt, ) -> V::Result { let Item { attrs, id, kind, vis, span, tokens: _ } = item; - try_visit!(visit_id(visitor, id)); - walk_list!(visitor, visit_attribute, attrs); - try_visit!(visitor.visit_vis(vis)); + visit_visitable!($($mut)? visitor, id, attrs, vis); try_visit!(kind.walk(*span, *id, vis, ctxt, visitor)); - visit_span(visitor, span) + visit_visitable!($($mut)? visitor, span); + V::Result::output() } - pub fn walk_item<$($lt,)? V: $Visitor$(<$lt>)?, K: WalkItemKind>( + // Do not implement `Walkable`/`MutWalkable` for *Item to avoid confusion. + pub fn walk_item<$($lt,)? K: WalkItemKind, V: $Visitor$(<$lt>)?>( visitor: &mut V, item: &$($mut)? $($lt)? Item, ) -> V::Result { - walk_item_ctxt(visitor, item, ()) + walk_item_inner(visitor, item, ()) } - pub fn walk_assoc_item<$($lt,)? V: $Visitor$(<$lt>)?>( + // Do not implement `Walkable`/`MutWalkable` for *Item to avoid confusion. + pub fn walk_assoc_item<$($lt,)? K: WalkItemKind, V: $Visitor$(<$lt>)?>( visitor: &mut V, - item: &$($mut)? $($lt)? AssocItem, + item: &$($mut)? $($lt)? Item, ctxt: AssocCtxt, ) -> V::Result { - walk_item_ctxt(visitor, item, ctxt) + walk_item_inner(visitor, item, ctxt) } impl WalkItemKind for ItemKind { @@ -647,180 +807,52 @@ macro_rules! common_visitor_and_walkers { vis: &mut V, ) -> V::Result { match self { - ItemKind::ExternCrate(_orig_name, ident) => vis.visit_ident(ident), - ItemKind::Use(use_tree) => vis.visit_use_tree(use_tree), - ItemKind::Static(box StaticItem { - ident, - ty, - safety: _, - mutability: _, - expr, - define_opaque, - }) => { - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_ty(ty)); - visit_opt!(vis, visit_expr, expr); - walk_define_opaques(vis, define_opaque) - } - ItemKind::Const(item) => { - walk_const_item(vis, item) - } ItemKind::Fn(func) => { let kind = FnKind::Fn(FnCtxt::Free, visibility, &$($mut)? *func); - vis.visit_fn(kind, span, id) - } - ItemKind::Mod(safety, ident, mod_kind) => { - try_visit!(visit_safety(vis, safety)); - try_visit!(vis.visit_ident(ident)); - match mod_kind { - ModKind::Loaded( - items, - _inline, - ModSpans { inner_span, inject_use_span }, - _, - ) => { - try_visit!(visit_items(vis, items)); - try_visit!(visit_span(vis, inner_span)); - try_visit!(visit_span(vis, inject_use_span)); - } - ModKind::Unloaded => {} - } - V::Result::output() - } - ItemKind::ForeignMod(nm) => vis.visit_foreign_mod(nm), - ItemKind::GlobalAsm(asm) => vis.visit_inline_asm(asm), - ItemKind::TyAlias(box TyAlias { - defaultness, - ident, - generics, - $(${ignore($lt)} #[expect(unused)])? - where_clauses, - bounds, - ty, - }) => { - try_visit!(visit_defaultness(vis, defaultness)); - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_generics(generics)); - try_visit!(visit_bounds(vis, bounds, BoundKind::Bound)); - visit_opt!(vis, visit_ty, ty); - $(${ignore($mut)} - walk_ty_alias_where_clauses(vis, where_clauses); - )? - V::Result::output() - } - ItemKind::Enum(ident, generics, enum_definition) => { - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_generics(generics)); - visit_variants(vis, &$($mut)? enum_definition.variants) + try_visit!(vis.visit_fn(kind, span, id)); } + ItemKind::ExternCrate(orig_name, ident) => + visit_visitable!($($mut)? vis, orig_name, ident), + ItemKind::Use(use_tree) => + visit_visitable!($($mut)? vis, use_tree), + ItemKind::Static(item) => + visit_visitable!($($mut)? vis, item), + ItemKind::Const(item) => + visit_visitable!($($mut)? vis, item), + ItemKind::Mod(safety, ident, mod_kind) => + visit_visitable!($($mut)? vis, safety, ident, mod_kind), + ItemKind::ForeignMod(nm) => + visit_visitable!($($mut)? vis, nm), + ItemKind::GlobalAsm(asm) => + visit_visitable!($($mut)? vis, asm), + ItemKind::TyAlias(ty_alias) => + visit_visitable!($($mut)? vis, ty_alias), + ItemKind::Enum(ident, generics, enum_definition) => + visit_visitable!($($mut)? vis, ident, generics, enum_definition), ItemKind::Struct(ident, generics, variant_data) - | ItemKind::Union(ident, generics, variant_data) => { - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_generics(generics)); - vis.visit_variant_data(variant_data) - } - ItemKind::Impl(box Impl { - defaultness, - safety, - generics, - constness, - polarity, - of_trait, - self_ty, - items, - }) => { - try_visit!(visit_defaultness(vis, defaultness)); - try_visit!(visit_safety(vis, safety)); - try_visit!(vis.visit_generics(generics)); - try_visit!(visit_constness(vis, constness)); - try_visit!(visit_polarity(vis, polarity)); - visit_opt!(vis, visit_trait_ref, of_trait); - try_visit!(vis.visit_ty(self_ty)); - visit_assoc_items(vis, items, AssocCtxt::Impl { of_trait: of_trait.is_some() }) - } - ItemKind::Trait(box Trait { constness, safety, is_auto: _, ident, generics, bounds, items }) => { - try_visit!(visit_constness(vis, constness)); - try_visit!(visit_safety(vis, safety)); - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_generics(generics)); - try_visit!(visit_bounds(vis, bounds, BoundKind::Bound)); - visit_assoc_items(vis, items, AssocCtxt::Trait) - } + | ItemKind::Union(ident, generics, variant_data) => + visit_visitable!($($mut)? vis, ident, generics, variant_data), + ItemKind::Impl(impl_) => + visit_visitable!($($mut)? vis, impl_), + ItemKind::Trait(trait_) => + visit_visitable!($($mut)? vis, trait_), ItemKind::TraitAlias(ident, generics, bounds) => { - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_generics(generics)); - visit_bounds(vis, bounds, BoundKind::Bound) - } - ItemKind::MacCall(m) => vis.visit_mac_call(m), - ItemKind::MacroDef(ident, def) => { - try_visit!(vis.visit_ident(ident)); - vis.visit_macro_def(def) - } - ItemKind::Delegation(box Delegation { - id, - qself, - path, - ident, - rename, - body, - from_glob: _, - }) => { - try_visit!(visit_id(vis, id)); - try_visit!(vis.visit_qself(qself)); - try_visit!(vis.visit_path(path)); - try_visit!(vis.visit_ident(ident)); - visit_opt!(vis, visit_ident, rename); - visit_opt!(vis, visit_block, body); - V::Result::output() - } - ItemKind::DelegationMac(box DelegationMac { qself, prefix, suffixes, body }) => { - try_visit!(vis.visit_qself(qself)); - try_visit!(vis.visit_path(prefix)); - if let Some(suffixes) = suffixes { - for (ident, rename) in suffixes { - try_visit!(vis.visit_ident(ident)); - visit_opt!(vis, visit_ident, rename); - } - } - visit_opt!(vis, visit_block, body); - V::Result::output() + visit_visitable!($($mut)? vis, ident, generics); + visit_visitable_with!($($mut)? vis, bounds, BoundKind::Bound) } + ItemKind::MacCall(m) => + visit_visitable!($($mut)? vis, m), + ItemKind::MacroDef(ident, def) => + visit_visitable!($($mut)? vis, ident, def), + ItemKind::Delegation(delegation) => + visit_visitable!($($mut)? vis, delegation), + ItemKind::DelegationMac(dm) => + visit_visitable!($($mut)? vis, dm), } + V::Result::output() } } - fn walk_const_item<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - item: &$($lt)? $($mut)? ConstItem, - ) -> V::Result { - let ConstItem { defaultness, ident, generics, ty, expr, define_opaque } = item; - try_visit!(visit_defaultness(vis, defaultness)); - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_generics(generics)); - try_visit!(vis.visit_ty(ty)); - visit_opt!(vis, visit_expr, expr); - walk_define_opaques(vis, define_opaque) - } - - fn walk_foreign_mod<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, foreign_mod: &$($lt)? $($mut)? ForeignMod) -> V::Result { - let ForeignMod { extern_span: _, safety, abi: _, items } = foreign_mod; - try_visit!(visit_safety(vis, safety)); - visit_foreign_items(vis, items) - } - - fn walk_define_opaques<$($lt,)? V: $Visitor$(<$lt>)?>( - visitor: &mut V, - define_opaque: &$($lt)? $($mut)? Option>, - ) -> V::Result { - if let Some(define_opaque) = define_opaque { - for (id, path) in define_opaque { - try_visit!(visit_id(visitor, id)); - try_visit!(visitor.visit_path(path)); - } - } - V::Result::output() - } - impl WalkItemKind for AssocItemKind { type Ctxt = AssocCtxt; fn walk<$($lt,)? V: $Visitor$(<$lt>)?>( @@ -832,64 +864,22 @@ macro_rules! common_visitor_and_walkers { vis: &mut V, ) -> V::Result { match self { - AssocItemKind::Const(item) => { - walk_const_item(vis, item) - } + AssocItemKind::Const(item) => + visit_visitable!($($mut)? vis, item), AssocItemKind::Fn(func) => { - vis.visit_fn(FnKind::Fn(FnCtxt::Assoc(ctxt), visibility, &$($mut)? *func), span, id) - } - AssocItemKind::Type(box TyAlias { - generics, - ident, - bounds, - ty, - defaultness, - $(${ignore($lt)} #[expect(unused)])? - where_clauses, - }) => { - try_visit!(visit_defaultness(vis, defaultness)); - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_generics(generics)); - try_visit!(visit_bounds(vis, bounds, BoundKind::Bound)); - visit_opt!(vis, visit_ty, ty); - $(${ignore($mut)} - walk_ty_alias_where_clauses(vis, where_clauses); - )? - V::Result::output() - } - AssocItemKind::MacCall(mac) => { - vis.visit_mac_call(mac) - } - AssocItemKind::Delegation(box Delegation { - id, - qself, - path, - ident, - rename, - body, - from_glob: _, - }) => { - try_visit!(visit_id(vis, id)); - try_visit!(vis.visit_qself(qself)); - try_visit!(vis.visit_path(path)); - try_visit!(vis.visit_ident(ident)); - visit_opt!(vis, visit_ident, rename); - visit_opt!(vis, visit_block, body); - V::Result::output() - } - AssocItemKind::DelegationMac(box DelegationMac { qself, prefix, suffixes, body }) => { - try_visit!(vis.visit_qself(qself)); - try_visit!(vis.visit_path(prefix)); - if let Some(suffixes) = suffixes { - for (ident, rename) in suffixes { - try_visit!(vis.visit_ident(ident)); - visit_opt!(vis, visit_ident, rename); - } - } - visit_opt!(vis, visit_block, body); - V::Result::output() + let kind = FnKind::Fn(FnCtxt::Assoc(ctxt), visibility, &$($mut)? *func); + try_visit!(vis.visit_fn(kind, span, id)) } + AssocItemKind::Type(alias) => + visit_visitable!($($mut)? vis, alias), + AssocItemKind::MacCall(mac) => + visit_visitable!($($mut)? vis, mac), + AssocItemKind::Delegation(delegation) => + visit_visitable!($($mut)? vis, delegation), + AssocItemKind::DelegationMac(dm) => + visit_visitable!($($mut)? vis, dm), } + V::Result::output() } } @@ -904,545 +894,18 @@ macro_rules! common_visitor_and_walkers { vis: &mut V, ) -> V::Result { match self { - ForeignItemKind::Static(box StaticItem { - ident, - ty, - mutability: _, - expr, - safety: _, - define_opaque, - }) => { - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_ty(ty)); - visit_opt!(vis, visit_expr, expr); - walk_define_opaques(vis, define_opaque) - } + ForeignItemKind::Static(item) => + visit_visitable!($($mut)? vis, item), ForeignItemKind::Fn(func) => { - vis.visit_fn(FnKind::Fn(FnCtxt::Foreign, visibility, &$($mut)?*func), span, id) - } - ForeignItemKind::TyAlias(box TyAlias { - defaultness, - ident, - generics, - bounds, - ty, - $(${ignore($lt)} #[expect(unused)])? - where_clauses, - }) => { - try_visit!(visit_defaultness(vis, defaultness)); - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_generics(generics)); - try_visit!(visit_bounds(vis, bounds, BoundKind::Bound)); - visit_opt!(vis, visit_ty, ty); - $(${ignore($mut)} - walk_ty_alias_where_clauses(vis, where_clauses); - )? - V::Result::output() - } - ForeignItemKind::MacCall(mac) => { - vis.visit_mac_call(mac) + let kind = FnKind::Fn(FnCtxt::Foreign, visibility, &$($mut)?*func); + try_visit!(vis.visit_fn(kind, span, id)) } + ForeignItemKind::TyAlias(alias) => + visit_visitable!($($mut)? vis, alias), + ForeignItemKind::MacCall(mac) => + visit_visitable!($($mut)? vis, mac), } - } - } - - fn walk_coroutine_kind<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - coroutine_kind: &$($lt)? $($mut)? CoroutineKind, - ) -> V::Result { - let (CoroutineKind::Async { span, closure_id, return_impl_trait_id } - | CoroutineKind::Gen { span, closure_id, return_impl_trait_id } - | CoroutineKind::AsyncGen { span, closure_id, return_impl_trait_id }) - = coroutine_kind; - try_visit!(visit_id(vis, closure_id)); - try_visit!(visit_id(vis, return_impl_trait_id)); - visit_span(vis, span) - } - - pub fn walk_pat<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - pattern: &$($lt)? $($mut)? Pat - ) -> V::Result { - let Pat { id, kind, span, tokens: _ } = pattern; - try_visit!(visit_id(vis, id)); - match kind { - PatKind::Err(_guar) => {} - PatKind::Missing | PatKind::Wild | PatKind::Rest | PatKind::Never => {} - PatKind::Ident(_bmode, ident, optional_subpattern) => { - try_visit!(vis.visit_ident(ident)); - visit_opt!(vis, visit_pat, optional_subpattern); - } - PatKind::Expr(expression) => try_visit!(vis.visit_expr(expression)), - PatKind::TupleStruct(opt_qself, path, elems) => { - try_visit!(vis.visit_qself(opt_qself)); - try_visit!(vis.visit_path(path)); - walk_list!(vis, visit_pat, elems); - } - PatKind::Path(opt_qself, path) => { - try_visit!(vis.visit_qself(opt_qself)); - try_visit!(vis.visit_path(path)) - } - PatKind::Struct(opt_qself, path, fields, _rest) => { - try_visit!(vis.visit_qself(opt_qself)); - try_visit!(vis.visit_path(path)); - try_visit!(visit_pat_fields(vis, fields)); - } - PatKind::Box(subpattern) | PatKind::Deref(subpattern) | PatKind::Paren(subpattern) => { - try_visit!(vis.visit_pat(subpattern)); - } - PatKind::Ref(subpattern, _ /*mutbl*/) => { - try_visit!(vis.visit_pat(subpattern)); - } - PatKind::Range(lower_bound, upper_bound, _end) => { - visit_opt!(vis, visit_expr, lower_bound); - visit_opt!(vis, visit_expr, upper_bound); - try_visit!(visit_span(vis, span)); - } - PatKind::Guard(subpattern, guard_condition) => { - try_visit!(vis.visit_pat(subpattern)); - try_visit!(vis.visit_expr(guard_condition)); - } - PatKind::Tuple(elems) | PatKind::Slice(elems) | PatKind::Or(elems) => { - walk_list!(vis, visit_pat, elems); - } - PatKind::MacCall(mac) => try_visit!(vis.visit_mac_call(mac)), - } - visit_span(vis, span) - } - - pub fn walk_anon_const<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - constant: &$($lt)? $($mut)? AnonConst, - ) -> V::Result { - let AnonConst { id, value } = constant; - try_visit!(visit_id(vis, id)); - vis.visit_expr(value) - } - - pub fn walk_path_segment<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - segment: &$($lt)? $($mut)? PathSegment, - ) -> V::Result { - let PathSegment { ident, id, args } = segment; - try_visit!(visit_id(vis, id)); - try_visit!(vis.visit_ident(ident)); - visit_opt!(vis, visit_generic_args, args); - V::Result::output() - } - - pub fn walk_block<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - block: &$($lt)? $($mut)? Block - ) -> V::Result { - let Block { stmts, id, rules: _, span, tokens: _ } = block; - try_visit!(visit_id(vis, id)); - try_visit!(visit_stmts(vis, stmts)); - visit_span(vis, span) - } - - - pub fn walk_ty<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, ty: &$($lt)? $($mut)? Ty - ) -> V::Result { - let Ty { id, kind, span, tokens: _ } = ty; - try_visit!(visit_id(vis, id)); - match kind { - TyKind::Err(_guar) => {} - TyKind::Infer | TyKind::ImplicitSelf | TyKind::Dummy | TyKind::Never | TyKind::CVarArgs => {} - TyKind::Slice(ty) | TyKind::Paren(ty) => try_visit!(vis.visit_ty(ty)), - TyKind::Ptr(MutTy { ty, mutbl: _ }) => try_visit!(vis.visit_ty(ty)), - TyKind::Ref(opt_lifetime, MutTy { ty, mutbl: _ }) - | TyKind::PinnedRef(opt_lifetime, MutTy { ty, mutbl: _ }) => { - // FIXME(fee1-dead) asymmetry - visit_opt!(vis, visit_lifetime, opt_lifetime$(${ignore($lt)}, LifetimeCtxt::Ref)?); - try_visit!(vis.visit_ty(ty)); - } - TyKind::Tup(tuple_element_types) => { - walk_list!(vis, visit_ty, tuple_element_types); - } - TyKind::FnPtr(function_declaration) => { - let FnPtrTy { safety, ext: _, generic_params, decl, decl_span } = - &$($mut)? **function_declaration; - try_visit!(visit_safety(vis, safety)); - try_visit!(visit_generic_params(vis, generic_params)); - try_visit!(vis.visit_fn_decl(decl)); - try_visit!(visit_span(vis, decl_span)); - } - TyKind::UnsafeBinder(binder) => { - try_visit!(visit_generic_params(vis, &$($mut)? binder.generic_params)); - try_visit!(vis.visit_ty(&$($mut)? binder.inner_ty)); - } - TyKind::Path(maybe_qself, path) => { - try_visit!(vis.visit_qself(maybe_qself)); - try_visit!(vis.visit_path(path)); - } - TyKind::Pat(ty, pat) => { - try_visit!(vis.visit_ty(ty)); - try_visit!(vis.visit_ty_pat(pat)); - } - TyKind::Array(ty, length) => { - try_visit!(vis.visit_ty(ty)); - try_visit!(vis.visit_anon_const(length)); - } - TyKind::TraitObject(bounds, _syntax) => { - walk_list!(vis, visit_param_bound, bounds, BoundKind::TraitObject); - } - TyKind::ImplTrait(id, bounds) => { - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_param_bound, bounds, BoundKind::Impl); - } - TyKind::Typeof(expression) => try_visit!(vis.visit_anon_const(expression)), - - TyKind::MacCall(mac) => try_visit!(vis.visit_mac_call(mac)), - } - visit_span(vis, span) - } - - pub fn walk_crate<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - krate: &$($lt)? $($mut)? Crate, - ) -> V::Result { - let Crate { attrs, items, spans, id, is_placeholder: _ } = krate; - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); - try_visit!(visit_items(vis, items)); - let ModSpans { inner_span, inject_use_span } = spans; - try_visit!(visit_span(vis, inner_span)); - visit_span(vis, inject_use_span) - } - - pub fn walk_local<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - local: &$($lt)? $($mut)? Local, - ) -> V::Result { - let Local { id, super_, pat, ty, kind, span, colon_sp, attrs, tokens: _ } = local; - if let Some(sp) = super_ { - try_visit!(visit_span(vis, sp)); - } - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); - try_visit!(vis.visit_pat(pat)); - visit_opt!(vis, visit_ty, ty); - match kind { - LocalKind::Decl => {} - LocalKind::Init(init) => { - try_visit!(vis.visit_expr(init)) - } - LocalKind::InitElse(init, els) => { - try_visit!(vis.visit_expr(init)); - try_visit!(vis.visit_block(els)); - } - } - if let Some(sp) = colon_sp { - try_visit!(visit_span(vis, sp)); - } - visit_span(vis, span) - } - - pub fn walk_poly_trait_ref<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - p: &$($lt)? $($mut)? PolyTraitRef, - ) -> V::Result { - let PolyTraitRef { bound_generic_params, modifiers, trait_ref, span, parens: _ } = p; - try_visit!(visit_modifiers(vis, modifiers)); - try_visit!(visit_generic_params(vis, bound_generic_params)); - try_visit!(vis.visit_trait_ref(trait_ref)); - visit_span(vis, span) - } - - pub fn walk_trait_ref<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - TraitRef { path, ref_id }: &$($lt)? $($mut)? TraitRef, - ) -> V::Result { - try_visit!(vis.visit_path(path)); - visit_id(vis, ref_id) - } - - pub fn walk_variant<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - variant: &$($lt)? $($mut)? Variant, - ) -> V::Result { - let Variant { attrs, id, span, vis: visibility, ident, data, disr_expr, is_placeholder: _ } = variant; - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); - try_visit!(vis.visit_vis(visibility)); - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_variant_data(data)); - visit_opt!(vis, visit_anon_const, disr_expr); - visit_span(vis, span) - } - - pub fn walk_expr_field<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - f: &$($lt)? $($mut)? ExprField, - ) -> V::Result { - let ExprField { attrs, id, span, ident, expr, is_shorthand: _, is_placeholder: _ } = f; - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_expr(expr)); - visit_span(vis, span) - } - - pub fn walk_pat_field<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - fp: &$($lt)? $($mut)? PatField, - ) -> V::Result { - let PatField { ident, pat, is_shorthand: _, attrs, id, span, is_placeholder: _ } = fp; - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_pat(pat)); - visit_span(vis, span) - } - - pub fn walk_ty_pat<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - tp: &$($lt)? $($mut)? TyPat, - ) -> V::Result { - let TyPat { id, kind, span, tokens: _ } = tp; - try_visit!(visit_id(vis, id)); - match kind { - TyPatKind::Range(start, end, Spanned { span, node: _include_end }) => { - visit_opt!(vis, visit_anon_const, start); - visit_opt!(vis, visit_anon_const, end); - try_visit!(visit_span(vis, span)); - } - TyPatKind::Or(variants) => walk_list!(vis, visit_ty_pat, variants), - TyPatKind::Err(_) => {} - } - visit_span(vis, span) - } - - fn walk_qself<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - qself: &$($lt)? $($mut)? Option>, - ) -> V::Result { - if let Some(qself) = qself { - let QSelf { ty, path_span, position: _ } = &$($mut)? **qself; - try_visit!(vis.visit_ty(ty)); - try_visit!(visit_span(vis, path_span)); - } - V::Result::output() - } - - pub fn walk_path<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - path: &$($lt)? $($mut)? Path, - ) -> V::Result { - let Path { span, segments, tokens: _ } = path; - walk_list!(vis, visit_path_segment, segments); - visit_span(vis, span) - } - - pub fn walk_use_tree<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - use_tree: &$($lt)? $($mut)? UseTree, - ) -> V::Result { - let UseTree { prefix, kind, span } = use_tree; - try_visit!(vis.visit_path(prefix)); - match kind { - UseTreeKind::Simple(rename) => { - // The extra IDs are handled during AST lowering. - visit_opt!(vis, visit_ident, rename); - } - UseTreeKind::Glob => {} - UseTreeKind::Nested { items, span } => { - for (nested_tree, nested_id) in items { - try_visit!(visit_nested_use_tree(vis, nested_tree, nested_id)); - } - try_visit!(visit_span(vis, span)); - } - } - visit_span(vis, span) - } - - pub fn walk_generic_args<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - generic_args: &$($lt)? $($mut)? GenericArgs - ) -> V::Result { - match generic_args { - GenericArgs::AngleBracketed(AngleBracketedArgs { span, args }) => { - for arg in args { - match arg { - AngleBracketedArg::Arg(a) => try_visit!(vis.visit_generic_arg(a)), - AngleBracketedArg::Constraint(c) => { - try_visit!(vis.visit_assoc_item_constraint(c)) - } - } - } - visit_span(vis, span) - } - GenericArgs::Parenthesized(data) => { - let ParenthesizedArgs { span, inputs, inputs_span, output } = data; - walk_list!(vis, visit_ty, inputs); - try_visit!(vis.visit_fn_ret_ty(output)); - try_visit!(visit_span(vis, span)); - visit_span(vis, inputs_span) - } - GenericArgs::ParenthesizedElided(span) => visit_span(vis, span) - } - } - - pub fn walk_generic_arg<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - generic_arg: &$($lt)? $($mut)? GenericArg, - ) -> V::Result { - match generic_arg { - GenericArg::Lifetime(lt) => vis.visit_lifetime(lt, $(${ignore($lt)} LifetimeCtxt::GenericArg)? ), - GenericArg::Type(ty) => vis.visit_ty(ty), - GenericArg::Const(ct) => vis.visit_anon_const(ct), - } - } - - pub fn walk_assoc_item_constraint<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - constraint: &$($lt)? $($mut)? AssocItemConstraint, - ) -> V::Result { - let AssocItemConstraint { id, ident, gen_args, kind, span } = constraint; - try_visit!(visit_id(vis, id)); - try_visit!(vis.visit_ident(ident)); - visit_opt!(vis, visit_generic_args, gen_args); - match kind { - AssocItemConstraintKind::Equality { term } => match term { - Term::Ty(ty) => try_visit!(vis.visit_ty(ty)), - Term::Const(c) => try_visit!(vis.visit_anon_const(c)), - }, - AssocItemConstraintKind::Bound { bounds } => { - try_visit!(visit_bounds(vis, bounds, BoundKind::Bound)); - } - } - visit_span(vis, span) - } - - pub fn walk_param_bound<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, bound: &$($lt)? $($mut)? GenericBound) -> V::Result { - match bound { - GenericBound::Trait(trait_ref) => vis.visit_poly_trait_ref(trait_ref), - GenericBound::Outlives(lifetime) => vis.visit_lifetime(lifetime, $(${ignore($lt)} LifetimeCtxt::Bound)?), - GenericBound::Use(args, span) => { - walk_list!(vis, visit_precise_capturing_arg, args); - visit_span(vis, span) - } - } - } - - pub fn walk_precise_capturing_arg<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - arg: &$($lt)? $($mut)? PreciseCapturingArg, - ) -> V::Result { - match arg { - PreciseCapturingArg::Lifetime(lt) => vis.visit_lifetime(lt, $(${ignore($lt)} LifetimeCtxt::GenericArg)?), - PreciseCapturingArg::Arg(path, id) => { - try_visit!(visit_id(vis, id)); - vis.visit_path(path) - } - } - } - - pub fn walk_generic_param<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - param: &$($lt)? $($mut)? GenericParam, - ) -> V::Result { - let GenericParam { id, ident, attrs, bounds, is_placeholder: _, kind, colon_span } = - param; - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); - try_visit!(vis.visit_ident(ident)); - walk_list!(vis, visit_param_bound, bounds, BoundKind::Bound); - match kind { - GenericParamKind::Lifetime => (), - GenericParamKind::Type { default } => visit_opt!(vis, visit_ty, default), - GenericParamKind::Const { ty, default, span } => { - try_visit!(vis.visit_ty(ty)); - visit_opt!(vis, visit_anon_const, default); - try_visit!(visit_span(vis, span)); - } - } - if let Some(sp) = colon_span { - try_visit!(visit_span(vis, sp)) - } - V::Result::output() - } - - pub fn walk_generics<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, generics: &$($lt)? $($mut)? Generics) -> V::Result { - let Generics { params, where_clause, span } = generics; - let WhereClause { has_where_token: _, predicates, span: where_clause_span } = where_clause; - try_visit!(visit_generic_params(vis, params)); - try_visit!(visit_where_predicates(vis, predicates)); - try_visit!(visit_span(vis, span)); - visit_span(vis, where_clause_span) - } - - pub fn walk_contract<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, c: &$($lt)? $($mut)? FnContract) -> V::Result { - let FnContract { requires, ensures } = c; - visit_opt!(vis, visit_expr, requires); - visit_opt!(vis, visit_expr, ensures); - V::Result::output() - } - - pub fn walk_where_predicate<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - predicate: &$($lt)? $($mut)? WherePredicate, - ) -> V::Result { - let WherePredicate { attrs, kind, id, span, is_placeholder: _ } = predicate; - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); - try_visit!(visit_span(vis, span)); - vis.visit_where_predicate_kind(kind) - } - - pub fn walk_closure_binder<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - binder: &$($lt)? $($mut)? ClosureBinder, - ) -> V::Result { - match binder { - ClosureBinder::NotPresent => {} - ClosureBinder::For { generic_params, span } => { - try_visit!(visit_generic_params(vis, generic_params)); - try_visit!(visit_span(vis, span)); - } - } - V::Result::output() - } - - pub fn walk_where_predicate_kind<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - kind: &$($lt)? $($mut)? WherePredicateKind, - ) -> V::Result { - match kind { - WherePredicateKind::BoundPredicate(WhereBoundPredicate { - bounded_ty, - bounds, - bound_generic_params, - }) => { - try_visit!(visit_generic_params(vis, bound_generic_params)); - try_visit!(vis.visit_ty(bounded_ty)); - walk_list!(vis, visit_param_bound, bounds, BoundKind::Bound); - } - WherePredicateKind::RegionPredicate(WhereRegionPredicate { lifetime, bounds }) => { - try_visit!(vis.visit_lifetime(lifetime, $(${ignore($lt)} LifetimeCtxt::Bound )?)); - walk_list!(vis, visit_param_bound, bounds, BoundKind::Bound); - } - WherePredicateKind::EqPredicate(WhereEqPredicate { lhs_ty, rhs_ty }) => { - try_visit!(vis.visit_ty(lhs_ty)); - try_visit!(vis.visit_ty(rhs_ty)); - } - } - V::Result::output() - } - - pub fn walk_fn_decl<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - FnDecl { inputs, output }: &$($lt)? $($mut)? FnDecl, - ) -> V::Result { - try_visit!(visit_params(vis, inputs)); - vis.visit_fn_ret_ty(output) - } - - pub fn walk_fn_ret_ty<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, ret_ty: &$($lt)? $($mut)? FnRetTy) -> V::Result { - match ret_ty { - FnRetTy::Default(span) => visit_span(vis, span), - FnRetTy::Ty(output_ty) => vis.visit_ty(output_ty), + V::Result::output() } } @@ -1450,455 +913,200 @@ macro_rules! common_visitor_and_walkers { match kind { FnKind::Fn( _ctxt, - _vis, - Fn { - defaultness, - ident, - sig: FnSig { header, decl, span }, - generics, - contract, - body, - define_opaque, - }, - ) => { // Visibility is visited as a part of the item. - try_visit!(visit_defaultness(vis, defaultness)); - try_visit!(vis.visit_ident(ident)); - try_visit!(vis.visit_fn_header(header)); - try_visit!(vis.visit_generics(generics)); - try_visit!(vis.visit_fn_decl(decl)); - visit_opt!(vis, visit_contract, contract); - visit_opt!(vis, visit_block, body); - try_visit!(visit_span(vis, span)); - walk_define_opaques(vis, define_opaque) + _vis, + Fn { defaultness, ident, sig, generics, contract, body, define_opaque }, + ) => { + let FnSig { header, decl, span } = sig; + visit_visitable!($($mut)? vis, + defaultness, ident, header, generics, decl, + contract, body, span, define_opaque + ) } - FnKind::Closure(binder, coroutine_kind, decl, body) => { - try_visit!(vis.visit_closure_binder(binder)); - visit_opt!(vis, visit_coroutine_kind, coroutine_kind); - try_visit!(vis.visit_fn_decl(decl)); - vis.visit_expr(body) - } - } - } - - pub fn walk_variant_data<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, data: &$($lt)? $($mut)? VariantData) -> V::Result { - match data { - VariantData::Struct { fields, recovered: _ } => { - visit_field_defs(vis, fields) - } - VariantData::Tuple(fields, id) => { - try_visit!(visit_id(vis, id)); - visit_field_defs(vis, fields) - } - VariantData::Unit(id) => visit_id(vis, id), - } - } - - pub fn walk_field_def<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, field: &$($lt)? $($mut)? FieldDef) -> V::Result { - let FieldDef { attrs, id, span, vis: visibility, ident, ty, is_placeholder: _, safety: _, default } = - field; - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); - try_visit!(vis.visit_vis(visibility)); - visit_opt!(vis, visit_ident, ident); - try_visit!(vis.visit_ty(ty)); - visit_opt!(vis, visit_anon_const, default); - visit_span(vis, span) - } - - fn visit_delim_args<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, args: &$($lt)? $($mut)? DelimArgs) -> V::Result { - let DelimArgs { dspan, delim: _, tokens: _ } = args; - let DelimSpan { open, close } = dspan; - try_visit!(visit_span(vis, open)); - visit_span(vis, close) - } - - pub fn walk_mac<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, mac: &$($lt)? $($mut)? MacCall) -> V::Result { - let MacCall { path, args } = mac; - try_visit!(vis.visit_path(path)); - visit_delim_args(vis, args) - } - - fn walk_macro_def<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, macro_def: &$($lt)? $($mut)? MacroDef) -> V::Result { - let MacroDef { body, macro_rules: _ } = macro_def; - visit_delim_args(vis, body) - } - - pub fn walk_inline_asm<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, asm: &$($lt)? $($mut)? InlineAsm) -> V::Result { - let InlineAsm { - asm_macro: _, - template, - template_strs, - operands, - clobber_abis, - options: _, - line_spans, - } = asm; - for piece in template { - match piece { - InlineAsmTemplatePiece::String(_str) => {} - InlineAsmTemplatePiece::Placeholder { operand_idx: _, modifier: _, span } => { - try_visit!(visit_span(vis, span)); - } - } - } - for (_s1, _s2, span) in template_strs { - try_visit!(visit_span(vis, span)); - } - for (op, span) in operands { - match op { - InlineAsmOperand::In { expr, reg: _ } - | InlineAsmOperand::Out { expr: Some(expr), reg: _, late: _ } - | InlineAsmOperand::InOut { expr, reg: _, late: _ } => { - try_visit!(vis.visit_expr(expr)) - } - InlineAsmOperand::Out { expr: None, reg: _, late: _ } => {} - InlineAsmOperand::SplitInOut { in_expr, out_expr, reg: _, late: _ } => { - try_visit!(vis.visit_expr(in_expr)); - visit_opt!(vis, visit_expr, out_expr); - } - InlineAsmOperand::Const { anon_const } => { - try_visit!(vis.visit_anon_const(anon_const)) - } - InlineAsmOperand::Sym { sym } => try_visit!(vis.visit_inline_asm_sym(sym)), - InlineAsmOperand::Label { block } => try_visit!(vis.visit_block(block)), - } - try_visit!(visit_span(vis, span)); - } - for (_s1, span) in clobber_abis { - try_visit!(visit_span(vis, span)) - } - for span in line_spans { - try_visit!(visit_span(vis, span)) + FnKind::Closure(binder, coroutine_kind, decl, body) => + visit_visitable!($($mut)? vis, binder, coroutine_kind, decl, body), } V::Result::output() } - pub fn walk_inline_asm_sym<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - InlineAsmSym { id, qself, path }: &$($lt)? $($mut)? InlineAsmSym, - ) -> V::Result { - try_visit!(visit_id(vis, id)); - try_visit!(vis.visit_qself(qself)); - vis.visit_path(path) - } - - pub fn walk_format_args<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, fmt: &$($lt)? $($mut)? FormatArgs) -> V::Result { - let FormatArgs { span, template, arguments, uncooked_fmt_str: _, is_source_literal: _ } = fmt; - - let args = $(${ignore($mut)} arguments.all_args_mut())? $(${ignore($lt)} arguments.all_args())? ; - for FormatArgument { kind, expr } in args { - match kind { - FormatArgumentKind::Named(ident) | FormatArgumentKind::Captured(ident) => { - try_visit!(vis.visit_ident(ident)) - } - FormatArgumentKind::Normal => {} - } - try_visit!(vis.visit_expr(expr)); - } - for piece in template { - match piece { - FormatArgsPiece::Literal(_symbol) => {} - FormatArgsPiece::Placeholder(placeholder) => try_visit!(walk_format_placeholder(vis, placeholder)), - } - } - visit_span(vis, span) - } - - fn walk_format_placeholder<$($lt,)? V: $Visitor$(<$lt>)?>( - vis: &mut V, - placeholder: &$($lt)? $($mut)? FormatPlaceholder, - ) -> V::Result { - let FormatPlaceholder { argument, span, format_options, format_trait: _ } = placeholder; - if let Some(span) = span { - try_visit!(visit_span(vis, span)); - } - let FormatArgPosition { span, index: _, kind: _ } = argument; - if let Some(span) = span { - try_visit!(visit_span(vis, span)); - } - let FormatOptions { - width, - precision, - alignment: _, - fill: _, - sign: _, - alternate: _, - zero_pad: _, - debug_hex: _, - } = format_options; - match width { - None => {} - Some(FormatCount::Literal(_)) => {} - Some(FormatCount::Argument(FormatArgPosition { span, index: _, kind: _ })) => { - if let Some(span) = span { - try_visit!(visit_span(vis, span)); - } - } - } - match precision { - None => {} - Some(FormatCount::Literal(_)) => {} - Some(FormatCount::Argument(FormatArgPosition { span, index: _, kind: _ })) => { - if let Some(span) = span { - try_visit!(visit_span(vis, span)); - } - } - } + impl_walkable!(|&$($mut)? $($lt)? self: Impl, vis: &mut V| { + let Impl { defaultness, safety, generics, constness, polarity, of_trait, self_ty, items } = self; + visit_visitable!($($mut)? vis, defaultness, safety, generics, constness, polarity, of_trait, self_ty); + visit_visitable_with!($($mut)? vis, items, AssocCtxt::Impl { of_trait: of_trait.is_some() }); V::Result::output() - } + }); - pub fn walk_expr<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, expression: &$($lt)? $($mut)? Expr) -> V::Result { - let Expr { id, kind, span, attrs, tokens: _ } = expression; - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); + // Special case to call `visit_method_receiver_expr`. + impl_walkable!(|&$($mut)? $($lt)? self: MethodCall, vis: &mut V| { + let MethodCall { seg, receiver, args, span } = self; + try_visit!(vis.visit_method_receiver_expr(receiver)); + visit_visitable!($($mut)? vis, seg, args, span); + V::Result::output() + }); + + impl_walkable!(|&$($mut)? $($lt)? self: Expr, vis: &mut V| { + let Expr { id, kind, span, attrs, tokens: _ } = self; + visit_visitable!($($mut)? vis, id, attrs); match kind { - ExprKind::Array(exprs) => { - try_visit!(visit_exprs(vis, exprs)); - } - ExprKind::ConstBlock(anon_const) => try_visit!(vis.visit_anon_const(anon_const)), - ExprKind::Repeat(element, count) => { - try_visit!(vis.visit_expr(element)); - try_visit!(vis.visit_anon_const(count)); - } - ExprKind::Struct(se) => { - let StructExpr { qself, path, fields, rest } = &$($mut)?**se; - try_visit!(vis.visit_qself(qself)); - try_visit!(vis.visit_path(path)); - try_visit!(visit_expr_fields(vis, fields)); - match rest { - StructRest::Base(expr) => try_visit!(vis.visit_expr(expr)), - StructRest::Rest(span) => try_visit!(visit_span(vis, span)), - StructRest::None => {} - } - } - ExprKind::Tup(exprs) => { - try_visit!(visit_exprs(vis, exprs)); - } - ExprKind::Call(callee_expression, arguments) => { - try_visit!(vis.visit_expr(callee_expression)); - try_visit!(visit_exprs(vis, arguments)); - } - ExprKind::MethodCall(box MethodCall { seg, receiver, args, span }) => { - try_visit!(vis.visit_method_receiver_expr(receiver)); - try_visit!(vis.visit_path_segment(seg)); - try_visit!(visit_exprs(vis, args)); - try_visit!(visit_span(vis, span)); - } - ExprKind::Binary(Spanned { span, node: _ }, left_expression, right_expression) => { - try_visit!(vis.visit_expr(left_expression)); - try_visit!(vis.visit_expr(right_expression)); - try_visit!(visit_span(vis, span)) - } - ExprKind::AddrOf(_kind, _mutbl, subexpression) => { - try_visit!(vis.visit_expr(subexpression)); - } - ExprKind::Unary(_op, subexpression) => { - try_visit!(vis.visit_expr(subexpression)); - } - ExprKind::Cast(subexpression, typ) | ExprKind::Type(subexpression, typ) => { - try_visit!(vis.visit_expr(subexpression)); - try_visit!(vis.visit_ty(typ)); - } - ExprKind::Let(pat, expr, span, _recovered) => { - try_visit!(vis.visit_pat(pat)); - try_visit!(vis.visit_expr(expr)); - try_visit!(visit_span(vis, span)) - } - ExprKind::If(head_expression, if_block, optional_else) => { - try_visit!(vis.visit_expr(head_expression)); - try_visit!(vis.visit_block(if_block)); - visit_opt!(vis, visit_expr, optional_else); - } - ExprKind::While(subexpression, block, opt_label) => { - visit_opt!(vis, visit_label, opt_label); - try_visit!(vis.visit_expr(subexpression)); - try_visit!(vis.visit_block(block)); - } - ExprKind::ForLoop { pat, iter, body, label, kind: _ } => { - visit_opt!(vis, visit_label, label); - try_visit!(vis.visit_pat(pat)); - try_visit!(vis.visit_expr(iter)); - try_visit!(vis.visit_block(body)); - } - ExprKind::Loop(block, opt_label, span) => { - visit_opt!(vis, visit_label, opt_label); - try_visit!(vis.visit_block(block)); - try_visit!(visit_span(vis, span)) - } - ExprKind::Match(subexpression, arms, _kind) => { - try_visit!(vis.visit_expr(subexpression)); - try_visit!(visit_arms(vis, arms)); - } + ExprKind::Array(exprs) => + visit_visitable!($($mut)? vis, exprs), + ExprKind::ConstBlock(anon_const) => + visit_visitable!($($mut)? vis, anon_const), + ExprKind::Repeat(element, count) => + visit_visitable!($($mut)? vis, element, count), + ExprKind::Struct(se) => + visit_visitable!($($mut)? vis, se), + ExprKind::Tup(exprs) => + visit_visitable!($($mut)? vis, exprs), + ExprKind::Call(callee_expression, arguments) => + visit_visitable!($($mut)? vis, callee_expression, arguments), + ExprKind::MethodCall(mc) => + visit_visitable!($($mut)? vis, mc), + ExprKind::Binary(op, lhs, rhs) => + visit_visitable!($($mut)? vis, op, lhs, rhs), + ExprKind::AddrOf(kind, mutbl, subexpression) => + visit_visitable!($($mut)? vis, kind, mutbl, subexpression), + ExprKind::Unary(op, subexpression) => + visit_visitable!($($mut)? vis, op, subexpression), + ExprKind::Cast(subexpression, typ) | ExprKind::Type(subexpression, typ) => + visit_visitable!($($mut)? vis, subexpression, typ), + ExprKind::Let(pat, expr, span, _recovered) => + visit_visitable!($($mut)? vis, pat, expr, span), + ExprKind::If(head_expression, if_block, optional_else) => + visit_visitable!($($mut)? vis, head_expression, if_block, optional_else), + ExprKind::While(subexpression, block, opt_label) => + visit_visitable!($($mut)? vis, subexpression, block, opt_label), + ExprKind::ForLoop { pat, iter, body, label, kind } => + visit_visitable!($($mut)? vis, pat, iter, body, label, kind), + ExprKind::Loop(block, opt_label, span) => + visit_visitable!($($mut)? vis, block, opt_label, span), + ExprKind::Match(subexpression, arms, kind) => + visit_visitable!($($mut)? vis, subexpression, arms, kind), ExprKind::Closure(box Closure { binder, capture_clause, coroutine_kind, constness, - movability: _, + movability, fn_decl, body, fn_decl_span, fn_arg_span, }) => { - try_visit!(visit_constness(vis, constness)); - try_visit!(vis.visit_capture_by(capture_clause)); - try_visit!(vis.visit_fn( - FnKind::Closure(binder, coroutine_kind, fn_decl, body), - *span, - *id - )); - try_visit!(visit_span(vis, fn_decl_span)); - try_visit!(visit_span(vis, fn_arg_span)); - } - ExprKind::Block(block, opt_label) => { - visit_opt!(vis, visit_label, opt_label); - try_visit!(vis.visit_block(block)); - } - ExprKind::Gen(capture_clause, body, _kind, decl_span) => { - try_visit!(vis.visit_capture_by(capture_clause)); - try_visit!(vis.visit_block(body)); - try_visit!(visit_span(vis, decl_span)); - } - ExprKind::Await(expr, span) => { - try_visit!(vis.visit_expr(expr)); - try_visit!(visit_span(vis, span)); - } - ExprKind::Use(expr, span) => { - try_visit!(vis.visit_expr(expr)); - try_visit!(visit_span(vis, span)); - } - ExprKind::Assign(lhs, rhs, span) => { - try_visit!(vis.visit_expr(lhs)); - try_visit!(vis.visit_expr(rhs)); - try_visit!(visit_span(vis, span)); - } - ExprKind::AssignOp(Spanned { span, node: _ }, left_expression, right_expression) => { - try_visit!(vis.visit_expr(left_expression)); - try_visit!(vis.visit_expr(right_expression)); - try_visit!(visit_span(vis, span)); - } - ExprKind::Field(subexpression, ident) => { - try_visit!(vis.visit_expr(subexpression)); - try_visit!(vis.visit_ident(ident)); - } - ExprKind::Index(main_expression, index_expression, span) => { - try_visit!(vis.visit_expr(main_expression)); - try_visit!(vis.visit_expr(index_expression)); - try_visit!(visit_span(vis, span)); - } - ExprKind::Range(start, end, _limit) => { - visit_opt!(vis, visit_expr, start); - visit_opt!(vis, visit_expr, end); + visit_visitable!($($mut)? vis, constness, movability, capture_clause); + let kind = FnKind::Closure(binder, coroutine_kind, fn_decl, body); + try_visit!(vis.visit_fn(kind, *span, *id)); + visit_visitable!($($mut)? vis, fn_decl_span, fn_arg_span); } + ExprKind::Block(block, opt_label) => + visit_visitable!($($mut)? vis, block, opt_label), + ExprKind::Gen(capt, body, kind, decl_span) => + visit_visitable!($($mut)? vis, capt, body, kind, decl_span), + ExprKind::Await(expr, span) | ExprKind::Use(expr, span) => + visit_visitable!($($mut)? vis, expr, span), + ExprKind::Assign(lhs, rhs, span) => + visit_visitable!($($mut)? vis, lhs, rhs, span), + ExprKind::AssignOp(op, lhs, rhs) => + visit_visitable!($($mut)? vis, op, lhs, rhs), + ExprKind::Field(subexpression, ident) => + visit_visitable!($($mut)? vis, subexpression, ident), + ExprKind::Index(main_expression, index_expression, span) => + visit_visitable!($($mut)? vis, main_expression, index_expression, span), + ExprKind::Range(start, end, limit) => + visit_visitable!($($mut)? vis, start, end, limit), ExprKind::Underscore => {} - ExprKind::Path(maybe_qself, path) => { - try_visit!(vis.visit_qself(maybe_qself)); - try_visit!(vis.visit_path(path)); - } - ExprKind::Break(opt_label, opt_expr) => { - visit_opt!(vis, visit_label, opt_label); - visit_opt!(vis, visit_expr, opt_expr); - } - ExprKind::Continue(opt_label) => { - visit_opt!(vis, visit_label, opt_label); - } - ExprKind::Ret(optional_expression) => { - visit_opt!(vis, visit_expr, optional_expression); - } - ExprKind::Yeet(optional_expression) => { - visit_opt!(vis, visit_expr, optional_expression); - } - ExprKind::Become(expr) => try_visit!(vis.visit_expr(expr)), - ExprKind::MacCall(mac) => try_visit!(vis.visit_mac_call(mac)), - ExprKind::Paren(subexpression) => try_visit!(vis.visit_expr(subexpression)), - ExprKind::InlineAsm(asm) => try_visit!(vis.visit_inline_asm(asm)), - ExprKind::FormatArgs(f) => try_visit!(vis.visit_format_args(f)), - ExprKind::OffsetOf(container, fields) => { - try_visit!(vis.visit_ty(container)); - walk_list!(vis, visit_ident, fields); - } - ExprKind::Yield(kind) => { - match kind { - YieldKind::Postfix(expr) => { - try_visit!(vis.visit_expr(expr)); - } - YieldKind::Prefix(expr) => { - visit_opt!(vis, visit_expr, expr); - } - } - } - ExprKind::Try(subexpression) => try_visit!(vis.visit_expr(subexpression)), - ExprKind::TryBlock(body) => try_visit!(vis.visit_block(body)), - ExprKind::Lit(_token) => {} - ExprKind::IncludedBytes(_bytes) => {} - ExprKind::UnsafeBinderCast(_kind, expr, ty) => { - try_visit!(vis.visit_expr(expr)); - visit_opt!(vis, visit_ty, ty); - } + ExprKind::Path(maybe_qself, path) => + visit_visitable!($($mut)? vis, maybe_qself, path), + ExprKind::Break(opt_label, opt_expr) => + visit_visitable!($($mut)? vis, opt_label, opt_expr), + ExprKind::Continue(opt_label) => + visit_visitable!($($mut)? vis, opt_label), + ExprKind::Ret(optional_expression) | ExprKind::Yeet(optional_expression) => + visit_visitable!($($mut)? vis, optional_expression), + ExprKind::Become(expr) => + visit_visitable!($($mut)? vis, expr), + ExprKind::MacCall(mac) => + visit_visitable!($($mut)? vis, mac), + ExprKind::Paren(subexpression) => + visit_visitable!($($mut)? vis, subexpression), + ExprKind::InlineAsm(asm) => + visit_visitable!($($mut)? vis, asm), + ExprKind::FormatArgs(f) => + visit_visitable!($($mut)? vis, f), + ExprKind::OffsetOf(container, fields) => + visit_visitable!($($mut)? vis, container, fields), + ExprKind::Yield(kind) => + visit_visitable!($($mut)? vis, kind), + ExprKind::Try(subexpression) => + visit_visitable!($($mut)? vis, subexpression), + ExprKind::TryBlock(body) => + visit_visitable!($($mut)? vis, body), + ExprKind::Lit(token) => + visit_visitable!($($mut)? vis, token), + ExprKind::IncludedBytes(bytes) => + visit_visitable!($($mut)? vis, bytes), + ExprKind::UnsafeBinderCast(kind, expr, ty) => + visit_visitable!($($mut)? vis, kind, expr, ty), ExprKind::Err(_guar) => {} ExprKind::Dummy => {} } visit_span(vis, span) - } + }); - pub fn walk_param<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, param: &$($lt)? $($mut)? Param) -> V::Result { - let Param { attrs, ty, pat, id, span, is_placeholder: _ } = param; - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); - try_visit!(vis.visit_pat(pat)); - try_visit!(vis.visit_ty(ty)); - visit_span(vis, span) - } - - pub fn walk_arm<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, arm: &$($lt)? $($mut)? Arm) -> V::Result { - let Arm { attrs, pat, guard, body, span, id, is_placeholder: _ } = arm; - try_visit!(visit_id(vis, id)); - walk_list!(vis, visit_attribute, attrs); - try_visit!(vis.visit_pat(pat)); - visit_opt!(vis, visit_expr, guard); - visit_opt!(vis, visit_expr, body); - visit_span(vis, span) - } - - pub fn walk_vis<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, visibility: &$($lt)? $($mut)? Visibility) -> V::Result { - let Visibility { kind, span, tokens: _ } = visibility; - match kind { - VisibilityKind::Restricted { path, id, shorthand: _ } => { - try_visit!(visit_id(vis, id)); - try_visit!(vis.visit_path(path)); - } - VisibilityKind::Public | VisibilityKind::Inherited => {} - } - visit_span(vis, span) - } - - pub fn walk_attribute<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, attr: &$($lt)? $($mut)? Attribute) -> V::Result { - let Attribute { kind, id: _, style: _, span } = attr; - match kind { - AttrKind::Normal(normal) => { - let NormalAttr { item, tokens: _ } = &$($mut)?**normal; - let AttrItem { unsafety: _, path, args, tokens: _ } = item; - try_visit!(vis.visit_path(path)); - try_visit!(walk_attr_args(vis, args)); - } - AttrKind::DocComment(_kind, _sym) => {} - } - visit_span(vis, span) - } - - pub fn walk_attr_args<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, args: &$($lt)? $($mut)? AttrArgs) -> V::Result { - match args { - AttrArgs::Empty => {} - AttrArgs::Delimited(args) => try_visit!(visit_delim_args(vis, args)), - AttrArgs::Eq { eq_span, expr } => { - try_visit!(vis.visit_expr(expr)); - try_visit!(visit_span(vis, eq_span)); - } - } - V::Result::output() - } + define_named_walk!($(($mut))? $Visitor$(<$lt>)? + pub fn walk_anon_const(AnonConst); + pub fn walk_arm(Arm); + //pub fn walk_assoc_item(AssocItem, _ctxt: AssocCtxt); + pub fn walk_assoc_item_constraint(AssocItemConstraint); + pub fn walk_attribute(Attribute); + pub fn walk_block(Block); + //pub fn walk_nested_use_tree((UseTree, NodeId)); + pub fn walk_capture_by(CaptureBy); + pub fn walk_closure_binder(ClosureBinder); + pub fn walk_contract(FnContract); + pub fn walk_coroutine_kind(CoroutineKind); + pub fn walk_crate(Crate); + pub fn walk_expr(Expr); + pub fn walk_expr_field(ExprField); + pub fn walk_field_def(FieldDef); + pub fn walk_fn_decl(FnDecl); + pub fn walk_fn_header(FnHeader); + pub fn walk_fn_ret_ty(FnRetTy); + //pub fn walk_foreign_item(ForeignItem); + pub fn walk_foreign_mod(ForeignMod); + pub fn walk_format_args(FormatArgs); + pub fn walk_generic_arg(GenericArg); + pub fn walk_generic_args(GenericArgs); + pub fn walk_generic_param(GenericParam); + pub fn walk_generics(Generics); + pub fn walk_inline_asm(InlineAsm); + pub fn walk_inline_asm_sym(InlineAsmSym); + //pub fn walk_item(Item); + pub fn walk_label(Label); + pub fn walk_lifetime(Lifetime); + pub fn walk_local(Local); + pub fn walk_mac(MacCall); + pub fn walk_macro_def(MacroDef); + pub fn walk_param_bound(GenericBound); + pub fn walk_param(Param); + pub fn walk_pat_field(PatField); + pub fn walk_path(Path); + pub fn walk_path_segment(PathSegment); + pub fn walk_pat(Pat); + pub fn walk_poly_trait_ref(PolyTraitRef); + pub fn walk_precise_capturing_arg(PreciseCapturingArg); + pub fn walk_qself(QSelf); + pub fn walk_trait_ref(TraitRef); + pub fn walk_ty_pat(TyPat); + pub fn walk_ty(Ty); + pub fn walk_use_tree(UseTree); + pub fn walk_variant_data(VariantData); + pub fn walk_variant(Variant); + pub fn walk_vis(Visibility); + pub fn walk_where_predicate_kind(WherePredicateKind); + pub fn walk_where_predicate(WherePredicate); + ); }; } @@ -1907,6 +1115,20 @@ common_visitor_and_walkers!(Visitor<'a>); macro_rules! generate_list_visit_fns { ($($name:ident, $Ty:ty, $visit_fn:ident$(, $param:ident: $ParamTy:ty)*;)+) => { $( + #[allow(unused_parens)] + impl<'a, V: Visitor<'a>> Visitable<'a, V> for ThinVec<$Ty> { + type Extra = ($($ParamTy),*); + + #[inline] + fn visit( + &'a self, + visitor: &mut V, + ($($param),*): Self::Extra, + ) -> V::Result { + $name(visitor, self $(, $param)*) + } + } + fn $name<'a, V: Visitor<'a>>( vis: &mut V, values: &'a ThinVec<$Ty>, @@ -1937,18 +1159,9 @@ generate_list_visit_fns! { visit_arms, Arm, visit_arm; } -#[expect(rustc::pass_by_value)] // needed for symmetry with mut_visit -fn visit_nested_use_tree<'a, V: Visitor<'a>>( - vis: &mut V, - nested_tree: &'a UseTree, - &nested_id: &NodeId, -) -> V::Result { - vis.visit_nested_use_tree(nested_tree, nested_id) -} - pub fn walk_stmt<'a, V: Visitor<'a>>(visitor: &mut V, statement: &'a Stmt) -> V::Result { let Stmt { id, kind, span: _ } = statement; - try_visit!(visit_id(visitor, id)); + try_visit!(visitor.visit_id(*id)); match kind { StmtKind::Let(local) => try_visit!(visitor.visit_local(local)), StmtKind::Item(item) => try_visit!(visitor.visit_item(item)), diff --git a/compiler/rustc_macros/src/lib.rs b/compiler/rustc_macros/src/lib.rs index 1006ea3ba10a..101f5ccb7a47 100644 --- a/compiler/rustc_macros/src/lib.rs +++ b/compiler/rustc_macros/src/lib.rs @@ -21,6 +21,7 @@ mod symbols; mod try_from; mod type_foldable; mod type_visitable; +mod visitable; // Reads the rust version (e.g. "1.75.0") from the CFG_RELEASE env var and // produces a `RustcVersion` literal containing that version (e.g. @@ -101,6 +102,16 @@ decl_derive!( /// visited (and its type is not required to implement `TypeVisitable`). type_visitable::type_visitable_derive ); +decl_derive!( + [Walkable, attributes(visitable)] => + /// Derives `Walkable` for the annotated `struct` or `enum` (`union` is not supported). + /// + /// Each field of the struct or enum variant will be visited in definition order, using the + /// `Walkable` implementation for its type. However, if a field of a struct or an enum + /// variant is annotated with `#[visitable(ignore)]` then that field will not be + /// visited (and its type is not required to implement `Walkable`). + visitable::visitable_derive +); decl_derive!([Lift, attributes(lift)] => lift::lift_derive); decl_derive!( [Diagnostic, attributes( diff --git a/compiler/rustc_macros/src/visitable.rs b/compiler/rustc_macros/src/visitable.rs new file mode 100644 index 000000000000..a7a82538eabe --- /dev/null +++ b/compiler/rustc_macros/src/visitable.rs @@ -0,0 +1,82 @@ +use quote::quote; +use synstructure::BindingInfo; + +pub(super) fn visitable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { + if let syn::Data::Union(_) = s.ast().data { + panic!("cannot derive on union") + } + + let has_attr = |bind: &BindingInfo<'_>, name| { + let mut found = false; + bind.ast().attrs.iter().for_each(|attr| { + if !attr.path().is_ident("visitable") { + return; + } + let _ = attr.parse_nested_meta(|nested| { + if nested.path.is_ident(name) { + found = true; + } + Ok(()) + }); + }); + found + }; + + let get_attr = |bind: &BindingInfo<'_>, name: &str| { + let mut content = None; + bind.ast().attrs.iter().for_each(|attr| { + if !attr.path().is_ident("visitable") { + return; + } + let _ = attr.parse_nested_meta(|nested| { + if nested.path.is_ident(name) { + let value = nested.value()?; + let value = value.parse()?; + content = Some(value); + } + Ok(()) + }); + }); + content + }; + + s.add_bounds(synstructure::AddBounds::Generics); + s.bind_with(|_| synstructure::BindStyle::Ref); + let ref_visit = s.each(|bind| { + let extra = get_attr(bind, "extra").unwrap_or(quote! {}); + if has_attr(bind, "ignore") { + quote! {} + } else { + quote! { rustc_ast_ir::try_visit!(crate::visit::Visitable::visit(#bind, __visitor, (#extra))) } + } + }); + + s.bind_with(|_| synstructure::BindStyle::RefMut); + let mut_visit = s.each(|bind| { + let extra = get_attr(bind, "extra").unwrap_or(quote! {}); + if has_attr(bind, "ignore") { + quote! {} + } else { + quote! { crate::mut_visit::MutVisitable::visit_mut(#bind, __visitor, (#extra)) } + } + }); + + s.gen_impl(quote! { + gen impl<'__ast, __V> crate::visit::Walkable<'__ast, __V> for @Self + where __V: crate::visit::Visitor<'__ast>, + { + fn walk_ref(&'__ast self, __visitor: &mut __V) -> __V::Result { + match *self { #ref_visit } + <__V::Result as rustc_ast_ir::visit::VisitorResult>::output() + } + } + + gen impl<__V> crate::mut_visit::MutWalkable<__V> for @Self + where __V: crate::mut_visit::MutVisitor, + { + fn walk_mut(&mut self, __visitor: &mut __V) { + match *self { #mut_visit } + } + } + }) +} From 6df15a172e7cd26fa59826fbc123938fabe260bb Mon Sep 17 00:00:00 2001 From: Makai Date: Wed, 16 Jul 2025 12:10:39 +0000 Subject: [PATCH 159/183] update SUMMARY.md --- tests/ui/SUMMARY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ui/SUMMARY.md b/tests/ui/SUMMARY.md index 1aeb0fcfbea6..b635b6326fce 100644 --- a/tests/ui/SUMMARY.md +++ b/tests/ui/SUMMARY.md @@ -1277,9 +1277,9 @@ See [Tracking issue for specialization (RFC 1210) #31844](https://github.com/rus Stability attributes used internally by the standard library: `#[stable()]` and `#[unstable()]`. -## `tests/ui/stable-mir-print/` +## `tests/ui/rustc_public-ir-print/` -Some tests for pretty printing of StableMIR. +Some tests for pretty printing of rustc_public's IR. ## `tests/ui/stack-protector/`: `-Z stack-protector` command line flag From 551cb9f1f4fa315639033e3db39794e10a14b7f7 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Tue, 22 Jul 2025 00:32:59 -0700 Subject: [PATCH 160/183] mbe: Use concrete type for `get_unused_rule` Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put it on the concrete `MacroRulesMacroExpander`, and downcast to that type via `Any` in order to call it. Suggested-by: Vadim Petrochenkov --- compiler/rustc_expand/src/base.rs | 9 +++------ compiler/rustc_expand/src/lib.rs | 2 +- compiler/rustc_expand/src/mbe/macro_rules.rs | 16 +++++++++------- compiler/rustc_resolve/src/macros.rs | 9 +++++++-- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs index 1928cfd90482..25ec54011111 100644 --- a/compiler/rustc_expand/src/base.rs +++ b/compiler/rustc_expand/src/base.rs @@ -1,3 +1,4 @@ +use std::any::Any; use std::default::Default; use std::iter; use std::path::Component::Prefix; @@ -361,17 +362,13 @@ where } /// Represents a thing that maps token trees to Macro Results -pub trait TTMacroExpander { +pub trait TTMacroExpander: Any { fn expand<'cx>( &self, ecx: &'cx mut ExtCtxt<'_>, span: Span, input: TokenStream, ) -> MacroExpanderResult<'cx>; - - fn get_unused_rule(&self, _rule_i: usize) -> Option<(&Ident, Span)> { - None - } } pub type MacroExpanderResult<'cx> = ExpandResult, ()>; @@ -379,7 +376,7 @@ pub type MacroExpanderResult<'cx> = ExpandResult, ()>; pub type MacroExpanderFn = for<'cx> fn(&'cx mut ExtCtxt<'_>, Span, TokenStream) -> MacroExpanderResult<'cx>; -impl TTMacroExpander for F +impl TTMacroExpander for F where F: for<'cx> Fn(&'cx mut ExtCtxt<'_>, Span, TokenStream) -> MacroExpanderResult<'cx>, { diff --git a/compiler/rustc_expand/src/lib.rs b/compiler/rustc_expand/src/lib.rs index 64be7649775f..b54dabbb8e26 100644 --- a/compiler/rustc_expand/src/lib.rs +++ b/compiler/rustc_expand/src/lib.rs @@ -22,7 +22,7 @@ mod placeholders; mod proc_macro_server; mod stats; -pub use mbe::macro_rules::compile_declarative_macro; +pub use mbe::macro_rules::{MacroRulesMacroExpander, compile_declarative_macro}; pub mod base; pub mod config; pub mod expand; diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index 2d792355b278..2f713a09b95e 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -128,7 +128,7 @@ pub(super) struct MacroRule { rhs: mbe::TokenTree, } -struct MacroRulesMacroExpander { +pub struct MacroRulesMacroExpander { node_id: NodeId, name: Ident, span: Span, @@ -136,6 +136,14 @@ struct MacroRulesMacroExpander { rules: Vec, } +impl MacroRulesMacroExpander { + pub fn get_unused_rule(&self, rule_i: usize) -> Option<(&Ident, Span)> { + // If the rhs contains an invocation like `compile_error!`, don't report it as unused. + let rule = &self.rules[rule_i]; + if has_compile_error_macro(&rule.rhs) { None } else { Some((&self.name, rule.lhs_span)) } + } +} + impl TTMacroExpander for MacroRulesMacroExpander { fn expand<'cx>( &self, @@ -154,12 +162,6 @@ impl TTMacroExpander for MacroRulesMacroExpander { &self.rules, )) } - - fn get_unused_rule(&self, rule_i: usize) -> Option<(&Ident, Span)> { - // If the rhs contains an invocation like `compile_error!`, don't report it as unused. - let rule = &self.rules[rule_i]; - if has_compile_error_macro(&rule.rhs) { None } else { Some((&self.name, rule.lhs_span)) } - } } struct DummyExpander(ErrorGuaranteed); diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index 77ef7f56c094..333fc808d1b8 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -1,6 +1,7 @@ //! A bunch of methods and structures more or less related to resolving macros and //! interface provided by `Resolver` to macro expander. +use std::any::Any; use std::cell::Cell; use std::mem; use std::sync::Arc; @@ -13,10 +14,10 @@ use rustc_expand::base::{ Annotatable, DeriveResolution, Indeterminate, ResolverExpand, SyntaxExtension, SyntaxExtensionKind, }; -use rustc_expand::compile_declarative_macro; use rustc_expand::expand::{ AstFragment, AstFragmentKind, Invocation, InvocationKind, SupportsMacroExpansion, }; +use rustc_expand::{MacroRulesMacroExpander, compile_declarative_macro}; use rustc_hir::def::{self, DefKind, Namespace, NonMacroAttrKind}; use rustc_hir::def_id::{CrateNum, DefId, LocalDefId}; use rustc_middle::middle::stability; @@ -357,8 +358,12 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> { let SyntaxExtensionKind::LegacyBang(ref ext) = m.ext.kind else { continue; }; + let ext: &dyn Any = ext.as_ref(); + let Some(m) = ext.downcast_ref::() else { + continue; + }; for arm_i in unused_arms.iter() { - if let Some((ident, rule_span)) = ext.get_unused_rule(arm_i) { + if let Some((ident, rule_span)) = m.get_unused_rule(arm_i) { self.lint_buffer.buffer_lint( UNUSED_MACRO_RULES, node_id, From f877aa7d14916f71a2f88c6d4c009e7ded7684c4 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Sun, 4 May 2025 14:09:52 +1000 Subject: [PATCH 161/183] coverage: Enlarge empty spans during MIR instrumentation, not codegen This allows us to assume that coverage spans will only be discarded during codegen in very unusual situations. --- .../src/coverageinfo/mapgen/spans.rs | 28 ++------------ .../rustc_mir_transform/src/coverage/spans.rs | 38 ++++++++++++++++++- tests/coverage/async_closure.cov-map | 21 +++++----- ...ch_match_arms.main.InstrumentCoverage.diff | 2 +- ...ument_coverage.bar.InstrumentCoverage.diff | 2 +- ...ment_coverage.main.InstrumentCoverage.diff | 4 +- ...rage_cleanup.main.CleanupPostBorrowck.diff | 4 +- ...erage_cleanup.main.InstrumentCoverage.diff | 4 +- 8 files changed, 57 insertions(+), 46 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/spans.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/spans.rs index 39a59560c9d3..574463be7ffe 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/spans.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/spans.rs @@ -39,7 +39,10 @@ impl Coords { /// or other expansions), and if it does happen then skipping a span or function is /// better than an ICE or `llvm-cov` failure that the user might have no way to avoid. pub(crate) fn make_coords(source_map: &SourceMap, file: &SourceFile, span: Span) -> Option { - let span = ensure_non_empty_span(source_map, span)?; + if span.is_empty() { + debug_assert!(false, "can't make coords from empty span: {span:?}"); + return None; + } let lo = span.lo(); let hi = span.hi(); @@ -70,29 +73,6 @@ pub(crate) fn make_coords(source_map: &SourceMap, file: &SourceFile, span: Span) }) } -fn ensure_non_empty_span(source_map: &SourceMap, span: Span) -> Option { - if !span.is_empty() { - return Some(span); - } - - // The span is empty, so try to enlarge it to cover an adjacent '{' or '}'. - source_map - .span_to_source(span, |src, start, end| try { - // Adjusting span endpoints by `BytePos(1)` is normally a bug, - // but in this case we have specifically checked that the character - // we're skipping over is one of two specific ASCII characters, so - // adjusting by exactly 1 byte is correct. - if src.as_bytes().get(end).copied() == Some(b'{') { - Some(span.with_hi(span.hi() + BytePos(1))) - } else if start > 0 && src.as_bytes()[start - 1] == b'}' { - Some(span.with_lo(span.lo() - BytePos(1))) - } else { - None - } - }) - .ok()? -} - /// If `llvm-cov` sees a source region that is improperly ordered (end < start), /// it will immediately exit with a fatal error. To prevent that from happening, /// discard regions that are improperly ordered, or might be interpreted in a diff --git a/compiler/rustc_mir_transform/src/coverage/spans.rs b/compiler/rustc_mir_transform/src/coverage/spans.rs index ec76076020eb..ddeae093df5b 100644 --- a/compiler/rustc_mir_transform/src/coverage/spans.rs +++ b/compiler/rustc_mir_transform/src/coverage/spans.rs @@ -1,7 +1,8 @@ use rustc_data_structures::fx::FxHashSet; use rustc_middle::mir; use rustc_middle::ty::TyCtxt; -use rustc_span::{DesugaringKind, ExpnKind, MacroKind, Span}; +use rustc_span::source_map::SourceMap; +use rustc_span::{BytePos, DesugaringKind, ExpnKind, MacroKind, Span}; use tracing::instrument; use crate::coverage::graph::{BasicCoverageBlock, CoverageGraph}; @@ -83,8 +84,18 @@ pub(super) fn extract_refined_covspans<'tcx>( // Discard any span that overlaps with a hole. discard_spans_overlapping_holes(&mut covspans, &holes); - // Perform more refinement steps after holes have been dealt with. + // Discard spans that overlap in unwanted ways. let mut covspans = remove_unwanted_overlapping_spans(covspans); + + // For all empty spans, either enlarge them to be non-empty, or discard them. + let source_map = tcx.sess.source_map(); + covspans.retain_mut(|covspan| { + let Some(span) = ensure_non_empty_span(source_map, covspan.span) else { return false }; + covspan.span = span; + true + }); + + // Merge covspans that can be merged. covspans.dedup_by(|b, a| a.merge_if_eligible(b)); code_mappings.extend(covspans.into_iter().map(|Covspan { span, bcb }| { @@ -230,3 +241,26 @@ fn compare_spans(a: Span, b: Span) -> std::cmp::Ordering { // - Both have the same start and span A extends further right .then_with(|| Ord::cmp(&a.hi(), &b.hi()).reverse()) } + +fn ensure_non_empty_span(source_map: &SourceMap, span: Span) -> Option { + if !span.is_empty() { + return Some(span); + } + + // The span is empty, so try to enlarge it to cover an adjacent '{' or '}'. + source_map + .span_to_source(span, |src, start, end| try { + // Adjusting span endpoints by `BytePos(1)` is normally a bug, + // but in this case we have specifically checked that the character + // we're skipping over is one of two specific ASCII characters, so + // adjusting by exactly 1 byte is correct. + if src.as_bytes().get(end).copied() == Some(b'{') { + Some(span.with_hi(span.hi() + BytePos(1))) + } else if start > 0 && src.as_bytes()[start - 1] == b'}' { + Some(span.with_lo(span.lo() - BytePos(1))) + } else { + None + } + }) + .ok()? +} diff --git a/tests/coverage/async_closure.cov-map b/tests/coverage/async_closure.cov-map index 9f8dc8d6cbba..53128dd7a48b 100644 --- a/tests/coverage/async_closure.cov-map +++ b/tests/coverage/async_closure.cov-map @@ -37,32 +37,29 @@ Number of file 0 mappings: 8 Highest counter ID seen: c0 Function name: async_closure::main::{closure#0} -Raw bytes (14): 0x[01, 01, 00, 02, 01, 0b, 22, 00, 23, 01, 00, 23, 00, 24] +Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 22, 00, 24] Number of files: 1 - file 0 => $DIR/async_closure.rs Number of expressions: 0 -Number of file 0 mappings: 2 -- Code(Counter(0)) at (prev + 11, 34) to (start + 0, 35) -- Code(Counter(0)) at (prev + 0, 35) to (start + 0, 36) +Number of file 0 mappings: 1 +- Code(Counter(0)) at (prev + 11, 34) to (start + 0, 36) Highest counter ID seen: c0 Function name: async_closure::main::{closure#0} -Raw bytes (14): 0x[01, 01, 00, 02, 01, 0b, 22, 00, 23, 01, 00, 23, 00, 24] +Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 22, 00, 24] Number of files: 1 - file 0 => $DIR/async_closure.rs Number of expressions: 0 -Number of file 0 mappings: 2 -- Code(Counter(0)) at (prev + 11, 34) to (start + 0, 35) -- Code(Counter(0)) at (prev + 0, 35) to (start + 0, 36) +Number of file 0 mappings: 1 +- Code(Counter(0)) at (prev + 11, 34) to (start + 0, 36) Highest counter ID seen: c0 Function name: async_closure::main::{closure#0}::{closure#0}:: -Raw bytes (14): 0x[01, 01, 00, 02, 01, 0b, 22, 00, 23, 01, 00, 23, 00, 24] +Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 22, 00, 24] Number of files: 1 - file 0 => $DIR/async_closure.rs Number of expressions: 0 -Number of file 0 mappings: 2 -- Code(Counter(0)) at (prev + 11, 34) to (start + 0, 35) -- Code(Counter(0)) at (prev + 0, 35) to (start + 0, 36) +Number of file 0 mappings: 1 +- Code(Counter(0)) at (prev + 11, 34) to (start + 0, 36) Highest counter ID seen: c0 diff --git a/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff index d465b8bded22..fa88211383a0 100644 --- a/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff @@ -40,7 +40,7 @@ + coverage Code { bcb: bcb5 } => $DIR/branch_match_arms.rs:19:17: 19:18 (#0); + coverage Code { bcb: bcb5 } => $DIR/branch_match_arms.rs:19:23: 19:30 (#0); + coverage Code { bcb: bcb5 } => $DIR/branch_match_arms.rs:19:31: 19:32 (#0); -+ coverage Code { bcb: bcb2 } => $DIR/branch_match_arms.rs:21:2: 21:2 (#0); ++ coverage Code { bcb: bcb2 } => $DIR/branch_match_arms.rs:21:1: 21:2 (#0); + bb0: { + Coverage::VirtualCounter(bcb0); diff --git a/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff b/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff index cf6d85abd80e..9b6d2b22087b 100644 --- a/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff @@ -6,7 +6,7 @@ + coverage Code { bcb: bcb0 } => $DIR/instrument_coverage.rs:27:1: 27:17 (#0); + coverage Code { bcb: bcb0 } => $DIR/instrument_coverage.rs:28:5: 28:9 (#0); -+ coverage Code { bcb: bcb0 } => $DIR/instrument_coverage.rs:29:2: 29:2 (#0); ++ coverage Code { bcb: bcb0 } => $DIR/instrument_coverage.rs:29:1: 29:2 (#0); + bb0: { + Coverage::VirtualCounter(bcb0); diff --git a/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff index 980c5e202ffd..b2bb2375aee6 100644 --- a/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff @@ -10,8 +10,8 @@ + coverage Code { bcb: bcb0 } => $DIR/instrument_coverage.rs:13:1: 13:10 (#0); + coverage Code { bcb: bcb1 } => $DIR/instrument_coverage.rs:15:12: 15:15 (#0); + coverage Code { bcb: bcb2 } => $DIR/instrument_coverage.rs:16:13: 16:18 (#0); -+ coverage Code { bcb: bcb3 } => $DIR/instrument_coverage.rs:17:10: 17:10 (#0); -+ coverage Code { bcb: bcb2 } => $DIR/instrument_coverage.rs:19:2: 19:2 (#0); ++ coverage Code { bcb: bcb3 } => $DIR/instrument_coverage.rs:17:9: 17:10 (#0); ++ coverage Code { bcb: bcb2 } => $DIR/instrument_coverage.rs:19:1: 19:2 (#0); + bb0: { + Coverage::VirtualCounter(bcb0); diff --git a/tests/mir-opt/coverage/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff b/tests/mir-opt/coverage/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff index b707cd41788a..2eb78c08ee80 100644 --- a/tests/mir-opt/coverage/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff +++ b/tests/mir-opt/coverage/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff @@ -10,8 +10,8 @@ coverage Code { bcb: bcb0 } => $DIR/instrument_coverage_cleanup.rs:13:1: 13:10 (#0); coverage Code { bcb: bcb0 } => $DIR/instrument_coverage_cleanup.rs:14:8: 14:36 (#0); coverage Code { bcb: bcb3 } => $DIR/instrument_coverage_cleanup.rs:14:37: 14:39 (#0); - coverage Code { bcb: bcb1 } => $DIR/instrument_coverage_cleanup.rs:14:39: 14:39 (#0); - coverage Code { bcb: bcb2 } => $DIR/instrument_coverage_cleanup.rs:15:2: 15:2 (#0); + coverage Code { bcb: bcb1 } => $DIR/instrument_coverage_cleanup.rs:14:38: 14:39 (#0); + coverage Code { bcb: bcb2 } => $DIR/instrument_coverage_cleanup.rs:15:1: 15:2 (#0); coverage Branch { true_bcb: bcb3, false_bcb: bcb1 } => $DIR/instrument_coverage_cleanup.rs:14:8: 14:36 (#0); bb0: { diff --git a/tests/mir-opt/coverage/instrument_coverage_cleanup.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/instrument_coverage_cleanup.main.InstrumentCoverage.diff index 239b845c2311..0c1bc24b6dc1 100644 --- a/tests/mir-opt/coverage/instrument_coverage_cleanup.main.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/instrument_coverage_cleanup.main.InstrumentCoverage.diff @@ -10,8 +10,8 @@ + coverage Code { bcb: bcb0 } => $DIR/instrument_coverage_cleanup.rs:13:1: 13:10 (#0); + coverage Code { bcb: bcb0 } => $DIR/instrument_coverage_cleanup.rs:14:8: 14:36 (#0); + coverage Code { bcb: bcb3 } => $DIR/instrument_coverage_cleanup.rs:14:37: 14:39 (#0); -+ coverage Code { bcb: bcb1 } => $DIR/instrument_coverage_cleanup.rs:14:39: 14:39 (#0); -+ coverage Code { bcb: bcb2 } => $DIR/instrument_coverage_cleanup.rs:15:2: 15:2 (#0); ++ coverage Code { bcb: bcb1 } => $DIR/instrument_coverage_cleanup.rs:14:38: 14:39 (#0); ++ coverage Code { bcb: bcb2 } => $DIR/instrument_coverage_cleanup.rs:15:1: 15:2 (#0); + coverage Branch { true_bcb: bcb3, false_bcb: bcb1 } => $DIR/instrument_coverage_cleanup.rs:14:8: 14:36 (#0); + bb0: { From 2832517ba174906b6d6ebedf4893dca8d8a98f55 Mon Sep 17 00:00:00 2001 From: xizheyin Date: Mon, 21 Jul 2025 11:05:37 +0800 Subject: [PATCH 162/183] Clean code for `rustc_parse/src/lexer` 1. Rename `make_unclosed_delims_error` and return `Vec` 2. change magic number `unclosed_delimiter_show_limit` to const 3. move `eof_err` below parsing logic 4. Add `calculate_spacing` for `bump` and `bump_minimal` Signed-off-by: xizheyin --- compiler/rustc_parse/src/lexer/diagnostics.rs | 44 ++++---- compiler/rustc_parse/src/lexer/mod.rs | 18 ++- compiler/rustc_parse/src/lexer/tokentrees.rs | 106 +++++++++--------- 3 files changed, 83 insertions(+), 85 deletions(-) diff --git a/compiler/rustc_parse/src/lexer/diagnostics.rs b/compiler/rustc_parse/src/lexer/diagnostics.rs index 6de001fc9985..947f3df179ff 100644 --- a/compiler/rustc_parse/src/lexer/diagnostics.rs +++ b/compiler/rustc_parse/src/lexer/diagnostics.rs @@ -126,23 +126,29 @@ pub(super) fn report_suspicious_mismatch_block( } } -pub(crate) fn make_unclosed_delims_error( - unmatched: UnmatchedDelim, - psess: &ParseSess, -) -> Option> { - // `None` here means an `Eof` was found. We already emit those errors elsewhere, we add them to - // `unmatched_delims` only for error recovery in the `Parser`. - let found_delim = unmatched.found_delim?; - let mut spans = vec![unmatched.found_span]; - if let Some(sp) = unmatched.unclosed_span { - spans.push(sp); - }; - let err = psess.dcx().create_err(MismatchedClosingDelimiter { - spans, - delimiter: pprust::token_kind_to_string(&found_delim.as_close_token_kind()).to_string(), - unmatched: unmatched.found_span, - opening_candidate: unmatched.candidate_span, - unclosed: unmatched.unclosed_span, - }); - Some(err) +pub(crate) fn make_errors_for_mismatched_closing_delims<'psess>( + unmatcheds: &[UnmatchedDelim], + psess: &'psess ParseSess, +) -> Vec> { + unmatcheds + .iter() + .filter_map(|unmatched| { + // `None` here means an `Eof` was found. We already emit those errors elsewhere, we add them to + // `unmatched_delims` only for error recovery in the `Parser`. + let found_delim = unmatched.found_delim?; + let mut spans = vec![unmatched.found_span]; + if let Some(sp) = unmatched.unclosed_span { + spans.push(sp); + }; + let err = psess.dcx().create_err(MismatchedClosingDelimiter { + spans, + delimiter: pprust::token_kind_to_string(&found_delim.as_close_token_kind()) + .to_string(), + unmatched: unmatched.found_span, + opening_candidate: unmatched.candidate_span, + unclosed: unmatched.unclosed_span, + }); + Some(err) + }) + .collect() } diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index 60d275bf2b40..85af5a615aef 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -1,4 +1,4 @@ -use diagnostics::make_unclosed_delims_error; +use diagnostics::make_errors_for_mismatched_closing_delims; use rustc_ast::ast::{self, AttrStyle}; use rustc_ast::token::{self, CommentKind, Delimiter, IdentIsRaw, Token, TokenKind}; use rustc_ast::tokenstream::TokenStream; @@ -71,27 +71,23 @@ pub(crate) fn lex_token_trees<'psess, 'src>( }; let res = lexer.lex_token_trees(/* is_delimited */ false); - let mut unmatched_delims: Vec<_> = lexer - .diag_info - .unmatched_delims - .into_iter() - .filter_map(|unmatched_delim| make_unclosed_delims_error(unmatched_delim, psess)) - .collect(); + let mut unmatched_closing_delims: Vec<_> = + make_errors_for_mismatched_closing_delims(&lexer.diag_info.unmatched_delims, psess); match res { Ok((_open_spacing, stream)) => { - if unmatched_delims.is_empty() { + if unmatched_closing_delims.is_empty() { Ok(stream) } else { // Return error if there are unmatched delimiters or unclosed delimiters. - Err(unmatched_delims) + Err(unmatched_closing_delims) } } Err(errs) => { // We emit delimiter mismatch errors first, then emit the unclosing delimiter mismatch // because the delimiter mismatch is more likely to be the root cause of error - unmatched_delims.extend(errs); - Err(unmatched_delims) + unmatched_closing_delims.extend(errs); + Err(unmatched_closing_delims) } } } diff --git a/compiler/rustc_parse/src/lexer/tokentrees.rs b/compiler/rustc_parse/src/lexer/tokentrees.rs index 64748199f28d..634f4c30b260 100644 --- a/compiler/rustc_parse/src/lexer/tokentrees.rs +++ b/compiler/rustc_parse/src/lexer/tokentrees.rs @@ -51,45 +51,6 @@ impl<'psess, 'src> Lexer<'psess, 'src> { } } - fn eof_err(&mut self) -> Diag<'psess> { - let msg = "this file contains an unclosed delimiter"; - let mut err = self.dcx().struct_span_err(self.token.span, msg); - - let unclosed_delimiter_show_limit = 5; - let len = usize::min(unclosed_delimiter_show_limit, self.diag_info.open_delimiters.len()); - for &(_, span) in &self.diag_info.open_delimiters[..len] { - err.span_label(span, "unclosed delimiter"); - self.diag_info.unmatched_delims.push(UnmatchedDelim { - found_delim: None, - found_span: self.token.span, - unclosed_span: Some(span), - candidate_span: None, - }); - } - - if let Some((_, span)) = self.diag_info.open_delimiters.get(unclosed_delimiter_show_limit) - && self.diag_info.open_delimiters.len() >= unclosed_delimiter_show_limit + 2 - { - err.span_label( - *span, - format!( - "another {} unclosed delimiters begin from here", - self.diag_info.open_delimiters.len() - unclosed_delimiter_show_limit - ), - ); - } - - if let Some((delim, _)) = self.diag_info.open_delimiters.last() { - report_suspicious_mismatch_block( - &mut err, - &self.diag_info, - self.psess.source_map(), - *delim, - ) - } - err - } - fn lex_token_tree_open_delim( &mut self, open_delim: Delimiter, @@ -206,13 +167,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> { } else if let Some(glued) = self.token.glue(&next_tok) { self.token = glued; } else { - let this_spacing = if next_tok.is_punct() { - Spacing::Joint - } else if next_tok == token::Eof { - Spacing::Alone - } else { - Spacing::JointHidden - }; + let this_spacing = self.calculate_spacing(&next_tok); break (this_spacing, next_tok); } }; @@ -223,23 +178,64 @@ impl<'psess, 'src> Lexer<'psess, 'src> { // Cut-down version of `bump` used when the token kind is known in advance. fn bump_minimal(&mut self) -> Spacing { let (next_tok, is_next_tok_preceded_by_whitespace) = self.next_token_from_cursor(); - let this_spacing = if is_next_tok_preceded_by_whitespace { Spacing::Alone } else { - if next_tok.is_punct() { - Spacing::Joint - } else if next_tok == token::Eof { - Spacing::Alone - } else { - Spacing::JointHidden - } + self.calculate_spacing(&next_tok) }; - self.token = next_tok; this_spacing } + fn calculate_spacing(&self, next_tok: &Token) -> Spacing { + if next_tok.is_punct() { + Spacing::Joint + } else if *next_tok == token::Eof { + Spacing::Alone + } else { + Spacing::JointHidden + } + } + + fn eof_err(&mut self) -> Diag<'psess> { + const UNCLOSED_DELIMITER_SHOW_LIMIT: usize = 5; + let msg = "this file contains an unclosed delimiter"; + let mut err = self.dcx().struct_span_err(self.token.span, msg); + + let len = usize::min(UNCLOSED_DELIMITER_SHOW_LIMIT, self.diag_info.open_delimiters.len()); + for &(_, span) in &self.diag_info.open_delimiters[..len] { + err.span_label(span, "unclosed delimiter"); + self.diag_info.unmatched_delims.push(UnmatchedDelim { + found_delim: None, + found_span: self.token.span, + unclosed_span: Some(span), + candidate_span: None, + }); + } + + if let Some((_, span)) = self.diag_info.open_delimiters.get(UNCLOSED_DELIMITER_SHOW_LIMIT) + && self.diag_info.open_delimiters.len() >= UNCLOSED_DELIMITER_SHOW_LIMIT + 2 + { + err.span_label( + *span, + format!( + "another {} unclosed delimiters begin from here", + self.diag_info.open_delimiters.len() - UNCLOSED_DELIMITER_SHOW_LIMIT + ), + ); + } + + if let Some((delim, _)) = self.diag_info.open_delimiters.last() { + report_suspicious_mismatch_block( + &mut err, + &self.diag_info, + self.psess.source_map(), + *delim, + ) + } + err + } + fn close_delim_err(&mut self, delim: Delimiter) -> Diag<'psess> { // An unexpected closing delimiter (i.e., there is no matching opening delimiter). let token_str = token_to_string(&self.token); From ed93c1783b404d728d4809973a0550eb33cd293f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 21 Jul 2025 14:22:51 +0200 Subject: [PATCH 163/183] Rename `tests/assembly` into `tests/assembly-llvm` --- compiler/rustc_codegen_gcc/build_system/src/test.rs | 2 +- src/bootstrap/src/core/build_steps/test.rs | 7 ++++++- src/bootstrap/src/core/builder/mod.rs | 4 ++-- src/ci/docker/host-x86_64/test-various/Dockerfile | 4 ++-- src/doc/rustc-dev-guide/src/asm.md | 4 ++-- src/doc/rustc-dev-guide/src/tests/compiletest.md | 4 ++-- src/tools/opt-dist/src/tests.rs | 2 +- src/tools/tidy/src/target_policy.rs | 6 +++--- tests/{assembly => assembly-llvm}/aarch64-pointer-auth.rs | 0 tests/{assembly => assembly-llvm}/aarch64-xray.rs | 0 tests/{assembly => assembly-llvm}/align_offset.rs | 0 tests/{assembly => assembly-llvm}/asm/aarch64-el2vmsa.rs | 0 tests/{assembly => assembly-llvm}/asm/aarch64-modifiers.rs | 0 .../asm/aarch64-outline-atomics.rs | 0 tests/{assembly => assembly-llvm}/asm/aarch64-types.rs | 0 tests/{assembly => assembly-llvm}/asm/arm-modifiers.rs | 0 tests/{assembly => assembly-llvm}/asm/arm-types.rs | 0 tests/{assembly => assembly-llvm}/asm/avr-modifiers.rs | 0 tests/{assembly => assembly-llvm}/asm/avr-types.rs | 0 tests/{assembly => assembly-llvm}/asm/bpf-types.rs | 0 tests/{assembly => assembly-llvm}/asm/comments.rs | 0 tests/{assembly => assembly-llvm}/asm/global_asm.rs | 0 tests/{assembly => assembly-llvm}/asm/hexagon-types.rs | 0 tests/{assembly => assembly-llvm}/asm/inline-asm-avx.rs | 0 tests/{assembly => assembly-llvm}/asm/loongarch-type.rs | 0 tests/{assembly => assembly-llvm}/asm/m68k-types.rs | 0 tests/{assembly => assembly-llvm}/asm/mips-types.rs | 0 tests/{assembly => assembly-llvm}/asm/msp430-types.rs | 0 tests/{assembly => assembly-llvm}/asm/nvptx-types.rs | 0 tests/{assembly => assembly-llvm}/asm/powerpc-types.rs | 0 tests/{assembly => assembly-llvm}/asm/riscv-types.rs | 0 tests/{assembly => assembly-llvm}/asm/s390x-types.rs | 0 tests/{assembly => assembly-llvm}/asm/sparc-types.rs | 0 tests/{assembly => assembly-llvm}/asm/wasm-types.rs | 0 tests/{assembly => assembly-llvm}/asm/x86-modifiers.rs | 0 tests/{assembly => assembly-llvm}/asm/x86-types.rs | 0 .../auxiliary/breakpoint-panic-handler.rs | 0 .../auxiliary/dwarf-mixed-versions-lto-aux.rs | 0 .../auxiliary/non-inline-dependency.rs | 0 tests/{assembly => assembly-llvm}/breakpoint.rs | 0 .../closure-inherit-target-feature.rs | 0 tests/{assembly => assembly-llvm}/cmse.rs | 0 .../compiletest-self-test/use-minicore-no-run.rs | 0 tests/{assembly => assembly-llvm}/cstring-merging.rs | 0 .../dwarf-mixed-versions-lto.rs | 0 tests/{assembly => assembly-llvm}/dwarf4.rs | 0 tests/{assembly => assembly-llvm}/dwarf5.rs | 0 tests/{assembly => assembly-llvm}/emit-intel-att-syntax.rs | 0 tests/{assembly => assembly-llvm}/is_aligned.rs | 0 .../issue-83585-small-pod-struct-equality.rs | 0 .../libs/issue-115339-zip-arrays.rs | 0 .../libs/issue-140207-slice-min-simd.rs | 0 tests/{assembly => assembly-llvm}/manual-eq-efficient.rs | 0 .../naked-functions/aarch64-naked-fn-no-bti-prolog.rs | 0 tests/{assembly => assembly-llvm}/naked-functions/aix.rs | 0 .../{assembly => assembly-llvm}/naked-functions/wasm32.rs | 0 .../naked-functions/x86_64-naked-fn-no-cet-prolog.rs | 0 tests/{assembly => assembly-llvm}/niche-prefer-zero.rs | 0 tests/{assembly => assembly-llvm}/nvptx-arch-default.rs | 0 tests/{assembly => assembly-llvm}/nvptx-arch-emit-asm.rs | 0 tests/{assembly => assembly-llvm}/nvptx-arch-link-arg.rs | 0 tests/{assembly => assembly-llvm}/nvptx-arch-target-cpu.rs | 0 tests/{assembly => assembly-llvm}/nvptx-atomics.rs | 0 tests/{assembly => assembly-llvm}/nvptx-c-abi-arg-v7.rs | 0 tests/{assembly => assembly-llvm}/nvptx-c-abi-ret-v7.rs | 0 tests/{assembly => assembly-llvm}/nvptx-internalizing.rs | 0 .../nvptx-kernel-abi/nvptx-kernel-args-abi-v7.rs | 0 tests/{assembly => assembly-llvm}/nvptx-linking-binary.rs | 0 tests/{assembly => assembly-llvm}/nvptx-linking-cdylib.rs | 0 tests/{assembly => assembly-llvm}/nvptx-safe-naming.rs | 0 .../panic-no-unwind-no-uwtable.rs | 0 .../{assembly => assembly-llvm}/panic-unwind-no-uwtable.rs | 0 tests/{assembly => assembly-llvm}/pic-relocation-model.rs | 0 tests/{assembly => assembly-llvm}/pie-relocation-model.rs | 0 tests/{assembly => assembly-llvm}/powerpc64-struct-abi.rs | 0 .../{assembly => assembly-llvm}/riscv-float-struct-abi.rs | 0 .../riscv-soft-abi-with-float-features.rs | 0 tests/{assembly => assembly-llvm}/rust-abi-arg-attr.rs | 0 .../{assembly => assembly-llvm}/s390x-backchain-toggle.rs | 0 tests/{assembly => assembly-llvm}/s390x-vector-abi.rs | 0 .../sanitizer/kcfi/emit-arity-indicator.rs | 0 tests/{assembly => assembly-llvm}/simd-bitmask.rs | 0 tests/{assembly => assembly-llvm}/simd-intrinsic-gather.rs | 0 .../simd-intrinsic-mask-load.rs | 0 .../simd-intrinsic-mask-reduce.rs | 0 .../simd-intrinsic-mask-store.rs | 0 .../{assembly => assembly-llvm}/simd-intrinsic-scatter.rs | 0 tests/{assembly => assembly-llvm}/simd-intrinsic-select.rs | 0 .../simd/reduce-fadd-unordered.rs | 0 tests/{assembly => assembly-llvm}/slice-is_ascii.rs | 0 tests/{assembly => assembly-llvm}/small_data_threshold.rs | 0 tests/{assembly => assembly-llvm}/sparc-struct-abi.rs | 0 tests/{assembly => assembly-llvm}/stack-probes.rs | 0 .../stack-protector-heuristics-effect-windows-32bit.rs | 0 .../stack-protector-heuristics-effect-windows-64bit.rs | 0 .../stack-protector/stack-protector-heuristics-effect.rs | 0 .../stack-protector/stack-protector-target-support.rs | 0 .../{assembly => assembly-llvm}/static-relocation-model.rs | 0 tests/{assembly => assembly-llvm}/strict_provenance.rs | 0 .../{assembly => assembly-llvm}/target-feature-multiple.rs | 0 .../{assembly => assembly-llvm}/targets/targets-amdgpu.rs | 0 tests/{assembly => assembly-llvm}/targets/targets-elf.rs | 0 tests/{assembly => assembly-llvm}/targets/targets-macho.rs | 0 tests/{assembly => assembly-llvm}/targets/targets-nvptx.rs | 0 tests/{assembly => assembly-llvm}/targets/targets-pe.rs | 0 tests/{assembly => assembly-llvm}/wasm_exceptions.rs | 0 tests/{assembly => assembly-llvm}/x86-return-float.rs | 0 .../x86_64-array-pair-load-store-merge.rs | 0 tests/{assembly => assembly-llvm}/x86_64-bigint-helpers.rs | 0 tests/{assembly => assembly-llvm}/x86_64-cmp.rs | 0 .../x86_64-floating-point-clamp.rs | 0 .../x86_64-fortanix-unknown-sgx-lvi-generic-load.rs | 0 .../x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs | 0 .../x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs | 0 .../{assembly => assembly-llvm}/x86_64-function-return.rs | 0 tests/{assembly => assembly-llvm}/x86_64-no-jump-tables.rs | 0 tests/{assembly => assembly-llvm}/x86_64-sse_crc.rs | 0 tests/{assembly => assembly-llvm}/x86_64-typed-swap.rs | 0 .../x86_64-windows-float-abi.rs | 0 .../{assembly => assembly-llvm}/x86_64-windows-i128-abi.rs | 0 tests/{assembly => assembly-llvm}/x86_64-xray.rs | 0 tests/codegen/target-feature-overrides.rs | 2 +- tests/run-make/avr-rjmp-offset/rmake.rs | 2 +- triagebot.toml | 2 +- 124 files changed, 22 insertions(+), 17 deletions(-) rename tests/{assembly => assembly-llvm}/aarch64-pointer-auth.rs (100%) rename tests/{assembly => assembly-llvm}/aarch64-xray.rs (100%) rename tests/{assembly => assembly-llvm}/align_offset.rs (100%) rename tests/{assembly => assembly-llvm}/asm/aarch64-el2vmsa.rs (100%) rename tests/{assembly => assembly-llvm}/asm/aarch64-modifiers.rs (100%) rename tests/{assembly => assembly-llvm}/asm/aarch64-outline-atomics.rs (100%) rename tests/{assembly => assembly-llvm}/asm/aarch64-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/arm-modifiers.rs (100%) rename tests/{assembly => assembly-llvm}/asm/arm-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/avr-modifiers.rs (100%) rename tests/{assembly => assembly-llvm}/asm/avr-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/bpf-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/comments.rs (100%) rename tests/{assembly => assembly-llvm}/asm/global_asm.rs (100%) rename tests/{assembly => assembly-llvm}/asm/hexagon-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/inline-asm-avx.rs (100%) rename tests/{assembly => assembly-llvm}/asm/loongarch-type.rs (100%) rename tests/{assembly => assembly-llvm}/asm/m68k-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/mips-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/msp430-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/nvptx-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/powerpc-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/riscv-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/s390x-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/sparc-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/wasm-types.rs (100%) rename tests/{assembly => assembly-llvm}/asm/x86-modifiers.rs (100%) rename tests/{assembly => assembly-llvm}/asm/x86-types.rs (100%) rename tests/{assembly => assembly-llvm}/auxiliary/breakpoint-panic-handler.rs (100%) rename tests/{assembly => assembly-llvm}/auxiliary/dwarf-mixed-versions-lto-aux.rs (100%) rename tests/{assembly => assembly-llvm}/auxiliary/non-inline-dependency.rs (100%) rename tests/{assembly => assembly-llvm}/breakpoint.rs (100%) rename tests/{assembly => assembly-llvm}/closure-inherit-target-feature.rs (100%) rename tests/{assembly => assembly-llvm}/cmse.rs (100%) rename tests/{assembly => assembly-llvm}/compiletest-self-test/use-minicore-no-run.rs (100%) rename tests/{assembly => assembly-llvm}/cstring-merging.rs (100%) rename tests/{assembly => assembly-llvm}/dwarf-mixed-versions-lto.rs (100%) rename tests/{assembly => assembly-llvm}/dwarf4.rs (100%) rename tests/{assembly => assembly-llvm}/dwarf5.rs (100%) rename tests/{assembly => assembly-llvm}/emit-intel-att-syntax.rs (100%) rename tests/{assembly => assembly-llvm}/is_aligned.rs (100%) rename tests/{assembly => assembly-llvm}/issue-83585-small-pod-struct-equality.rs (100%) rename tests/{assembly => assembly-llvm}/libs/issue-115339-zip-arrays.rs (100%) rename tests/{assembly => assembly-llvm}/libs/issue-140207-slice-min-simd.rs (100%) rename tests/{assembly => assembly-llvm}/manual-eq-efficient.rs (100%) rename tests/{assembly => assembly-llvm}/naked-functions/aarch64-naked-fn-no-bti-prolog.rs (100%) rename tests/{assembly => assembly-llvm}/naked-functions/aix.rs (100%) rename tests/{assembly => assembly-llvm}/naked-functions/wasm32.rs (100%) rename tests/{assembly => assembly-llvm}/naked-functions/x86_64-naked-fn-no-cet-prolog.rs (100%) rename tests/{assembly => assembly-llvm}/niche-prefer-zero.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-arch-default.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-arch-emit-asm.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-arch-link-arg.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-arch-target-cpu.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-atomics.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-c-abi-arg-v7.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-c-abi-ret-v7.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-internalizing.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-kernel-abi/nvptx-kernel-args-abi-v7.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-linking-binary.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-linking-cdylib.rs (100%) rename tests/{assembly => assembly-llvm}/nvptx-safe-naming.rs (100%) rename tests/{assembly => assembly-llvm}/panic-no-unwind-no-uwtable.rs (100%) rename tests/{assembly => assembly-llvm}/panic-unwind-no-uwtable.rs (100%) rename tests/{assembly => assembly-llvm}/pic-relocation-model.rs (100%) rename tests/{assembly => assembly-llvm}/pie-relocation-model.rs (100%) rename tests/{assembly => assembly-llvm}/powerpc64-struct-abi.rs (100%) rename tests/{assembly => assembly-llvm}/riscv-float-struct-abi.rs (100%) rename tests/{assembly => assembly-llvm}/riscv-soft-abi-with-float-features.rs (100%) rename tests/{assembly => assembly-llvm}/rust-abi-arg-attr.rs (100%) rename tests/{assembly => assembly-llvm}/s390x-backchain-toggle.rs (100%) rename tests/{assembly => assembly-llvm}/s390x-vector-abi.rs (100%) rename tests/{assembly => assembly-llvm}/sanitizer/kcfi/emit-arity-indicator.rs (100%) rename tests/{assembly => assembly-llvm}/simd-bitmask.rs (100%) rename tests/{assembly => assembly-llvm}/simd-intrinsic-gather.rs (100%) rename tests/{assembly => assembly-llvm}/simd-intrinsic-mask-load.rs (100%) rename tests/{assembly => assembly-llvm}/simd-intrinsic-mask-reduce.rs (100%) rename tests/{assembly => assembly-llvm}/simd-intrinsic-mask-store.rs (100%) rename tests/{assembly => assembly-llvm}/simd-intrinsic-scatter.rs (100%) rename tests/{assembly => assembly-llvm}/simd-intrinsic-select.rs (100%) rename tests/{assembly => assembly-llvm}/simd/reduce-fadd-unordered.rs (100%) rename tests/{assembly => assembly-llvm}/slice-is_ascii.rs (100%) rename tests/{assembly => assembly-llvm}/small_data_threshold.rs (100%) rename tests/{assembly => assembly-llvm}/sparc-struct-abi.rs (100%) rename tests/{assembly => assembly-llvm}/stack-probes.rs (100%) rename tests/{assembly => assembly-llvm}/stack-protector/stack-protector-heuristics-effect-windows-32bit.rs (100%) rename tests/{assembly => assembly-llvm}/stack-protector/stack-protector-heuristics-effect-windows-64bit.rs (100%) rename tests/{assembly => assembly-llvm}/stack-protector/stack-protector-heuristics-effect.rs (100%) rename tests/{assembly => assembly-llvm}/stack-protector/stack-protector-target-support.rs (100%) rename tests/{assembly => assembly-llvm}/static-relocation-model.rs (100%) rename tests/{assembly => assembly-llvm}/strict_provenance.rs (100%) rename tests/{assembly => assembly-llvm}/target-feature-multiple.rs (100%) rename tests/{assembly => assembly-llvm}/targets/targets-amdgpu.rs (100%) rename tests/{assembly => assembly-llvm}/targets/targets-elf.rs (100%) rename tests/{assembly => assembly-llvm}/targets/targets-macho.rs (100%) rename tests/{assembly => assembly-llvm}/targets/targets-nvptx.rs (100%) rename tests/{assembly => assembly-llvm}/targets/targets-pe.rs (100%) rename tests/{assembly => assembly-llvm}/wasm_exceptions.rs (100%) rename tests/{assembly => assembly-llvm}/x86-return-float.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-array-pair-load-store-merge.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-bigint-helpers.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-cmp.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-floating-point-clamp.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-function-return.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-no-jump-tables.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-sse_crc.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-typed-swap.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-windows-float-abi.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-windows-i128-abi.rs (100%) rename tests/{assembly => assembly-llvm}/x86_64-xray.rs (100%) diff --git a/compiler/rustc_codegen_gcc/build_system/src/test.rs b/compiler/rustc_codegen_gcc/build_system/src/test.rs index cbb0f9493838..bc0fdd40b6e8 100644 --- a/compiler/rustc_codegen_gcc/build_system/src/test.rs +++ b/compiler/rustc_codegen_gcc/build_system/src/test.rs @@ -588,7 +588,7 @@ fn asm_tests(env: &Env, args: &TestArg) -> Result<(), String> { &"always", &"--stage", &"0", - &"tests/assembly/asm", + &"tests/assembly-llvm/asm", &"--compiletest-rustc-args", &rustc_args, ], diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 8344b0e03b48..99c9e8ae92eb 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1407,7 +1407,12 @@ test!(Pretty { test!(RunMake { path: "tests/run-make", mode: "run-make", suite: "run-make", default: true }); -test!(Assembly { path: "tests/assembly", mode: "assembly", suite: "assembly", default: true }); +test!(AssemblyLlvm { + path: "tests/assembly-llvm", + mode: "assembly", + suite: "assembly-llvm", + default: true +}); /// Runs the coverage test suite at `tests/coverage` in some or all of the /// coverage test modes. diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index d73e2bce25ba..925e47a41644 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -411,7 +411,7 @@ const PATH_REMAP: &[(&str, &[&str])] = &[ "tests", &[ // tidy-alphabetical-start - "tests/assembly", + "tests/assembly-llvm", "tests/codegen", "tests/codegen-units", "tests/coverage", @@ -1051,7 +1051,7 @@ impl<'a> Builder<'a> { test::MirOpt, test::Codegen, test::CodegenUnits, - test::Assembly, + test::AssemblyLlvm, test::Incremental, test::Debuginfo, test::UiFullDeps, diff --git a/src/ci/docker/host-x86_64/test-various/Dockerfile b/src/ci/docker/host-x86_64/test-various/Dockerfile index 8d2e45ae497e..54ca7131608e 100644 --- a/src/ci/docker/host-x86_64/test-various/Dockerfile +++ b/src/ci/docker/host-x86_64/test-various/Dockerfile @@ -66,13 +66,13 @@ ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_T tests/mir-opt \ tests/codegen-units \ tests/codegen \ - tests/assembly \ + tests/assembly-llvm \ library/core ENV NVPTX_TARGETS=nvptx64-nvidia-cuda ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $NVPTX_TARGETS \ tests/run-make \ - tests/assembly + tests/assembly-llvm ENV MUSL_TARGETS=x86_64-unknown-linux-musl \ CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \ diff --git a/src/doc/rustc-dev-guide/src/asm.md b/src/doc/rustc-dev-guide/src/asm.md index eec9d448b0c9..3d93d5a4c57e 100644 --- a/src/doc/rustc-dev-guide/src/asm.md +++ b/src/doc/rustc-dev-guide/src/asm.md @@ -155,9 +155,9 @@ can't know ahead of time whether a function will require a frame/base pointer. Various tests for inline assembly are available: -- `tests/assembly/asm` +- `tests/assembly-llvm/asm` - `tests/ui/asm` - `tests/codegen/asm-*` Every architecture supported by inline assembly must have exhaustive tests in -`tests/assembly/asm` which test all combinations of register classes and types. +`tests/assembly-llvm/asm` which test all combinations of register classes and types. diff --git a/src/doc/rustc-dev-guide/src/tests/compiletest.md b/src/doc/rustc-dev-guide/src/tests/compiletest.md index aa99347b2bba..6a60e7118d38 100644 --- a/src/doc/rustc-dev-guide/src/tests/compiletest.md +++ b/src/doc/rustc-dev-guide/src/tests/compiletest.md @@ -307,7 +307,7 @@ If you need to work with `#![no_std]` cross-compiling tests, consult the ### Assembly tests -The tests in [`tests/assembly`] test LLVM assembly output. They compile the test +The tests in [`tests/assembly-llvm`] test LLVM assembly output. They compile the test with the `--emit=asm` flag to emit a `.s` file with the assembly output. They then run the LLVM [FileCheck] tool. @@ -324,7 +324,7 @@ See also the [codegen tests](#codegen-tests) for a similar set of tests. If you need to work with `#![no_std]` cross-compiling tests, consult the [`minicore` test auxiliary](./minicore.md) chapter. -[`tests/assembly`]: https://github.com/rust-lang/rust/tree/master/tests/assembly +[`tests/assembly-llvm`]: https://github.com/rust-lang/rust/tree/master/tests/assembly-llvm ### Codegen-units tests diff --git a/src/tools/opt-dist/src/tests.rs b/src/tools/opt-dist/src/tests.rs index c3c45d262dde..a70c257e52bf 100644 --- a/src/tools/opt-dist/src/tests.rs +++ b/src/tools/opt-dist/src/tests.rs @@ -100,7 +100,7 @@ llvm-config = "{llvm_config}" env.host_tuple(), "--stage", "0", - "tests/assembly", + "tests/assembly-llvm", "tests/codegen", "tests/codegen-units", "tests/incremental", diff --git a/src/tools/tidy/src/target_policy.rs b/src/tools/tidy/src/target_policy.rs index 776221d30623..550932dbfdc3 100644 --- a/src/tools/tidy/src/target_policy.rs +++ b/src/tools/tidy/src/target_policy.rs @@ -8,7 +8,7 @@ use std::path::Path; use crate::walk::{filter_not_rust, walk}; const TARGET_DEFINITIONS_PATH: &str = "compiler/rustc_target/src/spec/targets/"; -const ASSEMBLY_TEST_PATH: &str = "tests/assembly/targets/"; +const ASSEMBLY_LLVM_TEST_PATH: &str = "tests/assembly-llvm/targets/"; const REVISION_LINE_START: &str = "//@ revisions: "; const EXCEPTIONS: &[&str] = &[ // FIXME: disabled since it fails on CI saying the csky component is missing @@ -43,7 +43,7 @@ pub fn check(root_path: &Path, bad: &mut bool) { let _ = targets_to_find.insert(target_name); } - walk(&root_path.join(ASSEMBLY_TEST_PATH), |_, _| false, &mut |_, contents| { + walk(&root_path.join(ASSEMBLY_LLVM_TEST_PATH), |_, _| false, &mut |_, contents| { for line in contents.lines() { let Some(_) = line.find(REVISION_LINE_START) else { continue; @@ -55,7 +55,7 @@ pub fn check(root_path: &Path, bad: &mut bool) { for target in targets_to_find { if !EXCEPTIONS.contains(&target.as_str()) { - tidy_error!(bad, "{ASSEMBLY_TEST_PATH}: missing assembly test for {target}") + tidy_error!(bad, "{ASSEMBLY_LLVM_TEST_PATH}: missing assembly test for {target}") } } } diff --git a/tests/assembly/aarch64-pointer-auth.rs b/tests/assembly-llvm/aarch64-pointer-auth.rs similarity index 100% rename from tests/assembly/aarch64-pointer-auth.rs rename to tests/assembly-llvm/aarch64-pointer-auth.rs diff --git a/tests/assembly/aarch64-xray.rs b/tests/assembly-llvm/aarch64-xray.rs similarity index 100% rename from tests/assembly/aarch64-xray.rs rename to tests/assembly-llvm/aarch64-xray.rs diff --git a/tests/assembly/align_offset.rs b/tests/assembly-llvm/align_offset.rs similarity index 100% rename from tests/assembly/align_offset.rs rename to tests/assembly-llvm/align_offset.rs diff --git a/tests/assembly/asm/aarch64-el2vmsa.rs b/tests/assembly-llvm/asm/aarch64-el2vmsa.rs similarity index 100% rename from tests/assembly/asm/aarch64-el2vmsa.rs rename to tests/assembly-llvm/asm/aarch64-el2vmsa.rs diff --git a/tests/assembly/asm/aarch64-modifiers.rs b/tests/assembly-llvm/asm/aarch64-modifiers.rs similarity index 100% rename from tests/assembly/asm/aarch64-modifiers.rs rename to tests/assembly-llvm/asm/aarch64-modifiers.rs diff --git a/tests/assembly/asm/aarch64-outline-atomics.rs b/tests/assembly-llvm/asm/aarch64-outline-atomics.rs similarity index 100% rename from tests/assembly/asm/aarch64-outline-atomics.rs rename to tests/assembly-llvm/asm/aarch64-outline-atomics.rs diff --git a/tests/assembly/asm/aarch64-types.rs b/tests/assembly-llvm/asm/aarch64-types.rs similarity index 100% rename from tests/assembly/asm/aarch64-types.rs rename to tests/assembly-llvm/asm/aarch64-types.rs diff --git a/tests/assembly/asm/arm-modifiers.rs b/tests/assembly-llvm/asm/arm-modifiers.rs similarity index 100% rename from tests/assembly/asm/arm-modifiers.rs rename to tests/assembly-llvm/asm/arm-modifiers.rs diff --git a/tests/assembly/asm/arm-types.rs b/tests/assembly-llvm/asm/arm-types.rs similarity index 100% rename from tests/assembly/asm/arm-types.rs rename to tests/assembly-llvm/asm/arm-types.rs diff --git a/tests/assembly/asm/avr-modifiers.rs b/tests/assembly-llvm/asm/avr-modifiers.rs similarity index 100% rename from tests/assembly/asm/avr-modifiers.rs rename to tests/assembly-llvm/asm/avr-modifiers.rs diff --git a/tests/assembly/asm/avr-types.rs b/tests/assembly-llvm/asm/avr-types.rs similarity index 100% rename from tests/assembly/asm/avr-types.rs rename to tests/assembly-llvm/asm/avr-types.rs diff --git a/tests/assembly/asm/bpf-types.rs b/tests/assembly-llvm/asm/bpf-types.rs similarity index 100% rename from tests/assembly/asm/bpf-types.rs rename to tests/assembly-llvm/asm/bpf-types.rs diff --git a/tests/assembly/asm/comments.rs b/tests/assembly-llvm/asm/comments.rs similarity index 100% rename from tests/assembly/asm/comments.rs rename to tests/assembly-llvm/asm/comments.rs diff --git a/tests/assembly/asm/global_asm.rs b/tests/assembly-llvm/asm/global_asm.rs similarity index 100% rename from tests/assembly/asm/global_asm.rs rename to tests/assembly-llvm/asm/global_asm.rs diff --git a/tests/assembly/asm/hexagon-types.rs b/tests/assembly-llvm/asm/hexagon-types.rs similarity index 100% rename from tests/assembly/asm/hexagon-types.rs rename to tests/assembly-llvm/asm/hexagon-types.rs diff --git a/tests/assembly/asm/inline-asm-avx.rs b/tests/assembly-llvm/asm/inline-asm-avx.rs similarity index 100% rename from tests/assembly/asm/inline-asm-avx.rs rename to tests/assembly-llvm/asm/inline-asm-avx.rs diff --git a/tests/assembly/asm/loongarch-type.rs b/tests/assembly-llvm/asm/loongarch-type.rs similarity index 100% rename from tests/assembly/asm/loongarch-type.rs rename to tests/assembly-llvm/asm/loongarch-type.rs diff --git a/tests/assembly/asm/m68k-types.rs b/tests/assembly-llvm/asm/m68k-types.rs similarity index 100% rename from tests/assembly/asm/m68k-types.rs rename to tests/assembly-llvm/asm/m68k-types.rs diff --git a/tests/assembly/asm/mips-types.rs b/tests/assembly-llvm/asm/mips-types.rs similarity index 100% rename from tests/assembly/asm/mips-types.rs rename to tests/assembly-llvm/asm/mips-types.rs diff --git a/tests/assembly/asm/msp430-types.rs b/tests/assembly-llvm/asm/msp430-types.rs similarity index 100% rename from tests/assembly/asm/msp430-types.rs rename to tests/assembly-llvm/asm/msp430-types.rs diff --git a/tests/assembly/asm/nvptx-types.rs b/tests/assembly-llvm/asm/nvptx-types.rs similarity index 100% rename from tests/assembly/asm/nvptx-types.rs rename to tests/assembly-llvm/asm/nvptx-types.rs diff --git a/tests/assembly/asm/powerpc-types.rs b/tests/assembly-llvm/asm/powerpc-types.rs similarity index 100% rename from tests/assembly/asm/powerpc-types.rs rename to tests/assembly-llvm/asm/powerpc-types.rs diff --git a/tests/assembly/asm/riscv-types.rs b/tests/assembly-llvm/asm/riscv-types.rs similarity index 100% rename from tests/assembly/asm/riscv-types.rs rename to tests/assembly-llvm/asm/riscv-types.rs diff --git a/tests/assembly/asm/s390x-types.rs b/tests/assembly-llvm/asm/s390x-types.rs similarity index 100% rename from tests/assembly/asm/s390x-types.rs rename to tests/assembly-llvm/asm/s390x-types.rs diff --git a/tests/assembly/asm/sparc-types.rs b/tests/assembly-llvm/asm/sparc-types.rs similarity index 100% rename from tests/assembly/asm/sparc-types.rs rename to tests/assembly-llvm/asm/sparc-types.rs diff --git a/tests/assembly/asm/wasm-types.rs b/tests/assembly-llvm/asm/wasm-types.rs similarity index 100% rename from tests/assembly/asm/wasm-types.rs rename to tests/assembly-llvm/asm/wasm-types.rs diff --git a/tests/assembly/asm/x86-modifiers.rs b/tests/assembly-llvm/asm/x86-modifiers.rs similarity index 100% rename from tests/assembly/asm/x86-modifiers.rs rename to tests/assembly-llvm/asm/x86-modifiers.rs diff --git a/tests/assembly/asm/x86-types.rs b/tests/assembly-llvm/asm/x86-types.rs similarity index 100% rename from tests/assembly/asm/x86-types.rs rename to tests/assembly-llvm/asm/x86-types.rs diff --git a/tests/assembly/auxiliary/breakpoint-panic-handler.rs b/tests/assembly-llvm/auxiliary/breakpoint-panic-handler.rs similarity index 100% rename from tests/assembly/auxiliary/breakpoint-panic-handler.rs rename to tests/assembly-llvm/auxiliary/breakpoint-panic-handler.rs diff --git a/tests/assembly/auxiliary/dwarf-mixed-versions-lto-aux.rs b/tests/assembly-llvm/auxiliary/dwarf-mixed-versions-lto-aux.rs similarity index 100% rename from tests/assembly/auxiliary/dwarf-mixed-versions-lto-aux.rs rename to tests/assembly-llvm/auxiliary/dwarf-mixed-versions-lto-aux.rs diff --git a/tests/assembly/auxiliary/non-inline-dependency.rs b/tests/assembly-llvm/auxiliary/non-inline-dependency.rs similarity index 100% rename from tests/assembly/auxiliary/non-inline-dependency.rs rename to tests/assembly-llvm/auxiliary/non-inline-dependency.rs diff --git a/tests/assembly/breakpoint.rs b/tests/assembly-llvm/breakpoint.rs similarity index 100% rename from tests/assembly/breakpoint.rs rename to tests/assembly-llvm/breakpoint.rs diff --git a/tests/assembly/closure-inherit-target-feature.rs b/tests/assembly-llvm/closure-inherit-target-feature.rs similarity index 100% rename from tests/assembly/closure-inherit-target-feature.rs rename to tests/assembly-llvm/closure-inherit-target-feature.rs diff --git a/tests/assembly/cmse.rs b/tests/assembly-llvm/cmse.rs similarity index 100% rename from tests/assembly/cmse.rs rename to tests/assembly-llvm/cmse.rs diff --git a/tests/assembly/compiletest-self-test/use-minicore-no-run.rs b/tests/assembly-llvm/compiletest-self-test/use-minicore-no-run.rs similarity index 100% rename from tests/assembly/compiletest-self-test/use-minicore-no-run.rs rename to tests/assembly-llvm/compiletest-self-test/use-minicore-no-run.rs diff --git a/tests/assembly/cstring-merging.rs b/tests/assembly-llvm/cstring-merging.rs similarity index 100% rename from tests/assembly/cstring-merging.rs rename to tests/assembly-llvm/cstring-merging.rs diff --git a/tests/assembly/dwarf-mixed-versions-lto.rs b/tests/assembly-llvm/dwarf-mixed-versions-lto.rs similarity index 100% rename from tests/assembly/dwarf-mixed-versions-lto.rs rename to tests/assembly-llvm/dwarf-mixed-versions-lto.rs diff --git a/tests/assembly/dwarf4.rs b/tests/assembly-llvm/dwarf4.rs similarity index 100% rename from tests/assembly/dwarf4.rs rename to tests/assembly-llvm/dwarf4.rs diff --git a/tests/assembly/dwarf5.rs b/tests/assembly-llvm/dwarf5.rs similarity index 100% rename from tests/assembly/dwarf5.rs rename to tests/assembly-llvm/dwarf5.rs diff --git a/tests/assembly/emit-intel-att-syntax.rs b/tests/assembly-llvm/emit-intel-att-syntax.rs similarity index 100% rename from tests/assembly/emit-intel-att-syntax.rs rename to tests/assembly-llvm/emit-intel-att-syntax.rs diff --git a/tests/assembly/is_aligned.rs b/tests/assembly-llvm/is_aligned.rs similarity index 100% rename from tests/assembly/is_aligned.rs rename to tests/assembly-llvm/is_aligned.rs diff --git a/tests/assembly/issue-83585-small-pod-struct-equality.rs b/tests/assembly-llvm/issue-83585-small-pod-struct-equality.rs similarity index 100% rename from tests/assembly/issue-83585-small-pod-struct-equality.rs rename to tests/assembly-llvm/issue-83585-small-pod-struct-equality.rs diff --git a/tests/assembly/libs/issue-115339-zip-arrays.rs b/tests/assembly-llvm/libs/issue-115339-zip-arrays.rs similarity index 100% rename from tests/assembly/libs/issue-115339-zip-arrays.rs rename to tests/assembly-llvm/libs/issue-115339-zip-arrays.rs diff --git a/tests/assembly/libs/issue-140207-slice-min-simd.rs b/tests/assembly-llvm/libs/issue-140207-slice-min-simd.rs similarity index 100% rename from tests/assembly/libs/issue-140207-slice-min-simd.rs rename to tests/assembly-llvm/libs/issue-140207-slice-min-simd.rs diff --git a/tests/assembly/manual-eq-efficient.rs b/tests/assembly-llvm/manual-eq-efficient.rs similarity index 100% rename from tests/assembly/manual-eq-efficient.rs rename to tests/assembly-llvm/manual-eq-efficient.rs diff --git a/tests/assembly/naked-functions/aarch64-naked-fn-no-bti-prolog.rs b/tests/assembly-llvm/naked-functions/aarch64-naked-fn-no-bti-prolog.rs similarity index 100% rename from tests/assembly/naked-functions/aarch64-naked-fn-no-bti-prolog.rs rename to tests/assembly-llvm/naked-functions/aarch64-naked-fn-no-bti-prolog.rs diff --git a/tests/assembly/naked-functions/aix.rs b/tests/assembly-llvm/naked-functions/aix.rs similarity index 100% rename from tests/assembly/naked-functions/aix.rs rename to tests/assembly-llvm/naked-functions/aix.rs diff --git a/tests/assembly/naked-functions/wasm32.rs b/tests/assembly-llvm/naked-functions/wasm32.rs similarity index 100% rename from tests/assembly/naked-functions/wasm32.rs rename to tests/assembly-llvm/naked-functions/wasm32.rs diff --git a/tests/assembly/naked-functions/x86_64-naked-fn-no-cet-prolog.rs b/tests/assembly-llvm/naked-functions/x86_64-naked-fn-no-cet-prolog.rs similarity index 100% rename from tests/assembly/naked-functions/x86_64-naked-fn-no-cet-prolog.rs rename to tests/assembly-llvm/naked-functions/x86_64-naked-fn-no-cet-prolog.rs diff --git a/tests/assembly/niche-prefer-zero.rs b/tests/assembly-llvm/niche-prefer-zero.rs similarity index 100% rename from tests/assembly/niche-prefer-zero.rs rename to tests/assembly-llvm/niche-prefer-zero.rs diff --git a/tests/assembly/nvptx-arch-default.rs b/tests/assembly-llvm/nvptx-arch-default.rs similarity index 100% rename from tests/assembly/nvptx-arch-default.rs rename to tests/assembly-llvm/nvptx-arch-default.rs diff --git a/tests/assembly/nvptx-arch-emit-asm.rs b/tests/assembly-llvm/nvptx-arch-emit-asm.rs similarity index 100% rename from tests/assembly/nvptx-arch-emit-asm.rs rename to tests/assembly-llvm/nvptx-arch-emit-asm.rs diff --git a/tests/assembly/nvptx-arch-link-arg.rs b/tests/assembly-llvm/nvptx-arch-link-arg.rs similarity index 100% rename from tests/assembly/nvptx-arch-link-arg.rs rename to tests/assembly-llvm/nvptx-arch-link-arg.rs diff --git a/tests/assembly/nvptx-arch-target-cpu.rs b/tests/assembly-llvm/nvptx-arch-target-cpu.rs similarity index 100% rename from tests/assembly/nvptx-arch-target-cpu.rs rename to tests/assembly-llvm/nvptx-arch-target-cpu.rs diff --git a/tests/assembly/nvptx-atomics.rs b/tests/assembly-llvm/nvptx-atomics.rs similarity index 100% rename from tests/assembly/nvptx-atomics.rs rename to tests/assembly-llvm/nvptx-atomics.rs diff --git a/tests/assembly/nvptx-c-abi-arg-v7.rs b/tests/assembly-llvm/nvptx-c-abi-arg-v7.rs similarity index 100% rename from tests/assembly/nvptx-c-abi-arg-v7.rs rename to tests/assembly-llvm/nvptx-c-abi-arg-v7.rs diff --git a/tests/assembly/nvptx-c-abi-ret-v7.rs b/tests/assembly-llvm/nvptx-c-abi-ret-v7.rs similarity index 100% rename from tests/assembly/nvptx-c-abi-ret-v7.rs rename to tests/assembly-llvm/nvptx-c-abi-ret-v7.rs diff --git a/tests/assembly/nvptx-internalizing.rs b/tests/assembly-llvm/nvptx-internalizing.rs similarity index 100% rename from tests/assembly/nvptx-internalizing.rs rename to tests/assembly-llvm/nvptx-internalizing.rs diff --git a/tests/assembly/nvptx-kernel-abi/nvptx-kernel-args-abi-v7.rs b/tests/assembly-llvm/nvptx-kernel-abi/nvptx-kernel-args-abi-v7.rs similarity index 100% rename from tests/assembly/nvptx-kernel-abi/nvptx-kernel-args-abi-v7.rs rename to tests/assembly-llvm/nvptx-kernel-abi/nvptx-kernel-args-abi-v7.rs diff --git a/tests/assembly/nvptx-linking-binary.rs b/tests/assembly-llvm/nvptx-linking-binary.rs similarity index 100% rename from tests/assembly/nvptx-linking-binary.rs rename to tests/assembly-llvm/nvptx-linking-binary.rs diff --git a/tests/assembly/nvptx-linking-cdylib.rs b/tests/assembly-llvm/nvptx-linking-cdylib.rs similarity index 100% rename from tests/assembly/nvptx-linking-cdylib.rs rename to tests/assembly-llvm/nvptx-linking-cdylib.rs diff --git a/tests/assembly/nvptx-safe-naming.rs b/tests/assembly-llvm/nvptx-safe-naming.rs similarity index 100% rename from tests/assembly/nvptx-safe-naming.rs rename to tests/assembly-llvm/nvptx-safe-naming.rs diff --git a/tests/assembly/panic-no-unwind-no-uwtable.rs b/tests/assembly-llvm/panic-no-unwind-no-uwtable.rs similarity index 100% rename from tests/assembly/panic-no-unwind-no-uwtable.rs rename to tests/assembly-llvm/panic-no-unwind-no-uwtable.rs diff --git a/tests/assembly/panic-unwind-no-uwtable.rs b/tests/assembly-llvm/panic-unwind-no-uwtable.rs similarity index 100% rename from tests/assembly/panic-unwind-no-uwtable.rs rename to tests/assembly-llvm/panic-unwind-no-uwtable.rs diff --git a/tests/assembly/pic-relocation-model.rs b/tests/assembly-llvm/pic-relocation-model.rs similarity index 100% rename from tests/assembly/pic-relocation-model.rs rename to tests/assembly-llvm/pic-relocation-model.rs diff --git a/tests/assembly/pie-relocation-model.rs b/tests/assembly-llvm/pie-relocation-model.rs similarity index 100% rename from tests/assembly/pie-relocation-model.rs rename to tests/assembly-llvm/pie-relocation-model.rs diff --git a/tests/assembly/powerpc64-struct-abi.rs b/tests/assembly-llvm/powerpc64-struct-abi.rs similarity index 100% rename from tests/assembly/powerpc64-struct-abi.rs rename to tests/assembly-llvm/powerpc64-struct-abi.rs diff --git a/tests/assembly/riscv-float-struct-abi.rs b/tests/assembly-llvm/riscv-float-struct-abi.rs similarity index 100% rename from tests/assembly/riscv-float-struct-abi.rs rename to tests/assembly-llvm/riscv-float-struct-abi.rs diff --git a/tests/assembly/riscv-soft-abi-with-float-features.rs b/tests/assembly-llvm/riscv-soft-abi-with-float-features.rs similarity index 100% rename from tests/assembly/riscv-soft-abi-with-float-features.rs rename to tests/assembly-llvm/riscv-soft-abi-with-float-features.rs diff --git a/tests/assembly/rust-abi-arg-attr.rs b/tests/assembly-llvm/rust-abi-arg-attr.rs similarity index 100% rename from tests/assembly/rust-abi-arg-attr.rs rename to tests/assembly-llvm/rust-abi-arg-attr.rs diff --git a/tests/assembly/s390x-backchain-toggle.rs b/tests/assembly-llvm/s390x-backchain-toggle.rs similarity index 100% rename from tests/assembly/s390x-backchain-toggle.rs rename to tests/assembly-llvm/s390x-backchain-toggle.rs diff --git a/tests/assembly/s390x-vector-abi.rs b/tests/assembly-llvm/s390x-vector-abi.rs similarity index 100% rename from tests/assembly/s390x-vector-abi.rs rename to tests/assembly-llvm/s390x-vector-abi.rs diff --git a/tests/assembly/sanitizer/kcfi/emit-arity-indicator.rs b/tests/assembly-llvm/sanitizer/kcfi/emit-arity-indicator.rs similarity index 100% rename from tests/assembly/sanitizer/kcfi/emit-arity-indicator.rs rename to tests/assembly-llvm/sanitizer/kcfi/emit-arity-indicator.rs diff --git a/tests/assembly/simd-bitmask.rs b/tests/assembly-llvm/simd-bitmask.rs similarity index 100% rename from tests/assembly/simd-bitmask.rs rename to tests/assembly-llvm/simd-bitmask.rs diff --git a/tests/assembly/simd-intrinsic-gather.rs b/tests/assembly-llvm/simd-intrinsic-gather.rs similarity index 100% rename from tests/assembly/simd-intrinsic-gather.rs rename to tests/assembly-llvm/simd-intrinsic-gather.rs diff --git a/tests/assembly/simd-intrinsic-mask-load.rs b/tests/assembly-llvm/simd-intrinsic-mask-load.rs similarity index 100% rename from tests/assembly/simd-intrinsic-mask-load.rs rename to tests/assembly-llvm/simd-intrinsic-mask-load.rs diff --git a/tests/assembly/simd-intrinsic-mask-reduce.rs b/tests/assembly-llvm/simd-intrinsic-mask-reduce.rs similarity index 100% rename from tests/assembly/simd-intrinsic-mask-reduce.rs rename to tests/assembly-llvm/simd-intrinsic-mask-reduce.rs diff --git a/tests/assembly/simd-intrinsic-mask-store.rs b/tests/assembly-llvm/simd-intrinsic-mask-store.rs similarity index 100% rename from tests/assembly/simd-intrinsic-mask-store.rs rename to tests/assembly-llvm/simd-intrinsic-mask-store.rs diff --git a/tests/assembly/simd-intrinsic-scatter.rs b/tests/assembly-llvm/simd-intrinsic-scatter.rs similarity index 100% rename from tests/assembly/simd-intrinsic-scatter.rs rename to tests/assembly-llvm/simd-intrinsic-scatter.rs diff --git a/tests/assembly/simd-intrinsic-select.rs b/tests/assembly-llvm/simd-intrinsic-select.rs similarity index 100% rename from tests/assembly/simd-intrinsic-select.rs rename to tests/assembly-llvm/simd-intrinsic-select.rs diff --git a/tests/assembly/simd/reduce-fadd-unordered.rs b/tests/assembly-llvm/simd/reduce-fadd-unordered.rs similarity index 100% rename from tests/assembly/simd/reduce-fadd-unordered.rs rename to tests/assembly-llvm/simd/reduce-fadd-unordered.rs diff --git a/tests/assembly/slice-is_ascii.rs b/tests/assembly-llvm/slice-is_ascii.rs similarity index 100% rename from tests/assembly/slice-is_ascii.rs rename to tests/assembly-llvm/slice-is_ascii.rs diff --git a/tests/assembly/small_data_threshold.rs b/tests/assembly-llvm/small_data_threshold.rs similarity index 100% rename from tests/assembly/small_data_threshold.rs rename to tests/assembly-llvm/small_data_threshold.rs diff --git a/tests/assembly/sparc-struct-abi.rs b/tests/assembly-llvm/sparc-struct-abi.rs similarity index 100% rename from tests/assembly/sparc-struct-abi.rs rename to tests/assembly-llvm/sparc-struct-abi.rs diff --git a/tests/assembly/stack-probes.rs b/tests/assembly-llvm/stack-probes.rs similarity index 100% rename from tests/assembly/stack-probes.rs rename to tests/assembly-llvm/stack-probes.rs diff --git a/tests/assembly/stack-protector/stack-protector-heuristics-effect-windows-32bit.rs b/tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-windows-32bit.rs similarity index 100% rename from tests/assembly/stack-protector/stack-protector-heuristics-effect-windows-32bit.rs rename to tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-windows-32bit.rs diff --git a/tests/assembly/stack-protector/stack-protector-heuristics-effect-windows-64bit.rs b/tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-windows-64bit.rs similarity index 100% rename from tests/assembly/stack-protector/stack-protector-heuristics-effect-windows-64bit.rs rename to tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-windows-64bit.rs diff --git a/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs b/tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect.rs similarity index 100% rename from tests/assembly/stack-protector/stack-protector-heuristics-effect.rs rename to tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect.rs diff --git a/tests/assembly/stack-protector/stack-protector-target-support.rs b/tests/assembly-llvm/stack-protector/stack-protector-target-support.rs similarity index 100% rename from tests/assembly/stack-protector/stack-protector-target-support.rs rename to tests/assembly-llvm/stack-protector/stack-protector-target-support.rs diff --git a/tests/assembly/static-relocation-model.rs b/tests/assembly-llvm/static-relocation-model.rs similarity index 100% rename from tests/assembly/static-relocation-model.rs rename to tests/assembly-llvm/static-relocation-model.rs diff --git a/tests/assembly/strict_provenance.rs b/tests/assembly-llvm/strict_provenance.rs similarity index 100% rename from tests/assembly/strict_provenance.rs rename to tests/assembly-llvm/strict_provenance.rs diff --git a/tests/assembly/target-feature-multiple.rs b/tests/assembly-llvm/target-feature-multiple.rs similarity index 100% rename from tests/assembly/target-feature-multiple.rs rename to tests/assembly-llvm/target-feature-multiple.rs diff --git a/tests/assembly/targets/targets-amdgpu.rs b/tests/assembly-llvm/targets/targets-amdgpu.rs similarity index 100% rename from tests/assembly/targets/targets-amdgpu.rs rename to tests/assembly-llvm/targets/targets-amdgpu.rs diff --git a/tests/assembly/targets/targets-elf.rs b/tests/assembly-llvm/targets/targets-elf.rs similarity index 100% rename from tests/assembly/targets/targets-elf.rs rename to tests/assembly-llvm/targets/targets-elf.rs diff --git a/tests/assembly/targets/targets-macho.rs b/tests/assembly-llvm/targets/targets-macho.rs similarity index 100% rename from tests/assembly/targets/targets-macho.rs rename to tests/assembly-llvm/targets/targets-macho.rs diff --git a/tests/assembly/targets/targets-nvptx.rs b/tests/assembly-llvm/targets/targets-nvptx.rs similarity index 100% rename from tests/assembly/targets/targets-nvptx.rs rename to tests/assembly-llvm/targets/targets-nvptx.rs diff --git a/tests/assembly/targets/targets-pe.rs b/tests/assembly-llvm/targets/targets-pe.rs similarity index 100% rename from tests/assembly/targets/targets-pe.rs rename to tests/assembly-llvm/targets/targets-pe.rs diff --git a/tests/assembly/wasm_exceptions.rs b/tests/assembly-llvm/wasm_exceptions.rs similarity index 100% rename from tests/assembly/wasm_exceptions.rs rename to tests/assembly-llvm/wasm_exceptions.rs diff --git a/tests/assembly/x86-return-float.rs b/tests/assembly-llvm/x86-return-float.rs similarity index 100% rename from tests/assembly/x86-return-float.rs rename to tests/assembly-llvm/x86-return-float.rs diff --git a/tests/assembly/x86_64-array-pair-load-store-merge.rs b/tests/assembly-llvm/x86_64-array-pair-load-store-merge.rs similarity index 100% rename from tests/assembly/x86_64-array-pair-load-store-merge.rs rename to tests/assembly-llvm/x86_64-array-pair-load-store-merge.rs diff --git a/tests/assembly/x86_64-bigint-helpers.rs b/tests/assembly-llvm/x86_64-bigint-helpers.rs similarity index 100% rename from tests/assembly/x86_64-bigint-helpers.rs rename to tests/assembly-llvm/x86_64-bigint-helpers.rs diff --git a/tests/assembly/x86_64-cmp.rs b/tests/assembly-llvm/x86_64-cmp.rs similarity index 100% rename from tests/assembly/x86_64-cmp.rs rename to tests/assembly-llvm/x86_64-cmp.rs diff --git a/tests/assembly/x86_64-floating-point-clamp.rs b/tests/assembly-llvm/x86_64-floating-point-clamp.rs similarity index 100% rename from tests/assembly/x86_64-floating-point-clamp.rs rename to tests/assembly-llvm/x86_64-floating-point-clamp.rs diff --git a/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs b/tests/assembly-llvm/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs similarity index 100% rename from tests/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs rename to tests/assembly-llvm/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs diff --git a/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs b/tests/assembly-llvm/x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs similarity index 100% rename from tests/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs rename to tests/assembly-llvm/x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs diff --git a/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs b/tests/assembly-llvm/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs similarity index 100% rename from tests/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs rename to tests/assembly-llvm/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs diff --git a/tests/assembly/x86_64-function-return.rs b/tests/assembly-llvm/x86_64-function-return.rs similarity index 100% rename from tests/assembly/x86_64-function-return.rs rename to tests/assembly-llvm/x86_64-function-return.rs diff --git a/tests/assembly/x86_64-no-jump-tables.rs b/tests/assembly-llvm/x86_64-no-jump-tables.rs similarity index 100% rename from tests/assembly/x86_64-no-jump-tables.rs rename to tests/assembly-llvm/x86_64-no-jump-tables.rs diff --git a/tests/assembly/x86_64-sse_crc.rs b/tests/assembly-llvm/x86_64-sse_crc.rs similarity index 100% rename from tests/assembly/x86_64-sse_crc.rs rename to tests/assembly-llvm/x86_64-sse_crc.rs diff --git a/tests/assembly/x86_64-typed-swap.rs b/tests/assembly-llvm/x86_64-typed-swap.rs similarity index 100% rename from tests/assembly/x86_64-typed-swap.rs rename to tests/assembly-llvm/x86_64-typed-swap.rs diff --git a/tests/assembly/x86_64-windows-float-abi.rs b/tests/assembly-llvm/x86_64-windows-float-abi.rs similarity index 100% rename from tests/assembly/x86_64-windows-float-abi.rs rename to tests/assembly-llvm/x86_64-windows-float-abi.rs diff --git a/tests/assembly/x86_64-windows-i128-abi.rs b/tests/assembly-llvm/x86_64-windows-i128-abi.rs similarity index 100% rename from tests/assembly/x86_64-windows-i128-abi.rs rename to tests/assembly-llvm/x86_64-windows-i128-abi.rs diff --git a/tests/assembly/x86_64-xray.rs b/tests/assembly-llvm/x86_64-xray.rs similarity index 100% rename from tests/assembly/x86_64-xray.rs rename to tests/assembly-llvm/x86_64-xray.rs diff --git a/tests/codegen/target-feature-overrides.rs b/tests/codegen/target-feature-overrides.rs index eb19b0de2fa8..63a586d388b6 100644 --- a/tests/codegen/target-feature-overrides.rs +++ b/tests/codegen/target-feature-overrides.rs @@ -6,7 +6,7 @@ //@ [COMPAT] compile-flags: -Ctarget-feature=+avx2 //@ [INCOMPAT] compile-flags: -Ctarget-feature=-avx2,-avx -// See also tests/assembly/target-feature-multiple.rs +// See also tests/assembly-llvm/target-feature-multiple.rs #![feature(no_core, lang_items)] #![crate_type = "lib"] #![no_core] diff --git a/tests/run-make/avr-rjmp-offset/rmake.rs b/tests/run-make/avr-rjmp-offset/rmake.rs index da314f26ca78..86d85e89f788 100644 --- a/tests/run-make/avr-rjmp-offset/rmake.rs +++ b/tests/run-make/avr-rjmp-offset/rmake.rs @@ -6,7 +6,7 @@ //! loop instruction to be missed. This test therefore contains a simple loop //! with trivial instructions in it, to see, where the label is placed. //! -//! This must be a `rmake`-test and cannot be a `tests/assembly`-test, since the +//! This must be a `rmake`-test and cannot be a `tests/assembly-llvm/`-test, since the //! wrong output is only produced with direct assembly generation, but not when //! "emit-asm" is used, as described in the issue description of #129301: //! https://github.com/rust-lang/rust/issues/129301#issue-2475070770 diff --git a/triagebot.toml b/triagebot.toml index 61d8a814c89e..e34e4a88f42d 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -302,7 +302,7 @@ trigger_files = [ "compiler", # Tests - "tests/assembly", + "tests/assembly-llvm", "tests/auxiliary", "tests/codegen", "tests/codegen-units", From a27f3e3fd1e4d16160f8885b6b06665b5319f56c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 21 Jul 2025 14:34:12 +0200 Subject: [PATCH 164/183] Rename `tests/codegen` into `tests/codegen-llvm` --- compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 2 +- .../src/unreachable_prop.rs | 2 +- .../alloc/src/collections/vec_deque/drain.rs | 2 +- library/alloc/src/raw_vec/mod.rs | 2 +- rustfmt.toml | 4 ++-- src/bootstrap/src/core/build_steps/test.rs | 11 ++++++++--- src/bootstrap/src/core/builder/mod.rs | 4 ++-- .../docker/host-x86_64/test-various/Dockerfile | 2 +- src/doc/rustc-dev-guide/src/asm.md | 2 +- .../src/autodiff/installation.md | 2 +- .../src/llvm-coverage-instrumentation.md | 4 ++-- .../src/offload/installation.md | 2 +- .../src/profile-guided-optimization.md | 2 +- src/doc/rustc-dev-guide/src/sanitizers.md | 4 ++-- .../rustc-dev-guide/src/tests/compiletest.md | 6 +++--- src/tools/opt-dist/src/tests.rs | 2 +- tests/assembly-llvm/target-feature-multiple.rs | 2 +- tests/{codegen => codegen-llvm}/README.md | 0 .../aarch64-softfloat.rs | 0 .../aarch64-struct-align-128.rs | 0 tests/{codegen => codegen-llvm}/abi-efiapi.rs | 0 .../abi-main-signature-16bit-c-int.rs | 0 .../abi-main-signature-32bit-c-int.rs | 0 .../{codegen => codegen-llvm}/abi-repr-ext.rs | 0 tests/{codegen => codegen-llvm}/abi-sysv64.rs | 0 .../{codegen => codegen-llvm}/abi-win64-zst.rs | 0 .../abi-x86-interrupt.rs | 0 tests/{codegen => codegen-llvm}/abi-x86-sse.rs | 0 .../abi-x86_64_sysv.rs | 0 .../addr-of-mutate.rs | 0 tests/{codegen => codegen-llvm}/adjustments.rs | 0 .../align-byval-alignment-mismatch.rs | 0 .../align-byval-vector.rs | 0 tests/{codegen => codegen-llvm}/align-byval.rs | 0 tests/{codegen => codegen-llvm}/align-enum.rs | 0 tests/{codegen => codegen-llvm}/align-fn.rs | 0 .../{codegen => codegen-llvm}/align-offset.rs | 0 .../{codegen => codegen-llvm}/align-struct.rs | 0 .../alloc-optimisation.rs | 0 .../amdgpu-addrspacecast.rs | 0 tests/{codegen => codegen-llvm}/array-clone.rs | 0 tests/{codegen => codegen-llvm}/array-cmp.rs | 0 .../{codegen => codegen-llvm}/array-codegen.rs | 0 .../array-equality.rs | 0 .../{codegen => codegen-llvm}/array-from_fn.rs | 0 tests/{codegen => codegen-llvm}/array-map.rs | 0 .../array-optimized.rs | 0 .../{codegen => codegen-llvm}/array-repeat.rs | 0 tests/{codegen => codegen-llvm}/ascii-char.rs | 0 .../asm/aarch64-clobbers.rs | 0 .../asm/avr-clobbers.rs | 0 .../asm/bpf-clobbers.rs | 0 .../{codegen => codegen-llvm}/asm/critical.rs | 0 .../asm/csky-clobbers.rs | 0 tests/{codegen => codegen-llvm}/asm/foo.s | 0 .../asm/global_asm.rs | 0 .../asm/global_asm_include.rs | 0 .../asm/global_asm_x2.rs | 0 tests/{codegen => codegen-llvm}/asm/goto.rs | 0 .../asm/hexagon-clobbers.rs | 0 .../asm/may_unwind.rs | 0 .../asm/maybe-uninit.rs | 0 .../asm/msp430-clobbers.rs | 0 .../asm/multiple-options.rs | 0 tests/{codegen => codegen-llvm}/asm/options.rs | 0 .../asm/powerpc-clobbers.rs | 0 .../asm/riscv-clobbers.rs | 0 .../asm/s390x-clobbers.rs | 0 .../asm/sanitize-llvm.rs | 0 .../asm/sparc-clobbers.rs | 0 .../asm/x86-clobber_abi.rs | 0 .../asm/x86-clobbers.rs | 0 .../asm/x86-target-clobbers.rs | 0 .../assign-desugar-debuginfo.rs | 0 .../async-closure-debug.rs | 0 .../async-fn-debug-awaitee-field.rs | 0 .../async-fn-debug-msvc.rs | 0 .../async-fn-debug.rs | 0 .../atomic-operations.rs | 0 tests/{codegen => codegen-llvm}/atomicptr.rs | 0 .../autodiff/batched.rs | 0 .../autodiff/generic.rs | 0 .../autodiff/identical_fnc.rs | 0 .../autodiff/inline.rs | 0 .../autodiff/scalar.rs | 0 .../{codegen => codegen-llvm}/autodiff/sret.rs | 0 tests/{codegen => codegen-llvm}/autodiffv2.rs | 0 .../autovec/dont-shuffle-bswaps-opt2.rs | 0 .../autovec/dont-shuffle-bswaps-opt3.rs | 0 .../autovectorize-f32x4.rs | 0 .../auxiliary/extern_decl.rs | 0 .../auxiliary/nounwind.rs | 0 .../auxiliary/thread_local_aux.rs | 0 .../avr/avr-func-addrspace.rs | 0 .../bigint-helpers.rs | 0 .../binary-heap-peek-mut-pop-no-panic.rs | 0 .../binary-search-index-no-bound-check.rs | 0 tests/{codegen => codegen-llvm}/bool-cmp.rs | 0 .../bounds-checking/gep-issue-133979.rs | 0 .../box-default-debug-copies.rs | 0 .../box-uninit-bytes.rs | 0 tests/{codegen => codegen-llvm}/bpf-alu32.rs | 0 .../branch-protection.rs | 0 .../call-llvm-intrinsics.rs | 0 .../call-tmps-lifetime.rs | 0 .../cast-optimized.rs | 0 .../cast-target-abi.rs | 0 .../{codegen => codegen-llvm}/catch-unwind.rs | 0 .../cdylib-external-inline-fns.rs | 0 .../{codegen => codegen-llvm}/cf-protection.rs | 0 .../cffi/c-variadic-copy.rs | 0 .../cffi/c-variadic-naked.rs | 0 .../cffi/c-variadic-opt.rs | 0 .../cffi/c-variadic.rs | 0 .../cffi/ffi-const.rs | 0 .../cffi/ffi-out-of-bounds-loads.rs | 0 .../{codegen => codegen-llvm}/cffi/ffi-pure.rs | 0 .../cfguard-checks.rs | 0 .../cfguard-disabled.rs | 0 .../cfguard-nochecks.rs | 0 .../cfguard-non-msvc.rs | 0 .../char-ascii-branchless.rs | 0 .../char-escape-debug-no-bounds-check.rs | 0 .../{codegen => codegen-llvm}/checked_ilog.rs | 0 .../{codegen => codegen-llvm}/checked_math.rs | 0 tests/{codegen => codegen-llvm}/clone-shims.rs | 0 .../{codegen => codegen-llvm}/clone_as_copy.rs | 0 tests/{codegen => codegen-llvm}/codemodels.rs | 0 tests/{codegen => codegen-llvm}/coercions.rs | 0 .../cold-call-declare-and-call.rs | 0 .../common_prim_int_ptr.rs | 0 .../comparison-operators-2-struct.rs | 0 .../comparison-operators-2-tuple.rs | 0 .../comparison-operators-newtype.rs | 0 .../minicore-smoke-test.rs | 0 tests/{codegen => codegen-llvm}/const-array.rs | 0 .../{codegen => codegen-llvm}/const-vector.rs | 0 .../const_scalar_pair.rs | 0 .../constant-branch.rs | 0 tests/{codegen => codegen-llvm}/consts.rs | 0 .../coroutine-debug-msvc.rs | 0 .../coroutine-debug.rs | 0 .../cross-crate-inlining/always-inline.rs | 0 .../cross-crate-inlining/auxiliary/always.rs | 0 .../cross-crate-inlining/auxiliary/leaf.rs | 0 .../cross-crate-inlining/auxiliary/never.rs | 0 .../cross-crate-inlining/leaf-inlining.rs | 0 .../cross-crate-inlining/never-inline.rs | 0 .../dealloc-no-unwind.rs | 0 .../debug-accessibility/crate-enum.rs | 0 .../debug-accessibility/crate-struct.rs | 0 .../debug-accessibility/private-enum.rs | 0 .../debug-accessibility/private-struct.rs | 0 .../debug-accessibility/public-enum.rs | 0 .../debug-accessibility/public-struct.rs | 0 .../debug-accessibility/struct-fields.rs | 0 .../debug-accessibility/super-enum.rs | 0 .../debug-accessibility/super-struct.rs | 0 .../debug-accessibility/tuple-fields.rs | 0 .../debug-alignment.rs | 0 .../debug-column-msvc.rs | 0 .../{codegen => codegen-llvm}/debug-column.rs | 0 .../debug-compile-unit-path.rs | 0 .../debug-fndef-size.rs | 0 .../{codegen => codegen-llvm}/debug-limited.rs | 0 .../debug-line-directives-only.rs | 0 .../debug-line-tables-only.rs | 0 .../debug-linkage-name.rs | 0 .../{codegen => codegen-llvm}/debug-vtable.rs | 0 .../debuginfo-constant-locals.rs | 0 .../debuginfo-generic-closure-env-names.rs | 0 .../debuginfo-inline-callsite-location.rs | 0 .../auxiliary/macro_def.rs | 0 .../mir_inlined_twice_var_locs.rs | 0 .../deduced-param-attrs.rs | 0 .../default-requires-uwtable.rs | 0 .../default-visibility.rs | 0 .../direct-access-external-data.rs | 0 .../dllimports/auxiliary/dummy.rs | 0 .../dllimports/auxiliary/wrapper.rs | 0 .../dllimports/main.rs | 0 ...private_const_fn_only_used_in_const_eval.rs | 0 .../drop-in-place-noalias.rs | 0 tests/{codegen => codegen-llvm}/drop.rs | 0 tests/{codegen => codegen-llvm}/dst-offset.rs | 0 .../dst-vtable-align-nonzero.rs | 0 .../dst-vtable-size-range.rs | 0 .../ehcontguard_disabled.rs | 0 .../ehcontguard_enabled.rs | 0 .../emscripten-catch-unwind-js-eh.rs | 0 .../emscripten-catch-unwind-wasm-eh.rs | 0 .../enable-lto-unit-splitting.rs | 0 .../enum/enum-aggregate.rs | 0 .../enum/enum-bounds-check-derived-idx.rs | 0 .../enum/enum-bounds-check-issue-13926.rs | 0 .../enum/enum-bounds-check-issue-82871.rs | 0 .../enum/enum-bounds-check.rs | 0 .../enum/enum-debug-clike.rs | 0 .../enum/enum-debug-niche-2.rs | 0 .../enum/enum-debug-niche.rs | 0 .../enum/enum-debug-tagged.rs | 0 .../enum/enum-discriminant-eq.rs | 0 .../enum/enum-discriminant-value.rs | 0 .../enum/enum-early-otherwise-branch.rs | 0 .../enum/enum-match.rs | 0 .../enum/enum-two-variants-match.rs | 0 .../enum/enum-u128.rs | 0 .../enum/unreachable_enum_default_branch.rs | 0 .../ergonomic-clones/closure.rs | 0 .../{codegen => codegen-llvm}/error-provide.rs | 0 .../export-no-mangle.rs | 0 .../external-no-mangle-fns.rs | 0 .../external-no-mangle-statics.rs | 0 .../f128-wasm32-callconv.rs | 0 .../fastcall-inreg.rs | 0 tests/{codegen => codegen-llvm}/fatptr.rs | 0 tests/{codegen => codegen-llvm}/fewer-names.rs | 0 tests/{codegen => codegen-llvm}/fixed-x18.rs | 0 .../float/algebraic.rs | 0 tests/{codegen => codegen-llvm}/float/f128.rs | 0 .../float/f16-f128-inline.rs | 0 tests/{codegen => codegen-llvm}/float/f16.rs | 0 tests/{codegen => codegen-llvm}/float_math.rs | 0 .../fn-impl-trait-self.rs | 0 ...-parameters-on-different-lines-debuginfo.rs | 0 .../force-frame-pointers.rs | 0 .../force-no-unwind-tables.rs | 0 .../force-unwind-tables.rs | 0 .../frame-pointer-cli-control.rs | 0 .../{codegen => codegen-llvm}/frame-pointer.rs | 0 .../function-arguments-noopt.rs | 0 .../function-arguments.rs | 0 .../function-return.rs | 0 .../gdb_debug_script_load.rs | 0 .../{codegen => codegen-llvm}/generic-debug.rs | 0 tests/{codegen => codegen-llvm}/gep-index.rs | 0 .../gpu-kernel-abi.rs | 0 .../gpu_offload/gpu_host.rs | 0 .../hint/cold_path.rs | 0 tests/{codegen => codegen-llvm}/hint/likely.rs | 0 .../{codegen => codegen-llvm}/hint/unlikely.rs | 0 .../i128-wasm32-callconv.rs | 0 .../i128-x86-align.rs | 0 .../i128-x86-callconv.rs | 0 .../infallible-unwrap-in-opt-z.rs | 0 .../inherit_overflow.rs | 0 .../inline-always-works-always.rs | 0 .../inline-debuginfo.rs | 0 .../inline-function-args-debug-info.rs | 0 tests/{codegen => codegen-llvm}/inline-hint.rs | 0 .../instrument-coverage-off.rs | 0 .../instrument-coverage/instrument-coverage.rs | 0 .../instrument-coverage/testprog.rs | 0 .../instrument-mcount.rs | 0 .../instrument-xray/basic.rs | 0 .../instrument-xray/options-combine.rs | 0 .../instrument-xray/options-override.rs | 0 tests/{codegen => codegen-llvm}/integer-cmp.rs | 0 .../integer-overflow.rs | 0 .../internalize-closures.rs | 0 .../intrinsic-no-unnamed-attr.rs | 0 .../intrinsics/aggregate-thin-pointer.rs | 0 .../intrinsics/carrying_mul_add.rs | 0 .../intrinsics/cold_path.rs | 0 .../intrinsics/cold_path2.rs | 0 .../intrinsics/cold_path3.rs | 0 .../intrinsics/compare_bytes.rs | 0 .../intrinsics/const_eval_select.rs | 0 .../intrinsics/ctlz.rs | 0 .../intrinsics/ctpop.rs | 0 .../intrinsics/disjoint_bitor.rs | 0 .../intrinsics/exact_div.rs | 0 .../intrinsics/likely.rs | 0 .../intrinsics/likely_assert.rs | 0 .../intrinsics/mask.rs | 0 .../intrinsics/nontemporal.rs | 0 .../intrinsics/offset.rs | 0 .../intrinsics/offset_from.rs | 0 .../intrinsics/prefetch.rs | 0 .../intrinsics/ptr_metadata.rs | 0 .../intrinsics/rotate_left.rs | 0 .../rustc_intrinsic_must_be_overridden.rs | 0 .../intrinsics/select_unpredictable.rs | 0 .../intrinsics/three_way_compare.rs | 0 .../intrinsics/transmute-niched.rs | 0 .../intrinsics/transmute-x64.rs | 0 .../intrinsics/transmute.rs | 0 .../intrinsics/typed_swap.rs | 0 .../intrinsics/unchecked_math.rs | 0 .../intrinsics/unlikely.rs | 0 .../intrinsics/volatile.rs | 0 .../intrinsics/volatile_order.rs | 0 .../is_val_statically_known.rs | 0 tests/{codegen => codegen-llvm}/issue-97217.rs | 0 .../issues/issue-101048.rs | 0 .../issues/issue-101082.rs | 0 .../issues/issue-101814.rs | 0 .../issues/issue-103132.rs | 0 .../issue-103285-ptr-addr-overflow-check.rs | 0 .../issues/issue-103327.rs | 0 .../issues/issue-103840.rs | 0 .../issues/issue-105386-ub-in-debuginfo.rs | 0 .../issues/issue-106369.rs | 0 .../issues/issue-107681-unwrap_unchecked.rs | 0 .../issues/issue-108395-branchy-bool-match.rs | 0 .../issues/issue-109328-split_first.rs | 0 .../issues/issue-110797-enum-jump-same.rs | 0 .../issues/issue-111603.rs | 0 .../issue-112509-slice-get-andthen-get.rs | 0 .../issue-113757-bounds-check-after-cmp-max.rs | 0 .../issues/issue-114312.rs | 0 .../issues/issue-115385-llvm-jump-threading.rs | 0 .../issues/issue-116878.rs | 0 .../issues/issue-118306.rs | 0 .../issues/issue-118392.rs | 0 .../issues/issue-119422.rs | 0 .../issues/issue-121719-common-field-offset.rs | 0 .../issue-122600-ptr-discriminant-update.rs | 0 ...ue-123712-str-to-lower-autovectorization.rs | 0 .../issues/issue-126585.rs | 0 .../issues/issue-129795.rs | 0 .../issues/issue-13018.rs | 0 .../issues/issue-136329-optnone-noinline.rs | 0 .../issues/issue-15953.rs | 0 .../issues/issue-27130.rs | 0 .../issues/issue-32031.rs | 0 .../issues/issue-32364.rs | 0 .../issues/issue-34634.rs | 0 .../issues/issue-34947-pow-i32.rs | 0 .../issues/issue-36010-some-box-is_some.rs | 0 .../issues/issue-37945.rs | 0 .../issues/issue-45222.rs | 0 .../issues/issue-45466.rs | 0 .../issue-45964-bounds-check-slice-pos.rs | 0 .../issues/issue-47278.rs | 0 .../issues/issue-47442.rs | 0 .../issues/issue-56267-2.rs | 0 .../issues/issue-56267.rs | 0 .../issues/issue-56927.rs | 0 .../issues/issue-58881.rs | 0 .../issues/issue-59352.rs | 0 ...-fn-ptr-call-returning-never-is-noreturn.rs | 0 .../issues/issue-68667-unwrap-combinators.rs | 0 .../issues/issue-69101-bounds-check.rs | 0 .../issues/issue-73031.rs | 0 .../issues/issue-73258.rs | 0 .../issues/issue-73338-effecient-cmp.rs | 0 .../issue-73396-bounds-check-after-position.rs | 0 ...ssue-73827-bounds-check-index-in-subexpr.rs | 0 .../issues/issue-74938-array-split-at.rs | 0 .../issues/issue-75525-bounds-checks.rs | 0 .../issues/issue-75546.rs | 0 .../issues/issue-75659.rs | 0 .../issues/issue-75978.rs | 0 .../issues/issue-77812.rs | 0 .../issues/issue-84268.rs | 0 .../issues/issue-85872-multiple-reverse.rs | 0 .../issues/issue-86106.rs | 0 .../issue-86109-eliminate-div-by-zero-check.rs | 0 .../issues/issue-93036-assert-index.rs | 0 .../issues/issue-96274.rs | 0 .../issues/issue-96497-slice-size-nowrap.rs | 0 .../issue-98294-get-mut-copy-from-slice-opt.rs | 0 .../issues/issue-98678-async.rs | 0 .../issues/issue-98678-closure-coroutine.rs | 0 .../issues/issue-98678-enum.rs | 0 .../issues/issue-98678-struct-union.rs | 0 .../issues/issue-99960.rs | 0 .../issues/looping-over-ne-bytes-133528.rs | 0 .../issues/str-to-string-128690.rs | 0 .../iter-repeat-n-trivial-drop.rs | 0 .../layout-size-checks.rs | 0 .../lib-optimizations/iter-sum.rs | 0 .../lib-optimizations/slice_rotate.rs | 0 .../lifetime_start_end.rs | 0 .../link-dead-code.rs | 0 .../{codegen => codegen-llvm}/link_section.rs | 0 tests/{codegen => codegen-llvm}/llvm-ident.rs | 0 .../llvm_module_flags.rs | 0 tests/{codegen => codegen-llvm}/loads.rs | 0 .../local-generics-in-exe-internalized.rs | 0 .../loongarch-abi/call-llvm-intrinsics.rs | 0 .../loongarch-abi/loongarch64-lp64d-abi.rs | 0 .../lto-removes-invokes.rs | 0 .../macos/i686-macosx-deployment-target.rs | 0 .../macos/i686-no-macosx-deployment-target.rs | 0 .../macos/x86_64-macosx-deployment-target.rs | 0 .../x86_64-no-macosx-deployment-target.rs | 0 .../mainsubprogram.rs | 0 .../match-optimized.rs | 0 .../match-optimizes-away.rs | 0 .../match-unoptimized.rs | 0 .../maybeuninit-rvo.rs | 0 .../mem-replace-big-type.rs | 0 .../mem-replace-simple-type.rs | 0 .../merge-functions.rs | 0 .../meta-filecheck/check-prefix.rs | 0 .../meta-filecheck/filecheck-flags.rs | 0 .../meta-filecheck/msvc-prefix-bad.rs | 0 .../meta-filecheck/no-directives.rs | 0 .../meta-filecheck/revision-prefix.rs | 0 .../method-declaration.rs | 0 .../min-function-alignment.rs | 0 .../mir-aggregate-no-alloca.rs | 0 .../mir-inlined-line-numbers.rs | 0 .../mir_zst_stores.rs | 0 .../move-before-nocapture-ref-arg.rs | 0 .../{codegen => codegen-llvm}/move-operands.rs | 0 tests/{codegen => codegen-llvm}/naked-asan.rs | 0 .../naked-fn/aligned.rs | 0 .../naked-fn/generics.rs | 0 .../naked-fn/instruction-set.rs | 0 .../naked-fn/min-function-alignment.rs | 0 .../naked-fn/naked-functions.rs | 0 .../no-alloca-inside-if-false.rs | 0 .../no-assumes-on-casts.rs | 0 .../no-dllimport-w-cross-lang-lto.rs | 0 .../no-jump-tables.rs | 0 tests/{codegen => codegen-llvm}/no-plt.rs | 0 .../no-redundant-item-monomorphization.rs | 0 .../no_builtins-at-crate.rs | 0 .../noalias-box-off.rs | 0 tests/{codegen => codegen-llvm}/noalias-box.rs | 0 .../{codegen => codegen-llvm}/noalias-flag.rs | 0 .../noalias-freeze.rs | 0 .../noalias-refcell.rs | 0 .../noalias-rwlockreadguard.rs | 0 .../{codegen => codegen-llvm}/noalias-unpin.rs | 0 .../non-terminate/infinite-loop-1.rs | 0 .../non-terminate/infinite-loop-2.rs | 0 .../non-terminate/infinite-recursion.rs | 0 .../non-terminate/nonempty-infinite-loop.rs | 0 .../noreturn-uninhabited.rs | 0 .../{codegen => codegen-llvm}/noreturnflag.rs | 0 tests/{codegen => codegen-llvm}/nounwind.rs | 0 tests/{codegen => codegen-llvm}/nrvo.rs | 0 .../optimize-attr-1.rs | 0 .../option-as-slice.rs | 0 .../option-niche-eq.rs | 0 .../option-niche-unfixed/option-nonzero-eq.rs | 0 .../overaligned-constant.rs | 0 tests/{codegen => codegen-llvm}/packed.rs | 0 .../panic-abort-windows.rs | 0 .../panic-in-drop-abort.rs | 0 .../panic-unwind-default-uwtable.rs | 0 .../patchable-function-entry-both-flags.rs | 0 .../patchable-function-entry-no-flag.rs | 0 .../patchable-function-entry-one-flag.rs | 0 .../pattern_type_symbols.rs | 0 .../personality_lifetimes.rs | 0 .../pgo-counter-bias.rs | 0 .../pgo-instrumentation.rs | 0 .../pic-relocation-model.rs | 0 .../pie-relocation-model.rs | 0 .../{codegen => codegen-llvm}/placement-new.rs | 0 .../powerpc64le-struct-align-128.rs | 0 .../precondition-checks.rs | 0 .../ptr-arithmetic.rs | 0 .../ptr-read-metadata.rs | 0 .../range-attribute.rs | 0 tests/{codegen => codegen-llvm}/range-loop.rs | 0 .../range_to_inclusive.rs | 0 tests/{codegen => codegen-llvm}/refs.rs | 0 .../reg-struct-return.rs | 0 .../{codegen => codegen-llvm}/regparm-inreg.rs | 0 .../remap_path_prefix/aux_mod.rs | 0 .../auxiliary/remap_path_prefix_aux.rs | 0 .../auxiliary/xcrate-generic.rs | 0 .../remap_path_prefix/issue-73167-remap-std.rs | 0 .../remap_path_prefix/main.rs | 0 .../remap_path_prefix/xcrate-generic.rs | 0 .../repeat-operand-zero-len.rs | 0 .../repeat-operand-zst-elem.rs | 0 .../repeat-trusted-len.rs | 0 .../repr/transparent-byval-struct-ptr.rs | 0 .../repr/transparent-imm-array.rs | 0 .../repr/transparent-mips64.rs | 0 .../repr/transparent-opaque-ptr.rs | 0 .../repr/transparent-sparc64.rs | 0 .../repr/transparent-sysv64.rs | 0 .../repr/transparent.rs | 0 tests/{codegen => codegen-llvm}/retpoline.rs | 0 .../riscv-abi/call-llvm-intrinsics.rs | 0 .../riscv-abi/cast-local-large-enough.rs | 0 .../riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs | 0 .../riscv-abi/riscv64-lp64d-abi.rs | 0 .../riscv-abi/riscv64-lp64f-lp64d-abi.rs | 0 .../riscv-target-abi.rs | 0 .../rust-abi-arch-specific-adjustment.rs | 0 tests/{codegen => codegen-llvm}/s390x-simd.rs | 0 ...aarch64-shadow-call-stack-with-fixed-x18.rs | 0 .../address-sanitizer-globals-tracking.rs | 0 .../cfi/add-canonical-jump-tables-flag.rs | 0 .../cfi/add-cfi-normalize-integers-flag.rs | 0 .../cfi/add-enable-split-lto-unit-flag.rs | 0 .../cfi/dbg-location-on-cfi-blocks.rs | 0 .../cfi/emit-type-checks-attr-no-sanitize.rs | 0 .../sanitizer/cfi/emit-type-checks.rs | 0 .../emit-type-metadata-attr-cfi-encoding.rs | 0 ...tadata-id-itanium-cxx-abi-const-generics.rs | 0 ...etadata-id-itanium-cxx-abi-drop-in-place.rs | 0 ...tadata-id-itanium-cxx-abi-function-types.rs | 0 ...pe-metadata-id-itanium-cxx-abi-lifetimes.rs | 0 ...-itanium-cxx-abi-method-secondary-typeid.rs | 0 ...t-type-metadata-id-itanium-cxx-abi-paths.rs | 0 ...etadata-id-itanium-cxx-abi-pointer-types.rs | 0 ...adata-id-itanium-cxx-abi-primitive-types.rs | 0 ...d-itanium-cxx-abi-repr-transparent-types.rs | 0 ...tadata-id-itanium-cxx-abi-sequence-types.rs | 0 ...-metadata-id-itanium-cxx-abi-trait-types.rs | 0 ...ta-id-itanium-cxx-abi-user-defined-types.rs | 0 ...ype-metadata-itanium-cxx-abi-generalized.rs | 0 ...a-itanium-cxx-abi-normalized-generalized.rs | 0 ...type-metadata-itanium-cxx-abi-normalized.rs | 0 .../cfi/emit-type-metadata-itanium-cxx-abi.rs | 0 .../cfi/emit-type-metadata-trait-objects.rs | 0 .../sanitizer/cfi/external_weak_symbols.rs | 0 .../sanitizer/cfi/generalize-pointers.rs | 0 .../sanitizer/cfi/normalize-integers.rs | 0 .../sanitizer/dataflow-instrument-functions.rs | 0 .../sanitizer/kasan-emits-instrumentation.rs | 0 .../kcfi/add-cfi-normalize-integers-flag.rs | 0 .../sanitizer/kcfi/add-kcfi-arity-flag.rs | 0 .../sanitizer/kcfi/add-kcfi-flag.rs | 0 .../sanitizer/kcfi/add-kcfi-offset-flag.rs | 0 ...mit-kcfi-operand-bundle-attr-no-sanitize.rs | 0 ...erand-bundle-itanium-cxx-abi-generalized.rs | 0 ...e-itanium-cxx-abi-normalized-generalized.rs | 0 ...perand-bundle-itanium-cxx-abi-normalized.rs | 0 ...emit-kcfi-operand-bundle-itanium-cxx-abi.rs | 0 .../sanitizer/kcfi/emit-kcfi-operand-bundle.rs | 0 .../kcfi/emit-type-metadata-trait-objects.rs | 0 .../sanitizer/kcfi/naked-function.rs | 0 .../sanitizer/memory-track-origins.rs | 0 .../sanitizer/memtag-attr-check.rs | 0 .../sanitizer/no-sanitize-inlining.rs | 0 .../sanitizer/no-sanitize.rs | 0 .../sanitizer/riscv64-shadow-call-stack.rs | 0 .../sanitizer/safestack-attr-check.rs | 0 .../sanitizer/sanitizer-recover.rs | 0 .../sanitizer/scs-attr-check.rs | 0 .../scalar-pair-bool.rs | 0 .../set-discriminant-invalid.rs | 0 .../simd-intrinsic/simd-intrinsic-float-abs.rs | 0 .../simd-intrinsic-float-ceil.rs | 0 .../simd-intrinsic/simd-intrinsic-float-cos.rs | 0 .../simd-intrinsic/simd-intrinsic-float-exp.rs | 0 .../simd-intrinsic-float-exp2.rs | 0 .../simd-intrinsic-float-floor.rs | 0 .../simd-intrinsic/simd-intrinsic-float-fma.rs | 0 .../simd-intrinsic-float-fsqrt.rs | 0 .../simd-intrinsic/simd-intrinsic-float-log.rs | 0 .../simd-intrinsic-float-log10.rs | 0 .../simd-intrinsic-float-log2.rs | 0 .../simd-intrinsic-float-minmax.rs | 0 .../simd-intrinsic/simd-intrinsic-float-sin.rs | 0 ...-intrinsic-generic-arithmetic-saturating.rs | 0 .../simd-intrinsic-generic-bitmask.rs | 0 .../simd-intrinsic-generic-gather.rs | 0 .../simd-intrinsic-generic-masked-load.rs | 0 .../simd-intrinsic-generic-masked-store.rs | 0 .../simd-intrinsic-generic-scatter.rs | 0 .../simd-intrinsic-generic-select.rs | 0 .../simd-intrinsic-mask-reduce.rs | 0 .../simd-intrinsic-transmute-array.rs | 0 .../simd/aggregate-simd.rs | 0 .../simd/extract-insert-dyn.rs | 0 .../simd/packed-simd-alignment.rs | 0 .../simd/packed-simd.rs | 0 .../simd/simd-wide-sum.rs | 0 .../simd/simd_arith_offset.rs | 0 .../simd/swap-simd-types.rs | 0 .../simd/unpadded-simd.rs | 0 .../skip-mono-inside-if-false.rs | 0 .../slice-as_chunks.rs | 0 .../slice-indexing.rs | 0 tests/{codegen => codegen-llvm}/slice-init.rs | 0 .../slice-is-ascii.rs | 0 .../slice-iter-fold.rs | 0 .../slice-iter-len-eq-zero.rs | 0 .../slice-iter-nonnull.rs | 0 .../slice-last-elements-optimization.rs | 0 .../slice-pointer-nonnull-unwrap.rs | 0 .../slice-position-bounds-check.rs | 0 .../slice-ref-equality.rs | 0 .../{codegen => codegen-llvm}/slice-reverse.rs | 0 .../slice-split-at.rs | 0 .../slice-windows-no-bounds-check.rs | 0 .../slice_as_from_ptr_range.rs | 0 .../some-abis-do-extend-params-to-32-bits.rs | 0 .../some-global-nonnull.rs | 0 .../sparc-struct-abi.rs | 0 .../split-lto-unit.rs | 0 .../src-hash-algorithm-md5.rs | 0 .../src-hash-algorithm-sha1.rs | 0 .../src-hash-algorithm-sha256.rs | 0 .../sroa-fragment-debuginfo.rs | 0 .../sse42-implies-crc32.rs | 0 .../stack-probes-inline.rs | 0 .../stack-protector.rs | 0 .../static-relocation-model-msvc.rs | 0 .../staticlib-external-inline-fns.rs | 0 .../step_by-overflow-checks.rs | 0 tests/{codegen => codegen-llvm}/stores.rs | 0 tests/{codegen => codegen-llvm}/string-push.rs | 0 .../swap-large-types.rs | 0 .../swap-small-types.rs | 0 .../target-cpu-on-functions.rs | 0 .../target-feature-inline-closure.rs | 0 .../target-feature-negative-implication.rs | 0 .../target-feature-overrides.rs | 0 .../terminating-catchpad.rs | 0 .../{codegen => codegen-llvm}/thread-local.rs | 0 .../tied-features-strength.rs | 0 tests/{codegen => codegen-llvm}/to_vec.rs | 0 .../trailing_zeros.rs | 0 .../transmute-optimized.rs | 0 .../transmute-scalar.rs | 0 .../try_question_mark_nop.rs | 0 .../tune-cpu-on-functions.rs | 0 .../tuple-layout-opt.rs | 0 tests/{codegen => codegen-llvm}/ub-checks.rs | 0 .../unchecked-float-casts.rs | 0 .../unchecked_shifts.rs | 0 .../uninhabited-transparent-return-abi.rs | 0 .../{codegen => codegen-llvm}/uninit-consts.rs | 0 .../uninit-repeat-in-aggregate.rs | 0 tests/{codegen => codegen-llvm}/union-abi.rs | 0 .../union-aggregate.rs | 0 .../unwind-abis/aapcs-unwind-abi.rs | 0 .../unwind-abis/c-unwind-abi-panic-abort.rs | 0 .../unwind-abis/c-unwind-abi.rs | 0 .../unwind-abis/cdecl-unwind-abi.rs | 0 .../unwind-abis/fastcall-unwind-abi.rs | 0 .../nounwind-on-stable-panic-abort.rs | 0 .../unwind-abis/nounwind.rs | 0 .../unwind-abis/stdcall-unwind-abi.rs | 0 .../unwind-abis/system-unwind-abi.rs | 0 .../unwind-abis/sysv64-unwind-abi.rs | 0 .../unwind-abis/thiscall-unwind-abi.rs | 0 .../unwind-abis/vectorcall-unwind-abi.rs | 0 .../unwind-abis/win64-unwind-abi.rs | 0 .../unwind-and-panic-abort.rs | 0 .../unwind-extern-exports.rs | 0 .../unwind-extern-imports.rs | 0 .../unwind-landingpad-cold.rs | 0 .../unwind-landingpad-inline.rs | 0 .../{codegen => codegen-llvm}/used_with_arg.rs | 0 tests/{codegen => codegen-llvm}/var-names.rs | 0 tests/{codegen => codegen-llvm}/vec-as-ptr.rs | 0 tests/{codegen => codegen-llvm}/vec-calloc.rs | 0 .../{codegen => codegen-llvm}/vec-in-place.rs | 0 .../vec-iter-collect-len.rs | 0 tests/{codegen => codegen-llvm}/vec-iter.rs | 0 .../vec-len-invariant.rs | 0 .../vec-optimizes-away.rs | 0 .../vec-reserve-extend.rs | 0 .../vec-shrink-panik.rs | 0 .../vec-with-capacity.rs | 0 .../vec_pop_push_noop.rs | 0 .../vecdeque-drain.rs | 0 .../vecdeque-nonempty-get-no-panic.rs | 0 .../vecdeque_no_panic.rs | 0 .../vecdeque_pop_push.rs | 0 .../virtual-call-attrs-issue-137646.rs | 0 .../virtual-function-elimination-32bit.rs | 0 .../virtual-function-elimination.rs | 0 .../{codegen => codegen-llvm}/vtable-loads.rs | 0 .../{codegen => codegen-llvm}/vtable-upcast.rs | 0 .../wasm_casts_trapping.rs | 0 .../wasm_exceptions.rs | 0 tests/{codegen => codegen-llvm}/zip.rs | 0 tests/{codegen => codegen-llvm}/zst-offset.rs | 0 tests/run-make/llvm-ident/rmake.rs | 2 +- tests/ui/abi/fixed_x18.rs | 2 +- triagebot.toml | 18 +++++++++--------- 676 files changed, 41 insertions(+), 36 deletions(-) rename tests/{codegen => codegen-llvm}/README.md (100%) rename tests/{codegen => codegen-llvm}/aarch64-softfloat.rs (100%) rename tests/{codegen => codegen-llvm}/aarch64-struct-align-128.rs (100%) rename tests/{codegen => codegen-llvm}/abi-efiapi.rs (100%) rename tests/{codegen => codegen-llvm}/abi-main-signature-16bit-c-int.rs (100%) rename tests/{codegen => codegen-llvm}/abi-main-signature-32bit-c-int.rs (100%) rename tests/{codegen => codegen-llvm}/abi-repr-ext.rs (100%) rename tests/{codegen => codegen-llvm}/abi-sysv64.rs (100%) rename tests/{codegen => codegen-llvm}/abi-win64-zst.rs (100%) rename tests/{codegen => codegen-llvm}/abi-x86-interrupt.rs (100%) rename tests/{codegen => codegen-llvm}/abi-x86-sse.rs (100%) rename tests/{codegen => codegen-llvm}/abi-x86_64_sysv.rs (100%) rename tests/{codegen => codegen-llvm}/addr-of-mutate.rs (100%) rename tests/{codegen => codegen-llvm}/adjustments.rs (100%) rename tests/{codegen => codegen-llvm}/align-byval-alignment-mismatch.rs (100%) rename tests/{codegen => codegen-llvm}/align-byval-vector.rs (100%) rename tests/{codegen => codegen-llvm}/align-byval.rs (100%) rename tests/{codegen => codegen-llvm}/align-enum.rs (100%) rename tests/{codegen => codegen-llvm}/align-fn.rs (100%) rename tests/{codegen => codegen-llvm}/align-offset.rs (100%) rename tests/{codegen => codegen-llvm}/align-struct.rs (100%) rename tests/{codegen => codegen-llvm}/alloc-optimisation.rs (100%) rename tests/{codegen => codegen-llvm}/amdgpu-addrspacecast.rs (100%) rename tests/{codegen => codegen-llvm}/array-clone.rs (100%) rename tests/{codegen => codegen-llvm}/array-cmp.rs (100%) rename tests/{codegen => codegen-llvm}/array-codegen.rs (100%) rename tests/{codegen => codegen-llvm}/array-equality.rs (100%) rename tests/{codegen => codegen-llvm}/array-from_fn.rs (100%) rename tests/{codegen => codegen-llvm}/array-map.rs (100%) rename tests/{codegen => codegen-llvm}/array-optimized.rs (100%) rename tests/{codegen => codegen-llvm}/array-repeat.rs (100%) rename tests/{codegen => codegen-llvm}/ascii-char.rs (100%) rename tests/{codegen => codegen-llvm}/asm/aarch64-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/avr-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/bpf-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/critical.rs (100%) rename tests/{codegen => codegen-llvm}/asm/csky-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/foo.s (100%) rename tests/{codegen => codegen-llvm}/asm/global_asm.rs (100%) rename tests/{codegen => codegen-llvm}/asm/global_asm_include.rs (100%) rename tests/{codegen => codegen-llvm}/asm/global_asm_x2.rs (100%) rename tests/{codegen => codegen-llvm}/asm/goto.rs (100%) rename tests/{codegen => codegen-llvm}/asm/hexagon-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/may_unwind.rs (100%) rename tests/{codegen => codegen-llvm}/asm/maybe-uninit.rs (100%) rename tests/{codegen => codegen-llvm}/asm/msp430-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/multiple-options.rs (100%) rename tests/{codegen => codegen-llvm}/asm/options.rs (100%) rename tests/{codegen => codegen-llvm}/asm/powerpc-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/riscv-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/s390x-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/sanitize-llvm.rs (100%) rename tests/{codegen => codegen-llvm}/asm/sparc-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/x86-clobber_abi.rs (100%) rename tests/{codegen => codegen-llvm}/asm/x86-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/asm/x86-target-clobbers.rs (100%) rename tests/{codegen => codegen-llvm}/assign-desugar-debuginfo.rs (100%) rename tests/{codegen => codegen-llvm}/async-closure-debug.rs (100%) rename tests/{codegen => codegen-llvm}/async-fn-debug-awaitee-field.rs (100%) rename tests/{codegen => codegen-llvm}/async-fn-debug-msvc.rs (100%) rename tests/{codegen => codegen-llvm}/async-fn-debug.rs (100%) rename tests/{codegen => codegen-llvm}/atomic-operations.rs (100%) rename tests/{codegen => codegen-llvm}/atomicptr.rs (100%) rename tests/{codegen => codegen-llvm}/autodiff/batched.rs (100%) rename tests/{codegen => codegen-llvm}/autodiff/generic.rs (100%) rename tests/{codegen => codegen-llvm}/autodiff/identical_fnc.rs (100%) rename tests/{codegen => codegen-llvm}/autodiff/inline.rs (100%) rename tests/{codegen => codegen-llvm}/autodiff/scalar.rs (100%) rename tests/{codegen => codegen-llvm}/autodiff/sret.rs (100%) rename tests/{codegen => codegen-llvm}/autodiffv2.rs (100%) rename tests/{codegen => codegen-llvm}/autovec/dont-shuffle-bswaps-opt2.rs (100%) rename tests/{codegen => codegen-llvm}/autovec/dont-shuffle-bswaps-opt3.rs (100%) rename tests/{codegen => codegen-llvm}/autovectorize-f32x4.rs (100%) rename tests/{codegen => codegen-llvm}/auxiliary/extern_decl.rs (100%) rename tests/{codegen => codegen-llvm}/auxiliary/nounwind.rs (100%) rename tests/{codegen => codegen-llvm}/auxiliary/thread_local_aux.rs (100%) rename tests/{codegen => codegen-llvm}/avr/avr-func-addrspace.rs (100%) rename tests/{codegen => codegen-llvm}/bigint-helpers.rs (100%) rename tests/{codegen => codegen-llvm}/binary-heap-peek-mut-pop-no-panic.rs (100%) rename tests/{codegen => codegen-llvm}/binary-search-index-no-bound-check.rs (100%) rename tests/{codegen => codegen-llvm}/bool-cmp.rs (100%) rename tests/{codegen => codegen-llvm}/bounds-checking/gep-issue-133979.rs (100%) rename tests/{codegen => codegen-llvm}/box-default-debug-copies.rs (100%) rename tests/{codegen => codegen-llvm}/box-uninit-bytes.rs (100%) rename tests/{codegen => codegen-llvm}/bpf-alu32.rs (100%) rename tests/{codegen => codegen-llvm}/branch-protection.rs (100%) rename tests/{codegen => codegen-llvm}/call-llvm-intrinsics.rs (100%) rename tests/{codegen => codegen-llvm}/call-tmps-lifetime.rs (100%) rename tests/{codegen => codegen-llvm}/cast-optimized.rs (100%) rename tests/{codegen => codegen-llvm}/cast-target-abi.rs (100%) rename tests/{codegen => codegen-llvm}/catch-unwind.rs (100%) rename tests/{codegen => codegen-llvm}/cdylib-external-inline-fns.rs (100%) rename tests/{codegen => codegen-llvm}/cf-protection.rs (100%) rename tests/{codegen => codegen-llvm}/cffi/c-variadic-copy.rs (100%) rename tests/{codegen => codegen-llvm}/cffi/c-variadic-naked.rs (100%) rename tests/{codegen => codegen-llvm}/cffi/c-variadic-opt.rs (100%) rename tests/{codegen => codegen-llvm}/cffi/c-variadic.rs (100%) rename tests/{codegen => codegen-llvm}/cffi/ffi-const.rs (100%) rename tests/{codegen => codegen-llvm}/cffi/ffi-out-of-bounds-loads.rs (100%) rename tests/{codegen => codegen-llvm}/cffi/ffi-pure.rs (100%) rename tests/{codegen => codegen-llvm}/cfguard-checks.rs (100%) rename tests/{codegen => codegen-llvm}/cfguard-disabled.rs (100%) rename tests/{codegen => codegen-llvm}/cfguard-nochecks.rs (100%) rename tests/{codegen => codegen-llvm}/cfguard-non-msvc.rs (100%) rename tests/{codegen => codegen-llvm}/char-ascii-branchless.rs (100%) rename tests/{codegen => codegen-llvm}/char-escape-debug-no-bounds-check.rs (100%) rename tests/{codegen => codegen-llvm}/checked_ilog.rs (100%) rename tests/{codegen => codegen-llvm}/checked_math.rs (100%) rename tests/{codegen => codegen-llvm}/clone-shims.rs (100%) rename tests/{codegen => codegen-llvm}/clone_as_copy.rs (100%) rename tests/{codegen => codegen-llvm}/codemodels.rs (100%) rename tests/{codegen => codegen-llvm}/coercions.rs (100%) rename tests/{codegen => codegen-llvm}/cold-call-declare-and-call.rs (100%) rename tests/{codegen => codegen-llvm}/common_prim_int_ptr.rs (100%) rename tests/{codegen => codegen-llvm}/comparison-operators-2-struct.rs (100%) rename tests/{codegen => codegen-llvm}/comparison-operators-2-tuple.rs (100%) rename tests/{codegen => codegen-llvm}/comparison-operators-newtype.rs (100%) rename tests/{codegen => codegen-llvm}/compiletest-self-test/minicore-smoke-test.rs (100%) rename tests/{codegen => codegen-llvm}/const-array.rs (100%) rename tests/{codegen => codegen-llvm}/const-vector.rs (100%) rename tests/{codegen => codegen-llvm}/const_scalar_pair.rs (100%) rename tests/{codegen => codegen-llvm}/constant-branch.rs (100%) rename tests/{codegen => codegen-llvm}/consts.rs (100%) rename tests/{codegen => codegen-llvm}/coroutine-debug-msvc.rs (100%) rename tests/{codegen => codegen-llvm}/coroutine-debug.rs (100%) rename tests/{codegen => codegen-llvm}/cross-crate-inlining/always-inline.rs (100%) rename tests/{codegen => codegen-llvm}/cross-crate-inlining/auxiliary/always.rs (100%) rename tests/{codegen => codegen-llvm}/cross-crate-inlining/auxiliary/leaf.rs (100%) rename tests/{codegen => codegen-llvm}/cross-crate-inlining/auxiliary/never.rs (100%) rename tests/{codegen => codegen-llvm}/cross-crate-inlining/leaf-inlining.rs (100%) rename tests/{codegen => codegen-llvm}/cross-crate-inlining/never-inline.rs (100%) rename tests/{codegen => codegen-llvm}/dealloc-no-unwind.rs (100%) rename tests/{codegen => codegen-llvm}/debug-accessibility/crate-enum.rs (100%) rename tests/{codegen => codegen-llvm}/debug-accessibility/crate-struct.rs (100%) rename tests/{codegen => codegen-llvm}/debug-accessibility/private-enum.rs (100%) rename tests/{codegen => codegen-llvm}/debug-accessibility/private-struct.rs (100%) rename tests/{codegen => codegen-llvm}/debug-accessibility/public-enum.rs (100%) rename tests/{codegen => codegen-llvm}/debug-accessibility/public-struct.rs (100%) rename tests/{codegen => codegen-llvm}/debug-accessibility/struct-fields.rs (100%) rename tests/{codegen => codegen-llvm}/debug-accessibility/super-enum.rs (100%) rename tests/{codegen => codegen-llvm}/debug-accessibility/super-struct.rs (100%) rename tests/{codegen => codegen-llvm}/debug-accessibility/tuple-fields.rs (100%) rename tests/{codegen => codegen-llvm}/debug-alignment.rs (100%) rename tests/{codegen => codegen-llvm}/debug-column-msvc.rs (100%) rename tests/{codegen => codegen-llvm}/debug-column.rs (100%) rename tests/{codegen => codegen-llvm}/debug-compile-unit-path.rs (100%) rename tests/{codegen => codegen-llvm}/debug-fndef-size.rs (100%) rename tests/{codegen => codegen-llvm}/debug-limited.rs (100%) rename tests/{codegen => codegen-llvm}/debug-line-directives-only.rs (100%) rename tests/{codegen => codegen-llvm}/debug-line-tables-only.rs (100%) rename tests/{codegen => codegen-llvm}/debug-linkage-name.rs (100%) rename tests/{codegen => codegen-llvm}/debug-vtable.rs (100%) rename tests/{codegen => codegen-llvm}/debuginfo-constant-locals.rs (100%) rename tests/{codegen => codegen-llvm}/debuginfo-generic-closure-env-names.rs (100%) rename tests/{codegen => codegen-llvm}/debuginfo-inline-callsite-location.rs (100%) rename tests/{codegen => codegen-llvm}/debuginfo-proc-macro/auxiliary/macro_def.rs (100%) rename tests/{codegen => codegen-llvm}/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs (100%) rename tests/{codegen => codegen-llvm}/deduced-param-attrs.rs (100%) rename tests/{codegen => codegen-llvm}/default-requires-uwtable.rs (100%) rename tests/{codegen => codegen-llvm}/default-visibility.rs (100%) rename tests/{codegen => codegen-llvm}/direct-access-external-data.rs (100%) rename tests/{codegen => codegen-llvm}/dllimports/auxiliary/dummy.rs (100%) rename tests/{codegen => codegen-llvm}/dllimports/auxiliary/wrapper.rs (100%) rename tests/{codegen => codegen-llvm}/dllimports/main.rs (100%) rename tests/{codegen => codegen-llvm}/dont_codegen_private_const_fn_only_used_in_const_eval.rs (100%) rename tests/{codegen => codegen-llvm}/drop-in-place-noalias.rs (100%) rename tests/{codegen => codegen-llvm}/drop.rs (100%) rename tests/{codegen => codegen-llvm}/dst-offset.rs (100%) rename tests/{codegen => codegen-llvm}/dst-vtable-align-nonzero.rs (100%) rename tests/{codegen => codegen-llvm}/dst-vtable-size-range.rs (100%) rename tests/{codegen => codegen-llvm}/ehcontguard_disabled.rs (100%) rename tests/{codegen => codegen-llvm}/ehcontguard_enabled.rs (100%) rename tests/{codegen => codegen-llvm}/emscripten-catch-unwind-js-eh.rs (100%) rename tests/{codegen => codegen-llvm}/emscripten-catch-unwind-wasm-eh.rs (100%) rename tests/{codegen => codegen-llvm}/enable-lto-unit-splitting.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-aggregate.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-bounds-check-derived-idx.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-bounds-check-issue-13926.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-bounds-check-issue-82871.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-bounds-check.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-debug-clike.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-debug-niche-2.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-debug-niche.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-debug-tagged.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-discriminant-eq.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-discriminant-value.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-early-otherwise-branch.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-match.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-two-variants-match.rs (100%) rename tests/{codegen => codegen-llvm}/enum/enum-u128.rs (100%) rename tests/{codegen => codegen-llvm}/enum/unreachable_enum_default_branch.rs (100%) rename tests/{codegen => codegen-llvm}/ergonomic-clones/closure.rs (100%) rename tests/{codegen => codegen-llvm}/error-provide.rs (100%) rename tests/{codegen => codegen-llvm}/export-no-mangle.rs (100%) rename tests/{codegen => codegen-llvm}/external-no-mangle-fns.rs (100%) rename tests/{codegen => codegen-llvm}/external-no-mangle-statics.rs (100%) rename tests/{codegen => codegen-llvm}/f128-wasm32-callconv.rs (100%) rename tests/{codegen => codegen-llvm}/fastcall-inreg.rs (100%) rename tests/{codegen => codegen-llvm}/fatptr.rs (100%) rename tests/{codegen => codegen-llvm}/fewer-names.rs (100%) rename tests/{codegen => codegen-llvm}/fixed-x18.rs (100%) rename tests/{codegen => codegen-llvm}/float/algebraic.rs (100%) rename tests/{codegen => codegen-llvm}/float/f128.rs (100%) rename tests/{codegen => codegen-llvm}/float/f16-f128-inline.rs (100%) rename tests/{codegen => codegen-llvm}/float/f16.rs (100%) rename tests/{codegen => codegen-llvm}/float_math.rs (100%) rename tests/{codegen => codegen-llvm}/fn-impl-trait-self.rs (100%) rename tests/{codegen => codegen-llvm}/fn-parameters-on-different-lines-debuginfo.rs (100%) rename tests/{codegen => codegen-llvm}/force-frame-pointers.rs (100%) rename tests/{codegen => codegen-llvm}/force-no-unwind-tables.rs (100%) rename tests/{codegen => codegen-llvm}/force-unwind-tables.rs (100%) rename tests/{codegen => codegen-llvm}/frame-pointer-cli-control.rs (100%) rename tests/{codegen => codegen-llvm}/frame-pointer.rs (100%) rename tests/{codegen => codegen-llvm}/function-arguments-noopt.rs (100%) rename tests/{codegen => codegen-llvm}/function-arguments.rs (100%) rename tests/{codegen => codegen-llvm}/function-return.rs (100%) rename tests/{codegen => codegen-llvm}/gdb_debug_script_load.rs (100%) rename tests/{codegen => codegen-llvm}/generic-debug.rs (100%) rename tests/{codegen => codegen-llvm}/gep-index.rs (100%) rename tests/{codegen => codegen-llvm}/gpu-kernel-abi.rs (100%) rename tests/{codegen => codegen-llvm}/gpu_offload/gpu_host.rs (100%) rename tests/{codegen => codegen-llvm}/hint/cold_path.rs (100%) rename tests/{codegen => codegen-llvm}/hint/likely.rs (100%) rename tests/{codegen => codegen-llvm}/hint/unlikely.rs (100%) rename tests/{codegen => codegen-llvm}/i128-wasm32-callconv.rs (100%) rename tests/{codegen => codegen-llvm}/i128-x86-align.rs (100%) rename tests/{codegen => codegen-llvm}/i128-x86-callconv.rs (100%) rename tests/{codegen => codegen-llvm}/infallible-unwrap-in-opt-z.rs (100%) rename tests/{codegen => codegen-llvm}/inherit_overflow.rs (100%) rename tests/{codegen => codegen-llvm}/inline-always-works-always.rs (100%) rename tests/{codegen => codegen-llvm}/inline-debuginfo.rs (100%) rename tests/{codegen => codegen-llvm}/inline-function-args-debug-info.rs (100%) rename tests/{codegen => codegen-llvm}/inline-hint.rs (100%) rename tests/{codegen => codegen-llvm}/instrument-coverage/instrument-coverage-off.rs (100%) rename tests/{codegen => codegen-llvm}/instrument-coverage/instrument-coverage.rs (100%) rename tests/{codegen => codegen-llvm}/instrument-coverage/testprog.rs (100%) rename tests/{codegen => codegen-llvm}/instrument-mcount.rs (100%) rename tests/{codegen => codegen-llvm}/instrument-xray/basic.rs (100%) rename tests/{codegen => codegen-llvm}/instrument-xray/options-combine.rs (100%) rename tests/{codegen => codegen-llvm}/instrument-xray/options-override.rs (100%) rename tests/{codegen => codegen-llvm}/integer-cmp.rs (100%) rename tests/{codegen => codegen-llvm}/integer-overflow.rs (100%) rename tests/{codegen => codegen-llvm}/internalize-closures.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsic-no-unnamed-attr.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/aggregate-thin-pointer.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/carrying_mul_add.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/cold_path.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/cold_path2.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/cold_path3.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/compare_bytes.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/const_eval_select.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/ctlz.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/ctpop.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/disjoint_bitor.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/exact_div.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/likely.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/likely_assert.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/mask.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/nontemporal.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/offset.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/offset_from.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/prefetch.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/ptr_metadata.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/rotate_left.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/rustc_intrinsic_must_be_overridden.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/select_unpredictable.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/three_way_compare.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/transmute-niched.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/transmute-x64.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/transmute.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/typed_swap.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/unchecked_math.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/unlikely.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/volatile.rs (100%) rename tests/{codegen => codegen-llvm}/intrinsics/volatile_order.rs (100%) rename tests/{codegen => codegen-llvm}/is_val_statically_known.rs (100%) rename tests/{codegen => codegen-llvm}/issue-97217.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-101048.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-101082.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-101814.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-103132.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-103285-ptr-addr-overflow-check.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-103327.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-103840.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-105386-ub-in-debuginfo.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-106369.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-107681-unwrap_unchecked.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-108395-branchy-bool-match.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-109328-split_first.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-110797-enum-jump-same.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-111603.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-112509-slice-get-andthen-get.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-113757-bounds-check-after-cmp-max.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-114312.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-115385-llvm-jump-threading.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-116878.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-118306.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-118392.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-119422.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-121719-common-field-offset.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-122600-ptr-discriminant-update.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-123712-str-to-lower-autovectorization.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-126585.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-129795.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-13018.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-136329-optnone-noinline.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-15953.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-27130.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-32031.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-32364.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-34634.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-34947-pow-i32.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-36010-some-box-is_some.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-37945.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-45222.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-45466.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-45964-bounds-check-slice-pos.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-47278.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-47442.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-56267-2.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-56267.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-56927.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-58881.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-59352.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-64219-fn-ptr-call-returning-never-is-noreturn.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-68667-unwrap-combinators.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-69101-bounds-check.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-73031.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-73258.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-73338-effecient-cmp.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-73396-bounds-check-after-position.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-73827-bounds-check-index-in-subexpr.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-74938-array-split-at.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-75525-bounds-checks.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-75546.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-75659.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-75978.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-77812.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-84268.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-85872-multiple-reverse.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-86106.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-86109-eliminate-div-by-zero-check.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-93036-assert-index.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-96274.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-96497-slice-size-nowrap.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-98294-get-mut-copy-from-slice-opt.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-98678-async.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-98678-closure-coroutine.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-98678-enum.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-98678-struct-union.rs (100%) rename tests/{codegen => codegen-llvm}/issues/issue-99960.rs (100%) rename tests/{codegen => codegen-llvm}/issues/looping-over-ne-bytes-133528.rs (100%) rename tests/{codegen => codegen-llvm}/issues/str-to-string-128690.rs (100%) rename tests/{codegen => codegen-llvm}/iter-repeat-n-trivial-drop.rs (100%) rename tests/{codegen => codegen-llvm}/layout-size-checks.rs (100%) rename tests/{codegen => codegen-llvm}/lib-optimizations/iter-sum.rs (100%) rename tests/{codegen => codegen-llvm}/lib-optimizations/slice_rotate.rs (100%) rename tests/{codegen => codegen-llvm}/lifetime_start_end.rs (100%) rename tests/{codegen => codegen-llvm}/link-dead-code.rs (100%) rename tests/{codegen => codegen-llvm}/link_section.rs (100%) rename tests/{codegen => codegen-llvm}/llvm-ident.rs (100%) rename tests/{codegen => codegen-llvm}/llvm_module_flags.rs (100%) rename tests/{codegen => codegen-llvm}/loads.rs (100%) rename tests/{codegen => codegen-llvm}/local-generics-in-exe-internalized.rs (100%) rename tests/{codegen => codegen-llvm}/loongarch-abi/call-llvm-intrinsics.rs (100%) rename tests/{codegen => codegen-llvm}/loongarch-abi/loongarch64-lp64d-abi.rs (100%) rename tests/{codegen => codegen-llvm}/lto-removes-invokes.rs (100%) rename tests/{codegen => codegen-llvm}/macos/i686-macosx-deployment-target.rs (100%) rename tests/{codegen => codegen-llvm}/macos/i686-no-macosx-deployment-target.rs (100%) rename tests/{codegen => codegen-llvm}/macos/x86_64-macosx-deployment-target.rs (100%) rename tests/{codegen => codegen-llvm}/macos/x86_64-no-macosx-deployment-target.rs (100%) rename tests/{codegen => codegen-llvm}/mainsubprogram.rs (100%) rename tests/{codegen => codegen-llvm}/match-optimized.rs (100%) rename tests/{codegen => codegen-llvm}/match-optimizes-away.rs (100%) rename tests/{codegen => codegen-llvm}/match-unoptimized.rs (100%) rename tests/{codegen => codegen-llvm}/maybeuninit-rvo.rs (100%) rename tests/{codegen => codegen-llvm}/mem-replace-big-type.rs (100%) rename tests/{codegen => codegen-llvm}/mem-replace-simple-type.rs (100%) rename tests/{codegen => codegen-llvm}/merge-functions.rs (100%) rename tests/{codegen => codegen-llvm}/meta-filecheck/check-prefix.rs (100%) rename tests/{codegen => codegen-llvm}/meta-filecheck/filecheck-flags.rs (100%) rename tests/{codegen => codegen-llvm}/meta-filecheck/msvc-prefix-bad.rs (100%) rename tests/{codegen => codegen-llvm}/meta-filecheck/no-directives.rs (100%) rename tests/{codegen => codegen-llvm}/meta-filecheck/revision-prefix.rs (100%) rename tests/{codegen => codegen-llvm}/method-declaration.rs (100%) rename tests/{codegen => codegen-llvm}/min-function-alignment.rs (100%) rename tests/{codegen => codegen-llvm}/mir-aggregate-no-alloca.rs (100%) rename tests/{codegen => codegen-llvm}/mir-inlined-line-numbers.rs (100%) rename tests/{codegen => codegen-llvm}/mir_zst_stores.rs (100%) rename tests/{codegen => codegen-llvm}/move-before-nocapture-ref-arg.rs (100%) rename tests/{codegen => codegen-llvm}/move-operands.rs (100%) rename tests/{codegen => codegen-llvm}/naked-asan.rs (100%) rename tests/{codegen => codegen-llvm}/naked-fn/aligned.rs (100%) rename tests/{codegen => codegen-llvm}/naked-fn/generics.rs (100%) rename tests/{codegen => codegen-llvm}/naked-fn/instruction-set.rs (100%) rename tests/{codegen => codegen-llvm}/naked-fn/min-function-alignment.rs (100%) rename tests/{codegen => codegen-llvm}/naked-fn/naked-functions.rs (100%) rename tests/{codegen => codegen-llvm}/no-alloca-inside-if-false.rs (100%) rename tests/{codegen => codegen-llvm}/no-assumes-on-casts.rs (100%) rename tests/{codegen => codegen-llvm}/no-dllimport-w-cross-lang-lto.rs (100%) rename tests/{codegen => codegen-llvm}/no-jump-tables.rs (100%) rename tests/{codegen => codegen-llvm}/no-plt.rs (100%) rename tests/{codegen => codegen-llvm}/no-redundant-item-monomorphization.rs (100%) rename tests/{codegen => codegen-llvm}/no_builtins-at-crate.rs (100%) rename tests/{codegen => codegen-llvm}/noalias-box-off.rs (100%) rename tests/{codegen => codegen-llvm}/noalias-box.rs (100%) rename tests/{codegen => codegen-llvm}/noalias-flag.rs (100%) rename tests/{codegen => codegen-llvm}/noalias-freeze.rs (100%) rename tests/{codegen => codegen-llvm}/noalias-refcell.rs (100%) rename tests/{codegen => codegen-llvm}/noalias-rwlockreadguard.rs (100%) rename tests/{codegen => codegen-llvm}/noalias-unpin.rs (100%) rename tests/{codegen => codegen-llvm}/non-terminate/infinite-loop-1.rs (100%) rename tests/{codegen => codegen-llvm}/non-terminate/infinite-loop-2.rs (100%) rename tests/{codegen => codegen-llvm}/non-terminate/infinite-recursion.rs (100%) rename tests/{codegen => codegen-llvm}/non-terminate/nonempty-infinite-loop.rs (100%) rename tests/{codegen => codegen-llvm}/noreturn-uninhabited.rs (100%) rename tests/{codegen => codegen-llvm}/noreturnflag.rs (100%) rename tests/{codegen => codegen-llvm}/nounwind.rs (100%) rename tests/{codegen => codegen-llvm}/nrvo.rs (100%) rename tests/{codegen => codegen-llvm}/optimize-attr-1.rs (100%) rename tests/{codegen => codegen-llvm}/option-as-slice.rs (100%) rename tests/{codegen => codegen-llvm}/option-niche-eq.rs (100%) rename tests/{codegen => codegen-llvm}/option-niche-unfixed/option-nonzero-eq.rs (100%) rename tests/{codegen => codegen-llvm}/overaligned-constant.rs (100%) rename tests/{codegen => codegen-llvm}/packed.rs (100%) rename tests/{codegen => codegen-llvm}/panic-abort-windows.rs (100%) rename tests/{codegen => codegen-llvm}/panic-in-drop-abort.rs (100%) rename tests/{codegen => codegen-llvm}/panic-unwind-default-uwtable.rs (100%) rename tests/{codegen => codegen-llvm}/patchable-function-entry/patchable-function-entry-both-flags.rs (100%) rename tests/{codegen => codegen-llvm}/patchable-function-entry/patchable-function-entry-no-flag.rs (100%) rename tests/{codegen => codegen-llvm}/patchable-function-entry/patchable-function-entry-one-flag.rs (100%) rename tests/{codegen => codegen-llvm}/pattern_type_symbols.rs (100%) rename tests/{codegen => codegen-llvm}/personality_lifetimes.rs (100%) rename tests/{codegen => codegen-llvm}/pgo-counter-bias.rs (100%) rename tests/{codegen => codegen-llvm}/pgo-instrumentation.rs (100%) rename tests/{codegen => codegen-llvm}/pic-relocation-model.rs (100%) rename tests/{codegen => codegen-llvm}/pie-relocation-model.rs (100%) rename tests/{codegen => codegen-llvm}/placement-new.rs (100%) rename tests/{codegen => codegen-llvm}/powerpc64le-struct-align-128.rs (100%) rename tests/{codegen => codegen-llvm}/precondition-checks.rs (100%) rename tests/{codegen => codegen-llvm}/ptr-arithmetic.rs (100%) rename tests/{codegen => codegen-llvm}/ptr-read-metadata.rs (100%) rename tests/{codegen => codegen-llvm}/range-attribute.rs (100%) rename tests/{codegen => codegen-llvm}/range-loop.rs (100%) rename tests/{codegen => codegen-llvm}/range_to_inclusive.rs (100%) rename tests/{codegen => codegen-llvm}/refs.rs (100%) rename tests/{codegen => codegen-llvm}/reg-struct-return.rs (100%) rename tests/{codegen => codegen-llvm}/regparm-inreg.rs (100%) rename tests/{codegen => codegen-llvm}/remap_path_prefix/aux_mod.rs (100%) rename tests/{codegen => codegen-llvm}/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs (100%) rename tests/{codegen => codegen-llvm}/remap_path_prefix/auxiliary/xcrate-generic.rs (100%) rename tests/{codegen => codegen-llvm}/remap_path_prefix/issue-73167-remap-std.rs (100%) rename tests/{codegen => codegen-llvm}/remap_path_prefix/main.rs (100%) rename tests/{codegen => codegen-llvm}/remap_path_prefix/xcrate-generic.rs (100%) rename tests/{codegen => codegen-llvm}/repeat-operand-zero-len.rs (100%) rename tests/{codegen => codegen-llvm}/repeat-operand-zst-elem.rs (100%) rename tests/{codegen => codegen-llvm}/repeat-trusted-len.rs (100%) rename tests/{codegen => codegen-llvm}/repr/transparent-byval-struct-ptr.rs (100%) rename tests/{codegen => codegen-llvm}/repr/transparent-imm-array.rs (100%) rename tests/{codegen => codegen-llvm}/repr/transparent-mips64.rs (100%) rename tests/{codegen => codegen-llvm}/repr/transparent-opaque-ptr.rs (100%) rename tests/{codegen => codegen-llvm}/repr/transparent-sparc64.rs (100%) rename tests/{codegen => codegen-llvm}/repr/transparent-sysv64.rs (100%) rename tests/{codegen => codegen-llvm}/repr/transparent.rs (100%) rename tests/{codegen => codegen-llvm}/retpoline.rs (100%) rename tests/{codegen => codegen-llvm}/riscv-abi/call-llvm-intrinsics.rs (100%) rename tests/{codegen => codegen-llvm}/riscv-abi/cast-local-large-enough.rs (100%) rename tests/{codegen => codegen-llvm}/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs (100%) rename tests/{codegen => codegen-llvm}/riscv-abi/riscv64-lp64d-abi.rs (100%) rename tests/{codegen => codegen-llvm}/riscv-abi/riscv64-lp64f-lp64d-abi.rs (100%) rename tests/{codegen => codegen-llvm}/riscv-target-abi.rs (100%) rename tests/{codegen => codegen-llvm}/rust-abi-arch-specific-adjustment.rs (100%) rename tests/{codegen => codegen-llvm}/s390x-simd.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/address-sanitizer-globals-tracking.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/add-canonical-jump-tables-flag.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/add-cfi-normalize-integers-flag.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/add-enable-split-lto-unit-flag.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/dbg-location-on-cfi-blocks.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-checks-attr-no-sanitize.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-checks.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-attr-cfi-encoding.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-const-generics.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-function-types.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-lifetimes.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-method-secondary-typeid.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-pointer-types.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-primitive-types.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-repr-transparent-types.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-sequence-types.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-trait-types.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-generalized.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/emit-type-metadata-trait-objects.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/external_weak_symbols.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/generalize-pointers.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/cfi/normalize-integers.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/dataflow-instrument-functions.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kasan-emits-instrumentation.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/add-kcfi-arity-flag.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/add-kcfi-flag.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/add-kcfi-offset-flag.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/emit-kcfi-operand-bundle.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/emit-type-metadata-trait-objects.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/kcfi/naked-function.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/memory-track-origins.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/memtag-attr-check.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/no-sanitize-inlining.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/no-sanitize.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/riscv64-shadow-call-stack.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/safestack-attr-check.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/sanitizer-recover.rs (100%) rename tests/{codegen => codegen-llvm}/sanitizer/scs-attr-check.rs (100%) rename tests/{codegen => codegen-llvm}/scalar-pair-bool.rs (100%) rename tests/{codegen => codegen-llvm}/set-discriminant-invalid.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-abs.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-ceil.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-cos.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-exp.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-exp2.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-floor.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-fma.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-fsqrt.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-log.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-log10.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-log2.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-minmax.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-float-sin.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-generic-bitmask.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-generic-gather.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-generic-masked-load.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-generic-masked-store.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-generic-scatter.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-generic-select.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-mask-reduce.rs (100%) rename tests/{codegen => codegen-llvm}/simd-intrinsic/simd-intrinsic-transmute-array.rs (100%) rename tests/{codegen => codegen-llvm}/simd/aggregate-simd.rs (100%) rename tests/{codegen => codegen-llvm}/simd/extract-insert-dyn.rs (100%) rename tests/{codegen => codegen-llvm}/simd/packed-simd-alignment.rs (100%) rename tests/{codegen => codegen-llvm}/simd/packed-simd.rs (100%) rename tests/{codegen => codegen-llvm}/simd/simd-wide-sum.rs (100%) rename tests/{codegen => codegen-llvm}/simd/simd_arith_offset.rs (100%) rename tests/{codegen => codegen-llvm}/simd/swap-simd-types.rs (100%) rename tests/{codegen => codegen-llvm}/simd/unpadded-simd.rs (100%) rename tests/{codegen => codegen-llvm}/skip-mono-inside-if-false.rs (100%) rename tests/{codegen => codegen-llvm}/slice-as_chunks.rs (100%) rename tests/{codegen => codegen-llvm}/slice-indexing.rs (100%) rename tests/{codegen => codegen-llvm}/slice-init.rs (100%) rename tests/{codegen => codegen-llvm}/slice-is-ascii.rs (100%) rename tests/{codegen => codegen-llvm}/slice-iter-fold.rs (100%) rename tests/{codegen => codegen-llvm}/slice-iter-len-eq-zero.rs (100%) rename tests/{codegen => codegen-llvm}/slice-iter-nonnull.rs (100%) rename tests/{codegen => codegen-llvm}/slice-last-elements-optimization.rs (100%) rename tests/{codegen => codegen-llvm}/slice-pointer-nonnull-unwrap.rs (100%) rename tests/{codegen => codegen-llvm}/slice-position-bounds-check.rs (100%) rename tests/{codegen => codegen-llvm}/slice-ref-equality.rs (100%) rename tests/{codegen => codegen-llvm}/slice-reverse.rs (100%) rename tests/{codegen => codegen-llvm}/slice-split-at.rs (100%) rename tests/{codegen => codegen-llvm}/slice-windows-no-bounds-check.rs (100%) rename tests/{codegen => codegen-llvm}/slice_as_from_ptr_range.rs (100%) rename tests/{codegen => codegen-llvm}/some-abis-do-extend-params-to-32-bits.rs (100%) rename tests/{codegen => codegen-llvm}/some-global-nonnull.rs (100%) rename tests/{codegen => codegen-llvm}/sparc-struct-abi.rs (100%) rename tests/{codegen => codegen-llvm}/split-lto-unit.rs (100%) rename tests/{codegen => codegen-llvm}/src-hash-algorithm/src-hash-algorithm-md5.rs (100%) rename tests/{codegen => codegen-llvm}/src-hash-algorithm/src-hash-algorithm-sha1.rs (100%) rename tests/{codegen => codegen-llvm}/src-hash-algorithm/src-hash-algorithm-sha256.rs (100%) rename tests/{codegen => codegen-llvm}/sroa-fragment-debuginfo.rs (100%) rename tests/{codegen => codegen-llvm}/sse42-implies-crc32.rs (100%) rename tests/{codegen => codegen-llvm}/stack-probes-inline.rs (100%) rename tests/{codegen => codegen-llvm}/stack-protector.rs (100%) rename tests/{codegen => codegen-llvm}/static-relocation-model-msvc.rs (100%) rename tests/{codegen => codegen-llvm}/staticlib-external-inline-fns.rs (100%) rename tests/{codegen => codegen-llvm}/step_by-overflow-checks.rs (100%) rename tests/{codegen => codegen-llvm}/stores.rs (100%) rename tests/{codegen => codegen-llvm}/string-push.rs (100%) rename tests/{codegen => codegen-llvm}/swap-large-types.rs (100%) rename tests/{codegen => codegen-llvm}/swap-small-types.rs (100%) rename tests/{codegen => codegen-llvm}/target-cpu-on-functions.rs (100%) rename tests/{codegen => codegen-llvm}/target-feature-inline-closure.rs (100%) rename tests/{codegen => codegen-llvm}/target-feature-negative-implication.rs (100%) rename tests/{codegen => codegen-llvm}/target-feature-overrides.rs (100%) rename tests/{codegen => codegen-llvm}/terminating-catchpad.rs (100%) rename tests/{codegen => codegen-llvm}/thread-local.rs (100%) rename tests/{codegen => codegen-llvm}/tied-features-strength.rs (100%) rename tests/{codegen => codegen-llvm}/to_vec.rs (100%) rename tests/{codegen => codegen-llvm}/trailing_zeros.rs (100%) rename tests/{codegen => codegen-llvm}/transmute-optimized.rs (100%) rename tests/{codegen => codegen-llvm}/transmute-scalar.rs (100%) rename tests/{codegen => codegen-llvm}/try_question_mark_nop.rs (100%) rename tests/{codegen => codegen-llvm}/tune-cpu-on-functions.rs (100%) rename tests/{codegen => codegen-llvm}/tuple-layout-opt.rs (100%) rename tests/{codegen => codegen-llvm}/ub-checks.rs (100%) rename tests/{codegen => codegen-llvm}/unchecked-float-casts.rs (100%) rename tests/{codegen => codegen-llvm}/unchecked_shifts.rs (100%) rename tests/{codegen => codegen-llvm}/uninhabited-transparent-return-abi.rs (100%) rename tests/{codegen => codegen-llvm}/uninit-consts.rs (100%) rename tests/{codegen => codegen-llvm}/uninit-repeat-in-aggregate.rs (100%) rename tests/{codegen => codegen-llvm}/union-abi.rs (100%) rename tests/{codegen => codegen-llvm}/union-aggregate.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/aapcs-unwind-abi.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/c-unwind-abi-panic-abort.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/c-unwind-abi.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/cdecl-unwind-abi.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/fastcall-unwind-abi.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/nounwind-on-stable-panic-abort.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/nounwind.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/stdcall-unwind-abi.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/system-unwind-abi.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/sysv64-unwind-abi.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/thiscall-unwind-abi.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/vectorcall-unwind-abi.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-abis/win64-unwind-abi.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-and-panic-abort.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-extern-exports.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-extern-imports.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-landingpad-cold.rs (100%) rename tests/{codegen => codegen-llvm}/unwind-landingpad-inline.rs (100%) rename tests/{codegen => codegen-llvm}/used_with_arg.rs (100%) rename tests/{codegen => codegen-llvm}/var-names.rs (100%) rename tests/{codegen => codegen-llvm}/vec-as-ptr.rs (100%) rename tests/{codegen => codegen-llvm}/vec-calloc.rs (100%) rename tests/{codegen => codegen-llvm}/vec-in-place.rs (100%) rename tests/{codegen => codegen-llvm}/vec-iter-collect-len.rs (100%) rename tests/{codegen => codegen-llvm}/vec-iter.rs (100%) rename tests/{codegen => codegen-llvm}/vec-len-invariant.rs (100%) rename tests/{codegen => codegen-llvm}/vec-optimizes-away.rs (100%) rename tests/{codegen => codegen-llvm}/vec-reserve-extend.rs (100%) rename tests/{codegen => codegen-llvm}/vec-shrink-panik.rs (100%) rename tests/{codegen => codegen-llvm}/vec-with-capacity.rs (100%) rename tests/{codegen => codegen-llvm}/vec_pop_push_noop.rs (100%) rename tests/{codegen => codegen-llvm}/vecdeque-drain.rs (100%) rename tests/{codegen => codegen-llvm}/vecdeque-nonempty-get-no-panic.rs (100%) rename tests/{codegen => codegen-llvm}/vecdeque_no_panic.rs (100%) rename tests/{codegen => codegen-llvm}/vecdeque_pop_push.rs (100%) rename tests/{codegen => codegen-llvm}/virtual-call-attrs-issue-137646.rs (100%) rename tests/{codegen => codegen-llvm}/virtual-function-elimination-32bit.rs (100%) rename tests/{codegen => codegen-llvm}/virtual-function-elimination.rs (100%) rename tests/{codegen => codegen-llvm}/vtable-loads.rs (100%) rename tests/{codegen => codegen-llvm}/vtable-upcast.rs (100%) rename tests/{codegen => codegen-llvm}/wasm_casts_trapping.rs (100%) rename tests/{codegen => codegen-llvm}/wasm_exceptions.rs (100%) rename tests/{codegen => codegen-llvm}/zip.rs (100%) rename tests/{codegen => codegen-llvm}/zst-offset.rs (100%) diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index e872f8434e56..610e2fd23111 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -869,7 +869,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { let ltext = bx.zext(is_lt, bx.type_i8()); bx.unchecked_ssub(gtext, ltext) } else { - // These operations are those expected by `tests/codegen/integer-cmp.rs`, + // These operations are those expected by `tests/codegen-llvm/integer-cmp.rs`, // from . let is_lt = bx.icmp(pred(mir::BinOp::Lt), lhs, rhs); let is_ne = bx.icmp(pred(mir::BinOp::Ne), lhs, rhs); diff --git a/compiler/rustc_mir_transform/src/unreachable_prop.rs b/compiler/rustc_mir_transform/src/unreachable_prop.rs index 13fb5b3e56f2..c417a9272f2a 100644 --- a/compiler/rustc_mir_transform/src/unreachable_prop.rs +++ b/compiler/rustc_mir_transform/src/unreachable_prop.rs @@ -75,7 +75,7 @@ fn remove_successors_from_switch<'tcx>( let is_unreachable = |bb| unreachable_blocks.contains(&bb); // If there are multiple targets, we want to keep information about reachability for codegen. - // For example (see tests/codegen/match-optimizes-away.rs) + // For example (see tests/codegen-llvm/match-optimizes-away.rs) // // pub enum Two { A, B } // pub fn identity(x: Two) -> Two { diff --git a/library/alloc/src/collections/vec_deque/drain.rs b/library/alloc/src/collections/vec_deque/drain.rs index 44fcef4ed7dc..321621d18be9 100644 --- a/library/alloc/src/collections/vec_deque/drain.rs +++ b/library/alloc/src/collections/vec_deque/drain.rs @@ -192,7 +192,7 @@ impl Drop for Drain<'_, T, A> { // this branch is never taken. // We use `#[cold]` instead of `#[inline(never)]`, because inlining this // function into the general case (`.drain(n..m)`) is fine. - // See `tests/codegen/vecdeque-drain.rs` for a test. + // See `tests/codegen-llvm/vecdeque-drain.rs` for a test. #[cold] fn join_head_and_tail_wrapping( source_deque: &mut VecDeque, diff --git a/library/alloc/src/raw_vec/mod.rs b/library/alloc/src/raw_vec/mod.rs index 3e006a2d1bdf..40716755aad3 100644 --- a/library/alloc/src/raw_vec/mod.rs +++ b/library/alloc/src/raw_vec/mod.rs @@ -761,7 +761,7 @@ impl RawVecInner { } // not marked inline(never) since we want optimizers to be able to observe the specifics of this -// function, see tests/codegen/vec-reserve-extend.rs. +// function, see tests/codegen-llvm/vec-reserve-extend.rs. #[cold] fn finish_grow( new_layout: Layout, diff --git a/rustfmt.toml b/rustfmt.toml index 689e390b990c..6172a2bb3bf9 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -14,7 +14,7 @@ ignore = [ "/vendor/", # Some tests are not formatted, for various reasons. - "/tests/codegen/simd-intrinsic/", # Many types like `u8x64` are better hand-formatted. + "/tests/codegen-llvm/simd-intrinsic/", # Many types like `u8x64` are better hand-formatted. "/tests/crashes/", # Many of these tests contain syntax errors. "/tests/debuginfo/", # These tests are somewhat sensitive to source code layout. "/tests/incremental/", # These tests are somewhat sensitive to source code layout. @@ -58,5 +58,5 @@ ignore = [ # Rustfmt doesn't support use closures yet "tests/mir-opt/ergonomic-clones/closure.rs", - "tests/codegen/ergonomic-clones/closure.rs", + "tests/codegen-llvm/ergonomic-clones/closure.rs", ] diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 99c9e8ae92eb..d346062761c1 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1342,7 +1342,12 @@ test!(Ui { path: "tests/ui", mode: "ui", suite: "ui", default: true }); test!(Crashes { path: "tests/crashes", mode: "crashes", suite: "crashes", default: true }); -test!(Codegen { path: "tests/codegen", mode: "codegen", suite: "codegen", default: true }); +test!(CodegenLlvm { + path: "tests/codegen-llvm", + mode: "codegen", + suite: "codegen-llvm", + default: true +}); test!(CodegenUnits { path: "tests/codegen-units", @@ -1620,7 +1625,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the let suite_path = self.path; // Skip codegen tests if they aren't enabled in configuration. - if !builder.config.codegen_tests && suite == "codegen" { + if !builder.config.codegen_tests && mode == "codegen" { return; } @@ -1817,7 +1822,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the let mut flags = if is_rustdoc { Vec::new() } else { vec!["-Crpath".to_string()] }; flags.push(format!( "-Cdebuginfo={}", - if suite == "codegen" { + if mode == "codegen" { // codegen tests typically check LLVM IR and are sensitive to additional debuginfo. // So do not apply `rust.debuginfo-level-tests` for codegen tests. if builder.config.rust_debuginfo_level_tests diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index 925e47a41644..923c3a9a9350 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -412,7 +412,7 @@ const PATH_REMAP: &[(&str, &[&str])] = &[ &[ // tidy-alphabetical-start "tests/assembly-llvm", - "tests/codegen", + "tests/codegen-llvm", "tests/codegen-units", "tests/coverage", "tests/coverage-run-rustdoc", @@ -1049,7 +1049,7 @@ impl<'a> Builder<'a> { test::Crashes, test::Coverage, test::MirOpt, - test::Codegen, + test::CodegenLlvm, test::CodegenUnits, test::AssemblyLlvm, test::Incremental, diff --git a/src/ci/docker/host-x86_64/test-various/Dockerfile b/src/ci/docker/host-x86_64/test-various/Dockerfile index 54ca7131608e..4d09bea69c08 100644 --- a/src/ci/docker/host-x86_64/test-various/Dockerfile +++ b/src/ci/docker/host-x86_64/test-various/Dockerfile @@ -65,7 +65,7 @@ ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_T tests/ui \ tests/mir-opt \ tests/codegen-units \ - tests/codegen \ + tests/codegen-llvm \ tests/assembly-llvm \ library/core diff --git a/src/doc/rustc-dev-guide/src/asm.md b/src/doc/rustc-dev-guide/src/asm.md index 3d93d5a4c57e..1bb493e73d58 100644 --- a/src/doc/rustc-dev-guide/src/asm.md +++ b/src/doc/rustc-dev-guide/src/asm.md @@ -157,7 +157,7 @@ Various tests for inline assembly are available: - `tests/assembly-llvm/asm` - `tests/ui/asm` -- `tests/codegen/asm-*` +- `tests/codegen-llvm/asm-*` Every architecture supported by inline assembly must have exhaustive tests in `tests/assembly-llvm/asm` which test all combinations of register classes and types. diff --git a/src/doc/rustc-dev-guide/src/autodiff/installation.md b/src/doc/rustc-dev-guide/src/autodiff/installation.md index a550f6d233eb..ddbb3a054241 100644 --- a/src/doc/rustc-dev-guide/src/autodiff/installation.md +++ b/src/doc/rustc-dev-guide/src/autodiff/installation.md @@ -25,7 +25,7 @@ rustup toolchain install nightly # enables -Z unstable-options You can then run our test cases: ```bash -./x test --stage 1 tests/codegen/autodiff +./x test --stage 1 tests/codegen-llvm/autodiff ./x test --stage 1 tests/pretty/autodiff ./x test --stage 1 tests/ui/autodiff ./x test --stage 1 tests/ui/feature-gates/feature-gate-autodiff.rs diff --git a/src/doc/rustc-dev-guide/src/llvm-coverage-instrumentation.md b/src/doc/rustc-dev-guide/src/llvm-coverage-instrumentation.md index 28e0e7a908d6..880363b94bf2 100644 --- a/src/doc/rustc-dev-guide/src/llvm-coverage-instrumentation.md +++ b/src/doc/rustc-dev-guide/src/llvm-coverage-instrumentation.md @@ -117,7 +117,7 @@ human-readable coverage report. > directive, so they will be skipped if the profiler runtime has not been > [enabled in `bootstrap.toml`](#recommended-configtoml-settings). -Finally, the [`tests/codegen/instrument-coverage/testprog.rs`] test compiles a simple Rust program +Finally, the [`tests/codegen-llvm/instrument-coverage/testprog.rs`] test compiles a simple Rust program with `-C instrument-coverage` and compares the compiled program's LLVM IR to expected LLVM IR instructions and structured data for a coverage-enabled program, including various checks for Coverage Map-related metadata and the LLVM @@ -136,4 +136,4 @@ and `mir-opt` tests can be refreshed by running: [`tests/coverage`]: https://github.com/rust-lang/rust/tree/master/tests/coverage [`src/tools/coverage-dump`]: https://github.com/rust-lang/rust/tree/master/src/tools/coverage-dump [`tests/coverage-run-rustdoc`]: https://github.com/rust-lang/rust/tree/master/tests/coverage-run-rustdoc -[`tests/codegen/instrument-coverage/testprog.rs`]: https://github.com/rust-lang/rust/blob/master/tests/mir-opt/coverage/instrument_coverage.rs +[`tests/codegen-llvm/instrument-coverage/testprog.rs`]: https://github.com/rust-lang/rust/blob/master/tests/mir-opt/coverage/instrument_coverage.rs diff --git a/src/doc/rustc-dev-guide/src/offload/installation.md b/src/doc/rustc-dev-guide/src/offload/installation.md index 1962314c70ac..1e792de3c8ce 100644 --- a/src/doc/rustc-dev-guide/src/offload/installation.md +++ b/src/doc/rustc-dev-guide/src/offload/installation.md @@ -40,7 +40,7 @@ This gives you a working LLVM build. ## Testing run ``` -./x test --stage 1 tests/codegen/gpu_offload +./x test --stage 1 tests/codegen-llvm/gpu_offload ``` ## Usage diff --git a/src/doc/rustc-dev-guide/src/profile-guided-optimization.md b/src/doc/rustc-dev-guide/src/profile-guided-optimization.md index d279786ac45e..2fa810210451 100644 --- a/src/doc/rustc-dev-guide/src/profile-guided-optimization.md +++ b/src/doc/rustc-dev-guide/src/profile-guided-optimization.md @@ -132,7 +132,7 @@ There is also a [codegen test][codegen-test] that checks that some expected instrumentation artifacts show up in LLVM IR. [rmake-tests]: https://github.com/rust-lang/rust/tree/master/tests/run-make -[codegen-test]: https://github.com/rust-lang/rust/blob/master/tests/codegen/pgo-instrumentation.rs +[codegen-test]: https://github.com/rust-lang/rust/blob/master/tests/codegen-llvm/pgo-instrumentation.rs ## Additional information diff --git a/src/doc/rustc-dev-guide/src/sanitizers.md b/src/doc/rustc-dev-guide/src/sanitizers.md index 664b4feac4f0..29d9056c15d0 100644 --- a/src/doc/rustc-dev-guide/src/sanitizers.md +++ b/src/doc/rustc-dev-guide/src/sanitizers.md @@ -76,7 +76,7 @@ implementation: ## Testing sanitizers Sanitizers are validated by code generation tests in -[`tests/codegen/sanitize*.rs`][test-cg] and end-to-end functional tests in +[`tests/codegen-llvm/sanitize*.rs`][test-cg] and end-to-end functional tests in [`tests/ui/sanitizer/`][test-ui] directory. Testing sanitizer functionality requires the sanitizer runtimes (built when @@ -85,7 +85,7 @@ sanitizer. When sanitizer is unsupported on given target, sanitizers tests will be ignored. This behaviour is controlled by compiletest `needs-sanitizer-*` directives. -[test-cg]: https://github.com/rust-lang/rust/tree/master/tests/codegen +[test-cg]: https://github.com/rust-lang/rust/tree/master/tests/codegen-llvm [test-ui]: https://github.com/rust-lang/rust/tree/master/tests/ui/sanitizer ## Enabling sanitizer on a new target diff --git a/src/doc/rustc-dev-guide/src/tests/compiletest.md b/src/doc/rustc-dev-guide/src/tests/compiletest.md index 6a60e7118d38..a108dfdef9b3 100644 --- a/src/doc/rustc-dev-guide/src/tests/compiletest.md +++ b/src/doc/rustc-dev-guide/src/tests/compiletest.md @@ -68,7 +68,7 @@ The following test suites are available, with links for more information: | [`pretty`](#pretty-printer-tests) | Check pretty printing | | [`incremental`](#incremental-tests) | Check incremental compilation behavior | | [`debuginfo`](#debuginfo-tests) | Check debuginfo generation running debuggers | -| [`codegen`](#codegen-tests) | Check code generation | +| [`codegen-*`](#codegen-tests) | Check code generation | | [`codegen-units`](#codegen-units-tests) | Check codegen unit partitioning | | [`assembly`](#assembly-tests) | Check assembly output | | [`mir-opt`](#mir-opt-tests) | Check MIR generation and optimizations | @@ -290,7 +290,7 @@ For example, `./x test tests/debuginfo -- --debugger gdb` will only test GDB com ### Codegen tests -The tests in [`tests/codegen`] test LLVM code generation. They compile the test +The tests in [`tests/codegen-llvm`] test LLVM code generation. They compile the test with the `--emit=llvm-ir` flag to emit LLVM IR. They then run the LLVM [FileCheck] tool. The test is annotated with various `// CHECK` comments to check the generated code. See the [FileCheck] documentation for a tutorial and @@ -301,7 +301,7 @@ See also the [assembly tests](#assembly-tests) for a similar set of tests. If you need to work with `#![no_std]` cross-compiling tests, consult the [`minicore` test auxiliary](./minicore.md) chapter. -[`tests/codegen`]: https://github.com/rust-lang/rust/tree/master/tests/codegen +[`tests/codegen-llvm`]: https://github.com/rust-lang/rust/tree/master/tests/codegen-llvm [FileCheck]: https://llvm.org/docs/CommandGuide/FileCheck.html diff --git a/src/tools/opt-dist/src/tests.rs b/src/tools/opt-dist/src/tests.rs index a70c257e52bf..c9a21fc6fb29 100644 --- a/src/tools/opt-dist/src/tests.rs +++ b/src/tools/opt-dist/src/tests.rs @@ -101,7 +101,7 @@ llvm-config = "{llvm_config}" "--stage", "0", "tests/assembly-llvm", - "tests/codegen", + "tests/codegen-llvm", "tests/codegen-units", "tests/incremental", "tests/mir-opt", diff --git a/tests/assembly-llvm/target-feature-multiple.rs b/tests/assembly-llvm/target-feature-multiple.rs index bc432d219317..9a941c52bdac 100644 --- a/tests/assembly-llvm/target-feature-multiple.rs +++ b/tests/assembly-llvm/target-feature-multiple.rs @@ -15,7 +15,7 @@ // > LLVM ERROR: Cannot select: 0x7f00f400c010: i32,i32,ch = X86ISD::RDSEED 0x7f00f400bfa8:2 // > In function: foo // -// See also tests/codegen/target-feature-overrides.rs +// See also tests/codegen-llvm/target-feature-overrides.rs #![feature(no_core, lang_items, link_llvm_intrinsics, abi_unadjusted)] #![crate_type = "lib"] #![no_core] diff --git a/tests/codegen/README.md b/tests/codegen-llvm/README.md similarity index 100% rename from tests/codegen/README.md rename to tests/codegen-llvm/README.md diff --git a/tests/codegen/aarch64-softfloat.rs b/tests/codegen-llvm/aarch64-softfloat.rs similarity index 100% rename from tests/codegen/aarch64-softfloat.rs rename to tests/codegen-llvm/aarch64-softfloat.rs diff --git a/tests/codegen/aarch64-struct-align-128.rs b/tests/codegen-llvm/aarch64-struct-align-128.rs similarity index 100% rename from tests/codegen/aarch64-struct-align-128.rs rename to tests/codegen-llvm/aarch64-struct-align-128.rs diff --git a/tests/codegen/abi-efiapi.rs b/tests/codegen-llvm/abi-efiapi.rs similarity index 100% rename from tests/codegen/abi-efiapi.rs rename to tests/codegen-llvm/abi-efiapi.rs diff --git a/tests/codegen/abi-main-signature-16bit-c-int.rs b/tests/codegen-llvm/abi-main-signature-16bit-c-int.rs similarity index 100% rename from tests/codegen/abi-main-signature-16bit-c-int.rs rename to tests/codegen-llvm/abi-main-signature-16bit-c-int.rs diff --git a/tests/codegen/abi-main-signature-32bit-c-int.rs b/tests/codegen-llvm/abi-main-signature-32bit-c-int.rs similarity index 100% rename from tests/codegen/abi-main-signature-32bit-c-int.rs rename to tests/codegen-llvm/abi-main-signature-32bit-c-int.rs diff --git a/tests/codegen/abi-repr-ext.rs b/tests/codegen-llvm/abi-repr-ext.rs similarity index 100% rename from tests/codegen/abi-repr-ext.rs rename to tests/codegen-llvm/abi-repr-ext.rs diff --git a/tests/codegen/abi-sysv64.rs b/tests/codegen-llvm/abi-sysv64.rs similarity index 100% rename from tests/codegen/abi-sysv64.rs rename to tests/codegen-llvm/abi-sysv64.rs diff --git a/tests/codegen/abi-win64-zst.rs b/tests/codegen-llvm/abi-win64-zst.rs similarity index 100% rename from tests/codegen/abi-win64-zst.rs rename to tests/codegen-llvm/abi-win64-zst.rs diff --git a/tests/codegen/abi-x86-interrupt.rs b/tests/codegen-llvm/abi-x86-interrupt.rs similarity index 100% rename from tests/codegen/abi-x86-interrupt.rs rename to tests/codegen-llvm/abi-x86-interrupt.rs diff --git a/tests/codegen/abi-x86-sse.rs b/tests/codegen-llvm/abi-x86-sse.rs similarity index 100% rename from tests/codegen/abi-x86-sse.rs rename to tests/codegen-llvm/abi-x86-sse.rs diff --git a/tests/codegen/abi-x86_64_sysv.rs b/tests/codegen-llvm/abi-x86_64_sysv.rs similarity index 100% rename from tests/codegen/abi-x86_64_sysv.rs rename to tests/codegen-llvm/abi-x86_64_sysv.rs diff --git a/tests/codegen/addr-of-mutate.rs b/tests/codegen-llvm/addr-of-mutate.rs similarity index 100% rename from tests/codegen/addr-of-mutate.rs rename to tests/codegen-llvm/addr-of-mutate.rs diff --git a/tests/codegen/adjustments.rs b/tests/codegen-llvm/adjustments.rs similarity index 100% rename from tests/codegen/adjustments.rs rename to tests/codegen-llvm/adjustments.rs diff --git a/tests/codegen/align-byval-alignment-mismatch.rs b/tests/codegen-llvm/align-byval-alignment-mismatch.rs similarity index 100% rename from tests/codegen/align-byval-alignment-mismatch.rs rename to tests/codegen-llvm/align-byval-alignment-mismatch.rs diff --git a/tests/codegen/align-byval-vector.rs b/tests/codegen-llvm/align-byval-vector.rs similarity index 100% rename from tests/codegen/align-byval-vector.rs rename to tests/codegen-llvm/align-byval-vector.rs diff --git a/tests/codegen/align-byval.rs b/tests/codegen-llvm/align-byval.rs similarity index 100% rename from tests/codegen/align-byval.rs rename to tests/codegen-llvm/align-byval.rs diff --git a/tests/codegen/align-enum.rs b/tests/codegen-llvm/align-enum.rs similarity index 100% rename from tests/codegen/align-enum.rs rename to tests/codegen-llvm/align-enum.rs diff --git a/tests/codegen/align-fn.rs b/tests/codegen-llvm/align-fn.rs similarity index 100% rename from tests/codegen/align-fn.rs rename to tests/codegen-llvm/align-fn.rs diff --git a/tests/codegen/align-offset.rs b/tests/codegen-llvm/align-offset.rs similarity index 100% rename from tests/codegen/align-offset.rs rename to tests/codegen-llvm/align-offset.rs diff --git a/tests/codegen/align-struct.rs b/tests/codegen-llvm/align-struct.rs similarity index 100% rename from tests/codegen/align-struct.rs rename to tests/codegen-llvm/align-struct.rs diff --git a/tests/codegen/alloc-optimisation.rs b/tests/codegen-llvm/alloc-optimisation.rs similarity index 100% rename from tests/codegen/alloc-optimisation.rs rename to tests/codegen-llvm/alloc-optimisation.rs diff --git a/tests/codegen/amdgpu-addrspacecast.rs b/tests/codegen-llvm/amdgpu-addrspacecast.rs similarity index 100% rename from tests/codegen/amdgpu-addrspacecast.rs rename to tests/codegen-llvm/amdgpu-addrspacecast.rs diff --git a/tests/codegen/array-clone.rs b/tests/codegen-llvm/array-clone.rs similarity index 100% rename from tests/codegen/array-clone.rs rename to tests/codegen-llvm/array-clone.rs diff --git a/tests/codegen/array-cmp.rs b/tests/codegen-llvm/array-cmp.rs similarity index 100% rename from tests/codegen/array-cmp.rs rename to tests/codegen-llvm/array-cmp.rs diff --git a/tests/codegen/array-codegen.rs b/tests/codegen-llvm/array-codegen.rs similarity index 100% rename from tests/codegen/array-codegen.rs rename to tests/codegen-llvm/array-codegen.rs diff --git a/tests/codegen/array-equality.rs b/tests/codegen-llvm/array-equality.rs similarity index 100% rename from tests/codegen/array-equality.rs rename to tests/codegen-llvm/array-equality.rs diff --git a/tests/codegen/array-from_fn.rs b/tests/codegen-llvm/array-from_fn.rs similarity index 100% rename from tests/codegen/array-from_fn.rs rename to tests/codegen-llvm/array-from_fn.rs diff --git a/tests/codegen/array-map.rs b/tests/codegen-llvm/array-map.rs similarity index 100% rename from tests/codegen/array-map.rs rename to tests/codegen-llvm/array-map.rs diff --git a/tests/codegen/array-optimized.rs b/tests/codegen-llvm/array-optimized.rs similarity index 100% rename from tests/codegen/array-optimized.rs rename to tests/codegen-llvm/array-optimized.rs diff --git a/tests/codegen/array-repeat.rs b/tests/codegen-llvm/array-repeat.rs similarity index 100% rename from tests/codegen/array-repeat.rs rename to tests/codegen-llvm/array-repeat.rs diff --git a/tests/codegen/ascii-char.rs b/tests/codegen-llvm/ascii-char.rs similarity index 100% rename from tests/codegen/ascii-char.rs rename to tests/codegen-llvm/ascii-char.rs diff --git a/tests/codegen/asm/aarch64-clobbers.rs b/tests/codegen-llvm/asm/aarch64-clobbers.rs similarity index 100% rename from tests/codegen/asm/aarch64-clobbers.rs rename to tests/codegen-llvm/asm/aarch64-clobbers.rs diff --git a/tests/codegen/asm/avr-clobbers.rs b/tests/codegen-llvm/asm/avr-clobbers.rs similarity index 100% rename from tests/codegen/asm/avr-clobbers.rs rename to tests/codegen-llvm/asm/avr-clobbers.rs diff --git a/tests/codegen/asm/bpf-clobbers.rs b/tests/codegen-llvm/asm/bpf-clobbers.rs similarity index 100% rename from tests/codegen/asm/bpf-clobbers.rs rename to tests/codegen-llvm/asm/bpf-clobbers.rs diff --git a/tests/codegen/asm/critical.rs b/tests/codegen-llvm/asm/critical.rs similarity index 100% rename from tests/codegen/asm/critical.rs rename to tests/codegen-llvm/asm/critical.rs diff --git a/tests/codegen/asm/csky-clobbers.rs b/tests/codegen-llvm/asm/csky-clobbers.rs similarity index 100% rename from tests/codegen/asm/csky-clobbers.rs rename to tests/codegen-llvm/asm/csky-clobbers.rs diff --git a/tests/codegen/asm/foo.s b/tests/codegen-llvm/asm/foo.s similarity index 100% rename from tests/codegen/asm/foo.s rename to tests/codegen-llvm/asm/foo.s diff --git a/tests/codegen/asm/global_asm.rs b/tests/codegen-llvm/asm/global_asm.rs similarity index 100% rename from tests/codegen/asm/global_asm.rs rename to tests/codegen-llvm/asm/global_asm.rs diff --git a/tests/codegen/asm/global_asm_include.rs b/tests/codegen-llvm/asm/global_asm_include.rs similarity index 100% rename from tests/codegen/asm/global_asm_include.rs rename to tests/codegen-llvm/asm/global_asm_include.rs diff --git a/tests/codegen/asm/global_asm_x2.rs b/tests/codegen-llvm/asm/global_asm_x2.rs similarity index 100% rename from tests/codegen/asm/global_asm_x2.rs rename to tests/codegen-llvm/asm/global_asm_x2.rs diff --git a/tests/codegen/asm/goto.rs b/tests/codegen-llvm/asm/goto.rs similarity index 100% rename from tests/codegen/asm/goto.rs rename to tests/codegen-llvm/asm/goto.rs diff --git a/tests/codegen/asm/hexagon-clobbers.rs b/tests/codegen-llvm/asm/hexagon-clobbers.rs similarity index 100% rename from tests/codegen/asm/hexagon-clobbers.rs rename to tests/codegen-llvm/asm/hexagon-clobbers.rs diff --git a/tests/codegen/asm/may_unwind.rs b/tests/codegen-llvm/asm/may_unwind.rs similarity index 100% rename from tests/codegen/asm/may_unwind.rs rename to tests/codegen-llvm/asm/may_unwind.rs diff --git a/tests/codegen/asm/maybe-uninit.rs b/tests/codegen-llvm/asm/maybe-uninit.rs similarity index 100% rename from tests/codegen/asm/maybe-uninit.rs rename to tests/codegen-llvm/asm/maybe-uninit.rs diff --git a/tests/codegen/asm/msp430-clobbers.rs b/tests/codegen-llvm/asm/msp430-clobbers.rs similarity index 100% rename from tests/codegen/asm/msp430-clobbers.rs rename to tests/codegen-llvm/asm/msp430-clobbers.rs diff --git a/tests/codegen/asm/multiple-options.rs b/tests/codegen-llvm/asm/multiple-options.rs similarity index 100% rename from tests/codegen/asm/multiple-options.rs rename to tests/codegen-llvm/asm/multiple-options.rs diff --git a/tests/codegen/asm/options.rs b/tests/codegen-llvm/asm/options.rs similarity index 100% rename from tests/codegen/asm/options.rs rename to tests/codegen-llvm/asm/options.rs diff --git a/tests/codegen/asm/powerpc-clobbers.rs b/tests/codegen-llvm/asm/powerpc-clobbers.rs similarity index 100% rename from tests/codegen/asm/powerpc-clobbers.rs rename to tests/codegen-llvm/asm/powerpc-clobbers.rs diff --git a/tests/codegen/asm/riscv-clobbers.rs b/tests/codegen-llvm/asm/riscv-clobbers.rs similarity index 100% rename from tests/codegen/asm/riscv-clobbers.rs rename to tests/codegen-llvm/asm/riscv-clobbers.rs diff --git a/tests/codegen/asm/s390x-clobbers.rs b/tests/codegen-llvm/asm/s390x-clobbers.rs similarity index 100% rename from tests/codegen/asm/s390x-clobbers.rs rename to tests/codegen-llvm/asm/s390x-clobbers.rs diff --git a/tests/codegen/asm/sanitize-llvm.rs b/tests/codegen-llvm/asm/sanitize-llvm.rs similarity index 100% rename from tests/codegen/asm/sanitize-llvm.rs rename to tests/codegen-llvm/asm/sanitize-llvm.rs diff --git a/tests/codegen/asm/sparc-clobbers.rs b/tests/codegen-llvm/asm/sparc-clobbers.rs similarity index 100% rename from tests/codegen/asm/sparc-clobbers.rs rename to tests/codegen-llvm/asm/sparc-clobbers.rs diff --git a/tests/codegen/asm/x86-clobber_abi.rs b/tests/codegen-llvm/asm/x86-clobber_abi.rs similarity index 100% rename from tests/codegen/asm/x86-clobber_abi.rs rename to tests/codegen-llvm/asm/x86-clobber_abi.rs diff --git a/tests/codegen/asm/x86-clobbers.rs b/tests/codegen-llvm/asm/x86-clobbers.rs similarity index 100% rename from tests/codegen/asm/x86-clobbers.rs rename to tests/codegen-llvm/asm/x86-clobbers.rs diff --git a/tests/codegen/asm/x86-target-clobbers.rs b/tests/codegen-llvm/asm/x86-target-clobbers.rs similarity index 100% rename from tests/codegen/asm/x86-target-clobbers.rs rename to tests/codegen-llvm/asm/x86-target-clobbers.rs diff --git a/tests/codegen/assign-desugar-debuginfo.rs b/tests/codegen-llvm/assign-desugar-debuginfo.rs similarity index 100% rename from tests/codegen/assign-desugar-debuginfo.rs rename to tests/codegen-llvm/assign-desugar-debuginfo.rs diff --git a/tests/codegen/async-closure-debug.rs b/tests/codegen-llvm/async-closure-debug.rs similarity index 100% rename from tests/codegen/async-closure-debug.rs rename to tests/codegen-llvm/async-closure-debug.rs diff --git a/tests/codegen/async-fn-debug-awaitee-field.rs b/tests/codegen-llvm/async-fn-debug-awaitee-field.rs similarity index 100% rename from tests/codegen/async-fn-debug-awaitee-field.rs rename to tests/codegen-llvm/async-fn-debug-awaitee-field.rs diff --git a/tests/codegen/async-fn-debug-msvc.rs b/tests/codegen-llvm/async-fn-debug-msvc.rs similarity index 100% rename from tests/codegen/async-fn-debug-msvc.rs rename to tests/codegen-llvm/async-fn-debug-msvc.rs diff --git a/tests/codegen/async-fn-debug.rs b/tests/codegen-llvm/async-fn-debug.rs similarity index 100% rename from tests/codegen/async-fn-debug.rs rename to tests/codegen-llvm/async-fn-debug.rs diff --git a/tests/codegen/atomic-operations.rs b/tests/codegen-llvm/atomic-operations.rs similarity index 100% rename from tests/codegen/atomic-operations.rs rename to tests/codegen-llvm/atomic-operations.rs diff --git a/tests/codegen/atomicptr.rs b/tests/codegen-llvm/atomicptr.rs similarity index 100% rename from tests/codegen/atomicptr.rs rename to tests/codegen-llvm/atomicptr.rs diff --git a/tests/codegen/autodiff/batched.rs b/tests/codegen-llvm/autodiff/batched.rs similarity index 100% rename from tests/codegen/autodiff/batched.rs rename to tests/codegen-llvm/autodiff/batched.rs diff --git a/tests/codegen/autodiff/generic.rs b/tests/codegen-llvm/autodiff/generic.rs similarity index 100% rename from tests/codegen/autodiff/generic.rs rename to tests/codegen-llvm/autodiff/generic.rs diff --git a/tests/codegen/autodiff/identical_fnc.rs b/tests/codegen-llvm/autodiff/identical_fnc.rs similarity index 100% rename from tests/codegen/autodiff/identical_fnc.rs rename to tests/codegen-llvm/autodiff/identical_fnc.rs diff --git a/tests/codegen/autodiff/inline.rs b/tests/codegen-llvm/autodiff/inline.rs similarity index 100% rename from tests/codegen/autodiff/inline.rs rename to tests/codegen-llvm/autodiff/inline.rs diff --git a/tests/codegen/autodiff/scalar.rs b/tests/codegen-llvm/autodiff/scalar.rs similarity index 100% rename from tests/codegen/autodiff/scalar.rs rename to tests/codegen-llvm/autodiff/scalar.rs diff --git a/tests/codegen/autodiff/sret.rs b/tests/codegen-llvm/autodiff/sret.rs similarity index 100% rename from tests/codegen/autodiff/sret.rs rename to tests/codegen-llvm/autodiff/sret.rs diff --git a/tests/codegen/autodiffv2.rs b/tests/codegen-llvm/autodiffv2.rs similarity index 100% rename from tests/codegen/autodiffv2.rs rename to tests/codegen-llvm/autodiffv2.rs diff --git a/tests/codegen/autovec/dont-shuffle-bswaps-opt2.rs b/tests/codegen-llvm/autovec/dont-shuffle-bswaps-opt2.rs similarity index 100% rename from tests/codegen/autovec/dont-shuffle-bswaps-opt2.rs rename to tests/codegen-llvm/autovec/dont-shuffle-bswaps-opt2.rs diff --git a/tests/codegen/autovec/dont-shuffle-bswaps-opt3.rs b/tests/codegen-llvm/autovec/dont-shuffle-bswaps-opt3.rs similarity index 100% rename from tests/codegen/autovec/dont-shuffle-bswaps-opt3.rs rename to tests/codegen-llvm/autovec/dont-shuffle-bswaps-opt3.rs diff --git a/tests/codegen/autovectorize-f32x4.rs b/tests/codegen-llvm/autovectorize-f32x4.rs similarity index 100% rename from tests/codegen/autovectorize-f32x4.rs rename to tests/codegen-llvm/autovectorize-f32x4.rs diff --git a/tests/codegen/auxiliary/extern_decl.rs b/tests/codegen-llvm/auxiliary/extern_decl.rs similarity index 100% rename from tests/codegen/auxiliary/extern_decl.rs rename to tests/codegen-llvm/auxiliary/extern_decl.rs diff --git a/tests/codegen/auxiliary/nounwind.rs b/tests/codegen-llvm/auxiliary/nounwind.rs similarity index 100% rename from tests/codegen/auxiliary/nounwind.rs rename to tests/codegen-llvm/auxiliary/nounwind.rs diff --git a/tests/codegen/auxiliary/thread_local_aux.rs b/tests/codegen-llvm/auxiliary/thread_local_aux.rs similarity index 100% rename from tests/codegen/auxiliary/thread_local_aux.rs rename to tests/codegen-llvm/auxiliary/thread_local_aux.rs diff --git a/tests/codegen/avr/avr-func-addrspace.rs b/tests/codegen-llvm/avr/avr-func-addrspace.rs similarity index 100% rename from tests/codegen/avr/avr-func-addrspace.rs rename to tests/codegen-llvm/avr/avr-func-addrspace.rs diff --git a/tests/codegen/bigint-helpers.rs b/tests/codegen-llvm/bigint-helpers.rs similarity index 100% rename from tests/codegen/bigint-helpers.rs rename to tests/codegen-llvm/bigint-helpers.rs diff --git a/tests/codegen/binary-heap-peek-mut-pop-no-panic.rs b/tests/codegen-llvm/binary-heap-peek-mut-pop-no-panic.rs similarity index 100% rename from tests/codegen/binary-heap-peek-mut-pop-no-panic.rs rename to tests/codegen-llvm/binary-heap-peek-mut-pop-no-panic.rs diff --git a/tests/codegen/binary-search-index-no-bound-check.rs b/tests/codegen-llvm/binary-search-index-no-bound-check.rs similarity index 100% rename from tests/codegen/binary-search-index-no-bound-check.rs rename to tests/codegen-llvm/binary-search-index-no-bound-check.rs diff --git a/tests/codegen/bool-cmp.rs b/tests/codegen-llvm/bool-cmp.rs similarity index 100% rename from tests/codegen/bool-cmp.rs rename to tests/codegen-llvm/bool-cmp.rs diff --git a/tests/codegen/bounds-checking/gep-issue-133979.rs b/tests/codegen-llvm/bounds-checking/gep-issue-133979.rs similarity index 100% rename from tests/codegen/bounds-checking/gep-issue-133979.rs rename to tests/codegen-llvm/bounds-checking/gep-issue-133979.rs diff --git a/tests/codegen/box-default-debug-copies.rs b/tests/codegen-llvm/box-default-debug-copies.rs similarity index 100% rename from tests/codegen/box-default-debug-copies.rs rename to tests/codegen-llvm/box-default-debug-copies.rs diff --git a/tests/codegen/box-uninit-bytes.rs b/tests/codegen-llvm/box-uninit-bytes.rs similarity index 100% rename from tests/codegen/box-uninit-bytes.rs rename to tests/codegen-llvm/box-uninit-bytes.rs diff --git a/tests/codegen/bpf-alu32.rs b/tests/codegen-llvm/bpf-alu32.rs similarity index 100% rename from tests/codegen/bpf-alu32.rs rename to tests/codegen-llvm/bpf-alu32.rs diff --git a/tests/codegen/branch-protection.rs b/tests/codegen-llvm/branch-protection.rs similarity index 100% rename from tests/codegen/branch-protection.rs rename to tests/codegen-llvm/branch-protection.rs diff --git a/tests/codegen/call-llvm-intrinsics.rs b/tests/codegen-llvm/call-llvm-intrinsics.rs similarity index 100% rename from tests/codegen/call-llvm-intrinsics.rs rename to tests/codegen-llvm/call-llvm-intrinsics.rs diff --git a/tests/codegen/call-tmps-lifetime.rs b/tests/codegen-llvm/call-tmps-lifetime.rs similarity index 100% rename from tests/codegen/call-tmps-lifetime.rs rename to tests/codegen-llvm/call-tmps-lifetime.rs diff --git a/tests/codegen/cast-optimized.rs b/tests/codegen-llvm/cast-optimized.rs similarity index 100% rename from tests/codegen/cast-optimized.rs rename to tests/codegen-llvm/cast-optimized.rs diff --git a/tests/codegen/cast-target-abi.rs b/tests/codegen-llvm/cast-target-abi.rs similarity index 100% rename from tests/codegen/cast-target-abi.rs rename to tests/codegen-llvm/cast-target-abi.rs diff --git a/tests/codegen/catch-unwind.rs b/tests/codegen-llvm/catch-unwind.rs similarity index 100% rename from tests/codegen/catch-unwind.rs rename to tests/codegen-llvm/catch-unwind.rs diff --git a/tests/codegen/cdylib-external-inline-fns.rs b/tests/codegen-llvm/cdylib-external-inline-fns.rs similarity index 100% rename from tests/codegen/cdylib-external-inline-fns.rs rename to tests/codegen-llvm/cdylib-external-inline-fns.rs diff --git a/tests/codegen/cf-protection.rs b/tests/codegen-llvm/cf-protection.rs similarity index 100% rename from tests/codegen/cf-protection.rs rename to tests/codegen-llvm/cf-protection.rs diff --git a/tests/codegen/cffi/c-variadic-copy.rs b/tests/codegen-llvm/cffi/c-variadic-copy.rs similarity index 100% rename from tests/codegen/cffi/c-variadic-copy.rs rename to tests/codegen-llvm/cffi/c-variadic-copy.rs diff --git a/tests/codegen/cffi/c-variadic-naked.rs b/tests/codegen-llvm/cffi/c-variadic-naked.rs similarity index 100% rename from tests/codegen/cffi/c-variadic-naked.rs rename to tests/codegen-llvm/cffi/c-variadic-naked.rs diff --git a/tests/codegen/cffi/c-variadic-opt.rs b/tests/codegen-llvm/cffi/c-variadic-opt.rs similarity index 100% rename from tests/codegen/cffi/c-variadic-opt.rs rename to tests/codegen-llvm/cffi/c-variadic-opt.rs diff --git a/tests/codegen/cffi/c-variadic.rs b/tests/codegen-llvm/cffi/c-variadic.rs similarity index 100% rename from tests/codegen/cffi/c-variadic.rs rename to tests/codegen-llvm/cffi/c-variadic.rs diff --git a/tests/codegen/cffi/ffi-const.rs b/tests/codegen-llvm/cffi/ffi-const.rs similarity index 100% rename from tests/codegen/cffi/ffi-const.rs rename to tests/codegen-llvm/cffi/ffi-const.rs diff --git a/tests/codegen/cffi/ffi-out-of-bounds-loads.rs b/tests/codegen-llvm/cffi/ffi-out-of-bounds-loads.rs similarity index 100% rename from tests/codegen/cffi/ffi-out-of-bounds-loads.rs rename to tests/codegen-llvm/cffi/ffi-out-of-bounds-loads.rs diff --git a/tests/codegen/cffi/ffi-pure.rs b/tests/codegen-llvm/cffi/ffi-pure.rs similarity index 100% rename from tests/codegen/cffi/ffi-pure.rs rename to tests/codegen-llvm/cffi/ffi-pure.rs diff --git a/tests/codegen/cfguard-checks.rs b/tests/codegen-llvm/cfguard-checks.rs similarity index 100% rename from tests/codegen/cfguard-checks.rs rename to tests/codegen-llvm/cfguard-checks.rs diff --git a/tests/codegen/cfguard-disabled.rs b/tests/codegen-llvm/cfguard-disabled.rs similarity index 100% rename from tests/codegen/cfguard-disabled.rs rename to tests/codegen-llvm/cfguard-disabled.rs diff --git a/tests/codegen/cfguard-nochecks.rs b/tests/codegen-llvm/cfguard-nochecks.rs similarity index 100% rename from tests/codegen/cfguard-nochecks.rs rename to tests/codegen-llvm/cfguard-nochecks.rs diff --git a/tests/codegen/cfguard-non-msvc.rs b/tests/codegen-llvm/cfguard-non-msvc.rs similarity index 100% rename from tests/codegen/cfguard-non-msvc.rs rename to tests/codegen-llvm/cfguard-non-msvc.rs diff --git a/tests/codegen/char-ascii-branchless.rs b/tests/codegen-llvm/char-ascii-branchless.rs similarity index 100% rename from tests/codegen/char-ascii-branchless.rs rename to tests/codegen-llvm/char-ascii-branchless.rs diff --git a/tests/codegen/char-escape-debug-no-bounds-check.rs b/tests/codegen-llvm/char-escape-debug-no-bounds-check.rs similarity index 100% rename from tests/codegen/char-escape-debug-no-bounds-check.rs rename to tests/codegen-llvm/char-escape-debug-no-bounds-check.rs diff --git a/tests/codegen/checked_ilog.rs b/tests/codegen-llvm/checked_ilog.rs similarity index 100% rename from tests/codegen/checked_ilog.rs rename to tests/codegen-llvm/checked_ilog.rs diff --git a/tests/codegen/checked_math.rs b/tests/codegen-llvm/checked_math.rs similarity index 100% rename from tests/codegen/checked_math.rs rename to tests/codegen-llvm/checked_math.rs diff --git a/tests/codegen/clone-shims.rs b/tests/codegen-llvm/clone-shims.rs similarity index 100% rename from tests/codegen/clone-shims.rs rename to tests/codegen-llvm/clone-shims.rs diff --git a/tests/codegen/clone_as_copy.rs b/tests/codegen-llvm/clone_as_copy.rs similarity index 100% rename from tests/codegen/clone_as_copy.rs rename to tests/codegen-llvm/clone_as_copy.rs diff --git a/tests/codegen/codemodels.rs b/tests/codegen-llvm/codemodels.rs similarity index 100% rename from tests/codegen/codemodels.rs rename to tests/codegen-llvm/codemodels.rs diff --git a/tests/codegen/coercions.rs b/tests/codegen-llvm/coercions.rs similarity index 100% rename from tests/codegen/coercions.rs rename to tests/codegen-llvm/coercions.rs diff --git a/tests/codegen/cold-call-declare-and-call.rs b/tests/codegen-llvm/cold-call-declare-and-call.rs similarity index 100% rename from tests/codegen/cold-call-declare-and-call.rs rename to tests/codegen-llvm/cold-call-declare-and-call.rs diff --git a/tests/codegen/common_prim_int_ptr.rs b/tests/codegen-llvm/common_prim_int_ptr.rs similarity index 100% rename from tests/codegen/common_prim_int_ptr.rs rename to tests/codegen-llvm/common_prim_int_ptr.rs diff --git a/tests/codegen/comparison-operators-2-struct.rs b/tests/codegen-llvm/comparison-operators-2-struct.rs similarity index 100% rename from tests/codegen/comparison-operators-2-struct.rs rename to tests/codegen-llvm/comparison-operators-2-struct.rs diff --git a/tests/codegen/comparison-operators-2-tuple.rs b/tests/codegen-llvm/comparison-operators-2-tuple.rs similarity index 100% rename from tests/codegen/comparison-operators-2-tuple.rs rename to tests/codegen-llvm/comparison-operators-2-tuple.rs diff --git a/tests/codegen/comparison-operators-newtype.rs b/tests/codegen-llvm/comparison-operators-newtype.rs similarity index 100% rename from tests/codegen/comparison-operators-newtype.rs rename to tests/codegen-llvm/comparison-operators-newtype.rs diff --git a/tests/codegen/compiletest-self-test/minicore-smoke-test.rs b/tests/codegen-llvm/compiletest-self-test/minicore-smoke-test.rs similarity index 100% rename from tests/codegen/compiletest-self-test/minicore-smoke-test.rs rename to tests/codegen-llvm/compiletest-self-test/minicore-smoke-test.rs diff --git a/tests/codegen/const-array.rs b/tests/codegen-llvm/const-array.rs similarity index 100% rename from tests/codegen/const-array.rs rename to tests/codegen-llvm/const-array.rs diff --git a/tests/codegen/const-vector.rs b/tests/codegen-llvm/const-vector.rs similarity index 100% rename from tests/codegen/const-vector.rs rename to tests/codegen-llvm/const-vector.rs diff --git a/tests/codegen/const_scalar_pair.rs b/tests/codegen-llvm/const_scalar_pair.rs similarity index 100% rename from tests/codegen/const_scalar_pair.rs rename to tests/codegen-llvm/const_scalar_pair.rs diff --git a/tests/codegen/constant-branch.rs b/tests/codegen-llvm/constant-branch.rs similarity index 100% rename from tests/codegen/constant-branch.rs rename to tests/codegen-llvm/constant-branch.rs diff --git a/tests/codegen/consts.rs b/tests/codegen-llvm/consts.rs similarity index 100% rename from tests/codegen/consts.rs rename to tests/codegen-llvm/consts.rs diff --git a/tests/codegen/coroutine-debug-msvc.rs b/tests/codegen-llvm/coroutine-debug-msvc.rs similarity index 100% rename from tests/codegen/coroutine-debug-msvc.rs rename to tests/codegen-llvm/coroutine-debug-msvc.rs diff --git a/tests/codegen/coroutine-debug.rs b/tests/codegen-llvm/coroutine-debug.rs similarity index 100% rename from tests/codegen/coroutine-debug.rs rename to tests/codegen-llvm/coroutine-debug.rs diff --git a/tests/codegen/cross-crate-inlining/always-inline.rs b/tests/codegen-llvm/cross-crate-inlining/always-inline.rs similarity index 100% rename from tests/codegen/cross-crate-inlining/always-inline.rs rename to tests/codegen-llvm/cross-crate-inlining/always-inline.rs diff --git a/tests/codegen/cross-crate-inlining/auxiliary/always.rs b/tests/codegen-llvm/cross-crate-inlining/auxiliary/always.rs similarity index 100% rename from tests/codegen/cross-crate-inlining/auxiliary/always.rs rename to tests/codegen-llvm/cross-crate-inlining/auxiliary/always.rs diff --git a/tests/codegen/cross-crate-inlining/auxiliary/leaf.rs b/tests/codegen-llvm/cross-crate-inlining/auxiliary/leaf.rs similarity index 100% rename from tests/codegen/cross-crate-inlining/auxiliary/leaf.rs rename to tests/codegen-llvm/cross-crate-inlining/auxiliary/leaf.rs diff --git a/tests/codegen/cross-crate-inlining/auxiliary/never.rs b/tests/codegen-llvm/cross-crate-inlining/auxiliary/never.rs similarity index 100% rename from tests/codegen/cross-crate-inlining/auxiliary/never.rs rename to tests/codegen-llvm/cross-crate-inlining/auxiliary/never.rs diff --git a/tests/codegen/cross-crate-inlining/leaf-inlining.rs b/tests/codegen-llvm/cross-crate-inlining/leaf-inlining.rs similarity index 100% rename from tests/codegen/cross-crate-inlining/leaf-inlining.rs rename to tests/codegen-llvm/cross-crate-inlining/leaf-inlining.rs diff --git a/tests/codegen/cross-crate-inlining/never-inline.rs b/tests/codegen-llvm/cross-crate-inlining/never-inline.rs similarity index 100% rename from tests/codegen/cross-crate-inlining/never-inline.rs rename to tests/codegen-llvm/cross-crate-inlining/never-inline.rs diff --git a/tests/codegen/dealloc-no-unwind.rs b/tests/codegen-llvm/dealloc-no-unwind.rs similarity index 100% rename from tests/codegen/dealloc-no-unwind.rs rename to tests/codegen-llvm/dealloc-no-unwind.rs diff --git a/tests/codegen/debug-accessibility/crate-enum.rs b/tests/codegen-llvm/debug-accessibility/crate-enum.rs similarity index 100% rename from tests/codegen/debug-accessibility/crate-enum.rs rename to tests/codegen-llvm/debug-accessibility/crate-enum.rs diff --git a/tests/codegen/debug-accessibility/crate-struct.rs b/tests/codegen-llvm/debug-accessibility/crate-struct.rs similarity index 100% rename from tests/codegen/debug-accessibility/crate-struct.rs rename to tests/codegen-llvm/debug-accessibility/crate-struct.rs diff --git a/tests/codegen/debug-accessibility/private-enum.rs b/tests/codegen-llvm/debug-accessibility/private-enum.rs similarity index 100% rename from tests/codegen/debug-accessibility/private-enum.rs rename to tests/codegen-llvm/debug-accessibility/private-enum.rs diff --git a/tests/codegen/debug-accessibility/private-struct.rs b/tests/codegen-llvm/debug-accessibility/private-struct.rs similarity index 100% rename from tests/codegen/debug-accessibility/private-struct.rs rename to tests/codegen-llvm/debug-accessibility/private-struct.rs diff --git a/tests/codegen/debug-accessibility/public-enum.rs b/tests/codegen-llvm/debug-accessibility/public-enum.rs similarity index 100% rename from tests/codegen/debug-accessibility/public-enum.rs rename to tests/codegen-llvm/debug-accessibility/public-enum.rs diff --git a/tests/codegen/debug-accessibility/public-struct.rs b/tests/codegen-llvm/debug-accessibility/public-struct.rs similarity index 100% rename from tests/codegen/debug-accessibility/public-struct.rs rename to tests/codegen-llvm/debug-accessibility/public-struct.rs diff --git a/tests/codegen/debug-accessibility/struct-fields.rs b/tests/codegen-llvm/debug-accessibility/struct-fields.rs similarity index 100% rename from tests/codegen/debug-accessibility/struct-fields.rs rename to tests/codegen-llvm/debug-accessibility/struct-fields.rs diff --git a/tests/codegen/debug-accessibility/super-enum.rs b/tests/codegen-llvm/debug-accessibility/super-enum.rs similarity index 100% rename from tests/codegen/debug-accessibility/super-enum.rs rename to tests/codegen-llvm/debug-accessibility/super-enum.rs diff --git a/tests/codegen/debug-accessibility/super-struct.rs b/tests/codegen-llvm/debug-accessibility/super-struct.rs similarity index 100% rename from tests/codegen/debug-accessibility/super-struct.rs rename to tests/codegen-llvm/debug-accessibility/super-struct.rs diff --git a/tests/codegen/debug-accessibility/tuple-fields.rs b/tests/codegen-llvm/debug-accessibility/tuple-fields.rs similarity index 100% rename from tests/codegen/debug-accessibility/tuple-fields.rs rename to tests/codegen-llvm/debug-accessibility/tuple-fields.rs diff --git a/tests/codegen/debug-alignment.rs b/tests/codegen-llvm/debug-alignment.rs similarity index 100% rename from tests/codegen/debug-alignment.rs rename to tests/codegen-llvm/debug-alignment.rs diff --git a/tests/codegen/debug-column-msvc.rs b/tests/codegen-llvm/debug-column-msvc.rs similarity index 100% rename from tests/codegen/debug-column-msvc.rs rename to tests/codegen-llvm/debug-column-msvc.rs diff --git a/tests/codegen/debug-column.rs b/tests/codegen-llvm/debug-column.rs similarity index 100% rename from tests/codegen/debug-column.rs rename to tests/codegen-llvm/debug-column.rs diff --git a/tests/codegen/debug-compile-unit-path.rs b/tests/codegen-llvm/debug-compile-unit-path.rs similarity index 100% rename from tests/codegen/debug-compile-unit-path.rs rename to tests/codegen-llvm/debug-compile-unit-path.rs diff --git a/tests/codegen/debug-fndef-size.rs b/tests/codegen-llvm/debug-fndef-size.rs similarity index 100% rename from tests/codegen/debug-fndef-size.rs rename to tests/codegen-llvm/debug-fndef-size.rs diff --git a/tests/codegen/debug-limited.rs b/tests/codegen-llvm/debug-limited.rs similarity index 100% rename from tests/codegen/debug-limited.rs rename to tests/codegen-llvm/debug-limited.rs diff --git a/tests/codegen/debug-line-directives-only.rs b/tests/codegen-llvm/debug-line-directives-only.rs similarity index 100% rename from tests/codegen/debug-line-directives-only.rs rename to tests/codegen-llvm/debug-line-directives-only.rs diff --git a/tests/codegen/debug-line-tables-only.rs b/tests/codegen-llvm/debug-line-tables-only.rs similarity index 100% rename from tests/codegen/debug-line-tables-only.rs rename to tests/codegen-llvm/debug-line-tables-only.rs diff --git a/tests/codegen/debug-linkage-name.rs b/tests/codegen-llvm/debug-linkage-name.rs similarity index 100% rename from tests/codegen/debug-linkage-name.rs rename to tests/codegen-llvm/debug-linkage-name.rs diff --git a/tests/codegen/debug-vtable.rs b/tests/codegen-llvm/debug-vtable.rs similarity index 100% rename from tests/codegen/debug-vtable.rs rename to tests/codegen-llvm/debug-vtable.rs diff --git a/tests/codegen/debuginfo-constant-locals.rs b/tests/codegen-llvm/debuginfo-constant-locals.rs similarity index 100% rename from tests/codegen/debuginfo-constant-locals.rs rename to tests/codegen-llvm/debuginfo-constant-locals.rs diff --git a/tests/codegen/debuginfo-generic-closure-env-names.rs b/tests/codegen-llvm/debuginfo-generic-closure-env-names.rs similarity index 100% rename from tests/codegen/debuginfo-generic-closure-env-names.rs rename to tests/codegen-llvm/debuginfo-generic-closure-env-names.rs diff --git a/tests/codegen/debuginfo-inline-callsite-location.rs b/tests/codegen-llvm/debuginfo-inline-callsite-location.rs similarity index 100% rename from tests/codegen/debuginfo-inline-callsite-location.rs rename to tests/codegen-llvm/debuginfo-inline-callsite-location.rs diff --git a/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs b/tests/codegen-llvm/debuginfo-proc-macro/auxiliary/macro_def.rs similarity index 100% rename from tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs rename to tests/codegen-llvm/debuginfo-proc-macro/auxiliary/macro_def.rs diff --git a/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs b/tests/codegen-llvm/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs similarity index 100% rename from tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs rename to tests/codegen-llvm/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs diff --git a/tests/codegen/deduced-param-attrs.rs b/tests/codegen-llvm/deduced-param-attrs.rs similarity index 100% rename from tests/codegen/deduced-param-attrs.rs rename to tests/codegen-llvm/deduced-param-attrs.rs diff --git a/tests/codegen/default-requires-uwtable.rs b/tests/codegen-llvm/default-requires-uwtable.rs similarity index 100% rename from tests/codegen/default-requires-uwtable.rs rename to tests/codegen-llvm/default-requires-uwtable.rs diff --git a/tests/codegen/default-visibility.rs b/tests/codegen-llvm/default-visibility.rs similarity index 100% rename from tests/codegen/default-visibility.rs rename to tests/codegen-llvm/default-visibility.rs diff --git a/tests/codegen/direct-access-external-data.rs b/tests/codegen-llvm/direct-access-external-data.rs similarity index 100% rename from tests/codegen/direct-access-external-data.rs rename to tests/codegen-llvm/direct-access-external-data.rs diff --git a/tests/codegen/dllimports/auxiliary/dummy.rs b/tests/codegen-llvm/dllimports/auxiliary/dummy.rs similarity index 100% rename from tests/codegen/dllimports/auxiliary/dummy.rs rename to tests/codegen-llvm/dllimports/auxiliary/dummy.rs diff --git a/tests/codegen/dllimports/auxiliary/wrapper.rs b/tests/codegen-llvm/dllimports/auxiliary/wrapper.rs similarity index 100% rename from tests/codegen/dllimports/auxiliary/wrapper.rs rename to tests/codegen-llvm/dllimports/auxiliary/wrapper.rs diff --git a/tests/codegen/dllimports/main.rs b/tests/codegen-llvm/dllimports/main.rs similarity index 100% rename from tests/codegen/dllimports/main.rs rename to tests/codegen-llvm/dllimports/main.rs diff --git a/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs b/tests/codegen-llvm/dont_codegen_private_const_fn_only_used_in_const_eval.rs similarity index 100% rename from tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs rename to tests/codegen-llvm/dont_codegen_private_const_fn_only_used_in_const_eval.rs diff --git a/tests/codegen/drop-in-place-noalias.rs b/tests/codegen-llvm/drop-in-place-noalias.rs similarity index 100% rename from tests/codegen/drop-in-place-noalias.rs rename to tests/codegen-llvm/drop-in-place-noalias.rs diff --git a/tests/codegen/drop.rs b/tests/codegen-llvm/drop.rs similarity index 100% rename from tests/codegen/drop.rs rename to tests/codegen-llvm/drop.rs diff --git a/tests/codegen/dst-offset.rs b/tests/codegen-llvm/dst-offset.rs similarity index 100% rename from tests/codegen/dst-offset.rs rename to tests/codegen-llvm/dst-offset.rs diff --git a/tests/codegen/dst-vtable-align-nonzero.rs b/tests/codegen-llvm/dst-vtable-align-nonzero.rs similarity index 100% rename from tests/codegen/dst-vtable-align-nonzero.rs rename to tests/codegen-llvm/dst-vtable-align-nonzero.rs diff --git a/tests/codegen/dst-vtable-size-range.rs b/tests/codegen-llvm/dst-vtable-size-range.rs similarity index 100% rename from tests/codegen/dst-vtable-size-range.rs rename to tests/codegen-llvm/dst-vtable-size-range.rs diff --git a/tests/codegen/ehcontguard_disabled.rs b/tests/codegen-llvm/ehcontguard_disabled.rs similarity index 100% rename from tests/codegen/ehcontguard_disabled.rs rename to tests/codegen-llvm/ehcontguard_disabled.rs diff --git a/tests/codegen/ehcontguard_enabled.rs b/tests/codegen-llvm/ehcontguard_enabled.rs similarity index 100% rename from tests/codegen/ehcontguard_enabled.rs rename to tests/codegen-llvm/ehcontguard_enabled.rs diff --git a/tests/codegen/emscripten-catch-unwind-js-eh.rs b/tests/codegen-llvm/emscripten-catch-unwind-js-eh.rs similarity index 100% rename from tests/codegen/emscripten-catch-unwind-js-eh.rs rename to tests/codegen-llvm/emscripten-catch-unwind-js-eh.rs diff --git a/tests/codegen/emscripten-catch-unwind-wasm-eh.rs b/tests/codegen-llvm/emscripten-catch-unwind-wasm-eh.rs similarity index 100% rename from tests/codegen/emscripten-catch-unwind-wasm-eh.rs rename to tests/codegen-llvm/emscripten-catch-unwind-wasm-eh.rs diff --git a/tests/codegen/enable-lto-unit-splitting.rs b/tests/codegen-llvm/enable-lto-unit-splitting.rs similarity index 100% rename from tests/codegen/enable-lto-unit-splitting.rs rename to tests/codegen-llvm/enable-lto-unit-splitting.rs diff --git a/tests/codegen/enum/enum-aggregate.rs b/tests/codegen-llvm/enum/enum-aggregate.rs similarity index 100% rename from tests/codegen/enum/enum-aggregate.rs rename to tests/codegen-llvm/enum/enum-aggregate.rs diff --git a/tests/codegen/enum/enum-bounds-check-derived-idx.rs b/tests/codegen-llvm/enum/enum-bounds-check-derived-idx.rs similarity index 100% rename from tests/codegen/enum/enum-bounds-check-derived-idx.rs rename to tests/codegen-llvm/enum/enum-bounds-check-derived-idx.rs diff --git a/tests/codegen/enum/enum-bounds-check-issue-13926.rs b/tests/codegen-llvm/enum/enum-bounds-check-issue-13926.rs similarity index 100% rename from tests/codegen/enum/enum-bounds-check-issue-13926.rs rename to tests/codegen-llvm/enum/enum-bounds-check-issue-13926.rs diff --git a/tests/codegen/enum/enum-bounds-check-issue-82871.rs b/tests/codegen-llvm/enum/enum-bounds-check-issue-82871.rs similarity index 100% rename from tests/codegen/enum/enum-bounds-check-issue-82871.rs rename to tests/codegen-llvm/enum/enum-bounds-check-issue-82871.rs diff --git a/tests/codegen/enum/enum-bounds-check.rs b/tests/codegen-llvm/enum/enum-bounds-check.rs similarity index 100% rename from tests/codegen/enum/enum-bounds-check.rs rename to tests/codegen-llvm/enum/enum-bounds-check.rs diff --git a/tests/codegen/enum/enum-debug-clike.rs b/tests/codegen-llvm/enum/enum-debug-clike.rs similarity index 100% rename from tests/codegen/enum/enum-debug-clike.rs rename to tests/codegen-llvm/enum/enum-debug-clike.rs diff --git a/tests/codegen/enum/enum-debug-niche-2.rs b/tests/codegen-llvm/enum/enum-debug-niche-2.rs similarity index 100% rename from tests/codegen/enum/enum-debug-niche-2.rs rename to tests/codegen-llvm/enum/enum-debug-niche-2.rs diff --git a/tests/codegen/enum/enum-debug-niche.rs b/tests/codegen-llvm/enum/enum-debug-niche.rs similarity index 100% rename from tests/codegen/enum/enum-debug-niche.rs rename to tests/codegen-llvm/enum/enum-debug-niche.rs diff --git a/tests/codegen/enum/enum-debug-tagged.rs b/tests/codegen-llvm/enum/enum-debug-tagged.rs similarity index 100% rename from tests/codegen/enum/enum-debug-tagged.rs rename to tests/codegen-llvm/enum/enum-debug-tagged.rs diff --git a/tests/codegen/enum/enum-discriminant-eq.rs b/tests/codegen-llvm/enum/enum-discriminant-eq.rs similarity index 100% rename from tests/codegen/enum/enum-discriminant-eq.rs rename to tests/codegen-llvm/enum/enum-discriminant-eq.rs diff --git a/tests/codegen/enum/enum-discriminant-value.rs b/tests/codegen-llvm/enum/enum-discriminant-value.rs similarity index 100% rename from tests/codegen/enum/enum-discriminant-value.rs rename to tests/codegen-llvm/enum/enum-discriminant-value.rs diff --git a/tests/codegen/enum/enum-early-otherwise-branch.rs b/tests/codegen-llvm/enum/enum-early-otherwise-branch.rs similarity index 100% rename from tests/codegen/enum/enum-early-otherwise-branch.rs rename to tests/codegen-llvm/enum/enum-early-otherwise-branch.rs diff --git a/tests/codegen/enum/enum-match.rs b/tests/codegen-llvm/enum/enum-match.rs similarity index 100% rename from tests/codegen/enum/enum-match.rs rename to tests/codegen-llvm/enum/enum-match.rs diff --git a/tests/codegen/enum/enum-two-variants-match.rs b/tests/codegen-llvm/enum/enum-two-variants-match.rs similarity index 100% rename from tests/codegen/enum/enum-two-variants-match.rs rename to tests/codegen-llvm/enum/enum-two-variants-match.rs diff --git a/tests/codegen/enum/enum-u128.rs b/tests/codegen-llvm/enum/enum-u128.rs similarity index 100% rename from tests/codegen/enum/enum-u128.rs rename to tests/codegen-llvm/enum/enum-u128.rs diff --git a/tests/codegen/enum/unreachable_enum_default_branch.rs b/tests/codegen-llvm/enum/unreachable_enum_default_branch.rs similarity index 100% rename from tests/codegen/enum/unreachable_enum_default_branch.rs rename to tests/codegen-llvm/enum/unreachable_enum_default_branch.rs diff --git a/tests/codegen/ergonomic-clones/closure.rs b/tests/codegen-llvm/ergonomic-clones/closure.rs similarity index 100% rename from tests/codegen/ergonomic-clones/closure.rs rename to tests/codegen-llvm/ergonomic-clones/closure.rs diff --git a/tests/codegen/error-provide.rs b/tests/codegen-llvm/error-provide.rs similarity index 100% rename from tests/codegen/error-provide.rs rename to tests/codegen-llvm/error-provide.rs diff --git a/tests/codegen/export-no-mangle.rs b/tests/codegen-llvm/export-no-mangle.rs similarity index 100% rename from tests/codegen/export-no-mangle.rs rename to tests/codegen-llvm/export-no-mangle.rs diff --git a/tests/codegen/external-no-mangle-fns.rs b/tests/codegen-llvm/external-no-mangle-fns.rs similarity index 100% rename from tests/codegen/external-no-mangle-fns.rs rename to tests/codegen-llvm/external-no-mangle-fns.rs diff --git a/tests/codegen/external-no-mangle-statics.rs b/tests/codegen-llvm/external-no-mangle-statics.rs similarity index 100% rename from tests/codegen/external-no-mangle-statics.rs rename to tests/codegen-llvm/external-no-mangle-statics.rs diff --git a/tests/codegen/f128-wasm32-callconv.rs b/tests/codegen-llvm/f128-wasm32-callconv.rs similarity index 100% rename from tests/codegen/f128-wasm32-callconv.rs rename to tests/codegen-llvm/f128-wasm32-callconv.rs diff --git a/tests/codegen/fastcall-inreg.rs b/tests/codegen-llvm/fastcall-inreg.rs similarity index 100% rename from tests/codegen/fastcall-inreg.rs rename to tests/codegen-llvm/fastcall-inreg.rs diff --git a/tests/codegen/fatptr.rs b/tests/codegen-llvm/fatptr.rs similarity index 100% rename from tests/codegen/fatptr.rs rename to tests/codegen-llvm/fatptr.rs diff --git a/tests/codegen/fewer-names.rs b/tests/codegen-llvm/fewer-names.rs similarity index 100% rename from tests/codegen/fewer-names.rs rename to tests/codegen-llvm/fewer-names.rs diff --git a/tests/codegen/fixed-x18.rs b/tests/codegen-llvm/fixed-x18.rs similarity index 100% rename from tests/codegen/fixed-x18.rs rename to tests/codegen-llvm/fixed-x18.rs diff --git a/tests/codegen/float/algebraic.rs b/tests/codegen-llvm/float/algebraic.rs similarity index 100% rename from tests/codegen/float/algebraic.rs rename to tests/codegen-llvm/float/algebraic.rs diff --git a/tests/codegen/float/f128.rs b/tests/codegen-llvm/float/f128.rs similarity index 100% rename from tests/codegen/float/f128.rs rename to tests/codegen-llvm/float/f128.rs diff --git a/tests/codegen/float/f16-f128-inline.rs b/tests/codegen-llvm/float/f16-f128-inline.rs similarity index 100% rename from tests/codegen/float/f16-f128-inline.rs rename to tests/codegen-llvm/float/f16-f128-inline.rs diff --git a/tests/codegen/float/f16.rs b/tests/codegen-llvm/float/f16.rs similarity index 100% rename from tests/codegen/float/f16.rs rename to tests/codegen-llvm/float/f16.rs diff --git a/tests/codegen/float_math.rs b/tests/codegen-llvm/float_math.rs similarity index 100% rename from tests/codegen/float_math.rs rename to tests/codegen-llvm/float_math.rs diff --git a/tests/codegen/fn-impl-trait-self.rs b/tests/codegen-llvm/fn-impl-trait-self.rs similarity index 100% rename from tests/codegen/fn-impl-trait-self.rs rename to tests/codegen-llvm/fn-impl-trait-self.rs diff --git a/tests/codegen/fn-parameters-on-different-lines-debuginfo.rs b/tests/codegen-llvm/fn-parameters-on-different-lines-debuginfo.rs similarity index 100% rename from tests/codegen/fn-parameters-on-different-lines-debuginfo.rs rename to tests/codegen-llvm/fn-parameters-on-different-lines-debuginfo.rs diff --git a/tests/codegen/force-frame-pointers.rs b/tests/codegen-llvm/force-frame-pointers.rs similarity index 100% rename from tests/codegen/force-frame-pointers.rs rename to tests/codegen-llvm/force-frame-pointers.rs diff --git a/tests/codegen/force-no-unwind-tables.rs b/tests/codegen-llvm/force-no-unwind-tables.rs similarity index 100% rename from tests/codegen/force-no-unwind-tables.rs rename to tests/codegen-llvm/force-no-unwind-tables.rs diff --git a/tests/codegen/force-unwind-tables.rs b/tests/codegen-llvm/force-unwind-tables.rs similarity index 100% rename from tests/codegen/force-unwind-tables.rs rename to tests/codegen-llvm/force-unwind-tables.rs diff --git a/tests/codegen/frame-pointer-cli-control.rs b/tests/codegen-llvm/frame-pointer-cli-control.rs similarity index 100% rename from tests/codegen/frame-pointer-cli-control.rs rename to tests/codegen-llvm/frame-pointer-cli-control.rs diff --git a/tests/codegen/frame-pointer.rs b/tests/codegen-llvm/frame-pointer.rs similarity index 100% rename from tests/codegen/frame-pointer.rs rename to tests/codegen-llvm/frame-pointer.rs diff --git a/tests/codegen/function-arguments-noopt.rs b/tests/codegen-llvm/function-arguments-noopt.rs similarity index 100% rename from tests/codegen/function-arguments-noopt.rs rename to tests/codegen-llvm/function-arguments-noopt.rs diff --git a/tests/codegen/function-arguments.rs b/tests/codegen-llvm/function-arguments.rs similarity index 100% rename from tests/codegen/function-arguments.rs rename to tests/codegen-llvm/function-arguments.rs diff --git a/tests/codegen/function-return.rs b/tests/codegen-llvm/function-return.rs similarity index 100% rename from tests/codegen/function-return.rs rename to tests/codegen-llvm/function-return.rs diff --git a/tests/codegen/gdb_debug_script_load.rs b/tests/codegen-llvm/gdb_debug_script_load.rs similarity index 100% rename from tests/codegen/gdb_debug_script_load.rs rename to tests/codegen-llvm/gdb_debug_script_load.rs diff --git a/tests/codegen/generic-debug.rs b/tests/codegen-llvm/generic-debug.rs similarity index 100% rename from tests/codegen/generic-debug.rs rename to tests/codegen-llvm/generic-debug.rs diff --git a/tests/codegen/gep-index.rs b/tests/codegen-llvm/gep-index.rs similarity index 100% rename from tests/codegen/gep-index.rs rename to tests/codegen-llvm/gep-index.rs diff --git a/tests/codegen/gpu-kernel-abi.rs b/tests/codegen-llvm/gpu-kernel-abi.rs similarity index 100% rename from tests/codegen/gpu-kernel-abi.rs rename to tests/codegen-llvm/gpu-kernel-abi.rs diff --git a/tests/codegen/gpu_offload/gpu_host.rs b/tests/codegen-llvm/gpu_offload/gpu_host.rs similarity index 100% rename from tests/codegen/gpu_offload/gpu_host.rs rename to tests/codegen-llvm/gpu_offload/gpu_host.rs diff --git a/tests/codegen/hint/cold_path.rs b/tests/codegen-llvm/hint/cold_path.rs similarity index 100% rename from tests/codegen/hint/cold_path.rs rename to tests/codegen-llvm/hint/cold_path.rs diff --git a/tests/codegen/hint/likely.rs b/tests/codegen-llvm/hint/likely.rs similarity index 100% rename from tests/codegen/hint/likely.rs rename to tests/codegen-llvm/hint/likely.rs diff --git a/tests/codegen/hint/unlikely.rs b/tests/codegen-llvm/hint/unlikely.rs similarity index 100% rename from tests/codegen/hint/unlikely.rs rename to tests/codegen-llvm/hint/unlikely.rs diff --git a/tests/codegen/i128-wasm32-callconv.rs b/tests/codegen-llvm/i128-wasm32-callconv.rs similarity index 100% rename from tests/codegen/i128-wasm32-callconv.rs rename to tests/codegen-llvm/i128-wasm32-callconv.rs diff --git a/tests/codegen/i128-x86-align.rs b/tests/codegen-llvm/i128-x86-align.rs similarity index 100% rename from tests/codegen/i128-x86-align.rs rename to tests/codegen-llvm/i128-x86-align.rs diff --git a/tests/codegen/i128-x86-callconv.rs b/tests/codegen-llvm/i128-x86-callconv.rs similarity index 100% rename from tests/codegen/i128-x86-callconv.rs rename to tests/codegen-llvm/i128-x86-callconv.rs diff --git a/tests/codegen/infallible-unwrap-in-opt-z.rs b/tests/codegen-llvm/infallible-unwrap-in-opt-z.rs similarity index 100% rename from tests/codegen/infallible-unwrap-in-opt-z.rs rename to tests/codegen-llvm/infallible-unwrap-in-opt-z.rs diff --git a/tests/codegen/inherit_overflow.rs b/tests/codegen-llvm/inherit_overflow.rs similarity index 100% rename from tests/codegen/inherit_overflow.rs rename to tests/codegen-llvm/inherit_overflow.rs diff --git a/tests/codegen/inline-always-works-always.rs b/tests/codegen-llvm/inline-always-works-always.rs similarity index 100% rename from tests/codegen/inline-always-works-always.rs rename to tests/codegen-llvm/inline-always-works-always.rs diff --git a/tests/codegen/inline-debuginfo.rs b/tests/codegen-llvm/inline-debuginfo.rs similarity index 100% rename from tests/codegen/inline-debuginfo.rs rename to tests/codegen-llvm/inline-debuginfo.rs diff --git a/tests/codegen/inline-function-args-debug-info.rs b/tests/codegen-llvm/inline-function-args-debug-info.rs similarity index 100% rename from tests/codegen/inline-function-args-debug-info.rs rename to tests/codegen-llvm/inline-function-args-debug-info.rs diff --git a/tests/codegen/inline-hint.rs b/tests/codegen-llvm/inline-hint.rs similarity index 100% rename from tests/codegen/inline-hint.rs rename to tests/codegen-llvm/inline-hint.rs diff --git a/tests/codegen/instrument-coverage/instrument-coverage-off.rs b/tests/codegen-llvm/instrument-coverage/instrument-coverage-off.rs similarity index 100% rename from tests/codegen/instrument-coverage/instrument-coverage-off.rs rename to tests/codegen-llvm/instrument-coverage/instrument-coverage-off.rs diff --git a/tests/codegen/instrument-coverage/instrument-coverage.rs b/tests/codegen-llvm/instrument-coverage/instrument-coverage.rs similarity index 100% rename from tests/codegen/instrument-coverage/instrument-coverage.rs rename to tests/codegen-llvm/instrument-coverage/instrument-coverage.rs diff --git a/tests/codegen/instrument-coverage/testprog.rs b/tests/codegen-llvm/instrument-coverage/testprog.rs similarity index 100% rename from tests/codegen/instrument-coverage/testprog.rs rename to tests/codegen-llvm/instrument-coverage/testprog.rs diff --git a/tests/codegen/instrument-mcount.rs b/tests/codegen-llvm/instrument-mcount.rs similarity index 100% rename from tests/codegen/instrument-mcount.rs rename to tests/codegen-llvm/instrument-mcount.rs diff --git a/tests/codegen/instrument-xray/basic.rs b/tests/codegen-llvm/instrument-xray/basic.rs similarity index 100% rename from tests/codegen/instrument-xray/basic.rs rename to tests/codegen-llvm/instrument-xray/basic.rs diff --git a/tests/codegen/instrument-xray/options-combine.rs b/tests/codegen-llvm/instrument-xray/options-combine.rs similarity index 100% rename from tests/codegen/instrument-xray/options-combine.rs rename to tests/codegen-llvm/instrument-xray/options-combine.rs diff --git a/tests/codegen/instrument-xray/options-override.rs b/tests/codegen-llvm/instrument-xray/options-override.rs similarity index 100% rename from tests/codegen/instrument-xray/options-override.rs rename to tests/codegen-llvm/instrument-xray/options-override.rs diff --git a/tests/codegen/integer-cmp.rs b/tests/codegen-llvm/integer-cmp.rs similarity index 100% rename from tests/codegen/integer-cmp.rs rename to tests/codegen-llvm/integer-cmp.rs diff --git a/tests/codegen/integer-overflow.rs b/tests/codegen-llvm/integer-overflow.rs similarity index 100% rename from tests/codegen/integer-overflow.rs rename to tests/codegen-llvm/integer-overflow.rs diff --git a/tests/codegen/internalize-closures.rs b/tests/codegen-llvm/internalize-closures.rs similarity index 100% rename from tests/codegen/internalize-closures.rs rename to tests/codegen-llvm/internalize-closures.rs diff --git a/tests/codegen/intrinsic-no-unnamed-attr.rs b/tests/codegen-llvm/intrinsic-no-unnamed-attr.rs similarity index 100% rename from tests/codegen/intrinsic-no-unnamed-attr.rs rename to tests/codegen-llvm/intrinsic-no-unnamed-attr.rs diff --git a/tests/codegen/intrinsics/aggregate-thin-pointer.rs b/tests/codegen-llvm/intrinsics/aggregate-thin-pointer.rs similarity index 100% rename from tests/codegen/intrinsics/aggregate-thin-pointer.rs rename to tests/codegen-llvm/intrinsics/aggregate-thin-pointer.rs diff --git a/tests/codegen/intrinsics/carrying_mul_add.rs b/tests/codegen-llvm/intrinsics/carrying_mul_add.rs similarity index 100% rename from tests/codegen/intrinsics/carrying_mul_add.rs rename to tests/codegen-llvm/intrinsics/carrying_mul_add.rs diff --git a/tests/codegen/intrinsics/cold_path.rs b/tests/codegen-llvm/intrinsics/cold_path.rs similarity index 100% rename from tests/codegen/intrinsics/cold_path.rs rename to tests/codegen-llvm/intrinsics/cold_path.rs diff --git a/tests/codegen/intrinsics/cold_path2.rs b/tests/codegen-llvm/intrinsics/cold_path2.rs similarity index 100% rename from tests/codegen/intrinsics/cold_path2.rs rename to tests/codegen-llvm/intrinsics/cold_path2.rs diff --git a/tests/codegen/intrinsics/cold_path3.rs b/tests/codegen-llvm/intrinsics/cold_path3.rs similarity index 100% rename from tests/codegen/intrinsics/cold_path3.rs rename to tests/codegen-llvm/intrinsics/cold_path3.rs diff --git a/tests/codegen/intrinsics/compare_bytes.rs b/tests/codegen-llvm/intrinsics/compare_bytes.rs similarity index 100% rename from tests/codegen/intrinsics/compare_bytes.rs rename to tests/codegen-llvm/intrinsics/compare_bytes.rs diff --git a/tests/codegen/intrinsics/const_eval_select.rs b/tests/codegen-llvm/intrinsics/const_eval_select.rs similarity index 100% rename from tests/codegen/intrinsics/const_eval_select.rs rename to tests/codegen-llvm/intrinsics/const_eval_select.rs diff --git a/tests/codegen/intrinsics/ctlz.rs b/tests/codegen-llvm/intrinsics/ctlz.rs similarity index 100% rename from tests/codegen/intrinsics/ctlz.rs rename to tests/codegen-llvm/intrinsics/ctlz.rs diff --git a/tests/codegen/intrinsics/ctpop.rs b/tests/codegen-llvm/intrinsics/ctpop.rs similarity index 100% rename from tests/codegen/intrinsics/ctpop.rs rename to tests/codegen-llvm/intrinsics/ctpop.rs diff --git a/tests/codegen/intrinsics/disjoint_bitor.rs b/tests/codegen-llvm/intrinsics/disjoint_bitor.rs similarity index 100% rename from tests/codegen/intrinsics/disjoint_bitor.rs rename to tests/codegen-llvm/intrinsics/disjoint_bitor.rs diff --git a/tests/codegen/intrinsics/exact_div.rs b/tests/codegen-llvm/intrinsics/exact_div.rs similarity index 100% rename from tests/codegen/intrinsics/exact_div.rs rename to tests/codegen-llvm/intrinsics/exact_div.rs diff --git a/tests/codegen/intrinsics/likely.rs b/tests/codegen-llvm/intrinsics/likely.rs similarity index 100% rename from tests/codegen/intrinsics/likely.rs rename to tests/codegen-llvm/intrinsics/likely.rs diff --git a/tests/codegen/intrinsics/likely_assert.rs b/tests/codegen-llvm/intrinsics/likely_assert.rs similarity index 100% rename from tests/codegen/intrinsics/likely_assert.rs rename to tests/codegen-llvm/intrinsics/likely_assert.rs diff --git a/tests/codegen/intrinsics/mask.rs b/tests/codegen-llvm/intrinsics/mask.rs similarity index 100% rename from tests/codegen/intrinsics/mask.rs rename to tests/codegen-llvm/intrinsics/mask.rs diff --git a/tests/codegen/intrinsics/nontemporal.rs b/tests/codegen-llvm/intrinsics/nontemporal.rs similarity index 100% rename from tests/codegen/intrinsics/nontemporal.rs rename to tests/codegen-llvm/intrinsics/nontemporal.rs diff --git a/tests/codegen/intrinsics/offset.rs b/tests/codegen-llvm/intrinsics/offset.rs similarity index 100% rename from tests/codegen/intrinsics/offset.rs rename to tests/codegen-llvm/intrinsics/offset.rs diff --git a/tests/codegen/intrinsics/offset_from.rs b/tests/codegen-llvm/intrinsics/offset_from.rs similarity index 100% rename from tests/codegen/intrinsics/offset_from.rs rename to tests/codegen-llvm/intrinsics/offset_from.rs diff --git a/tests/codegen/intrinsics/prefetch.rs b/tests/codegen-llvm/intrinsics/prefetch.rs similarity index 100% rename from tests/codegen/intrinsics/prefetch.rs rename to tests/codegen-llvm/intrinsics/prefetch.rs diff --git a/tests/codegen/intrinsics/ptr_metadata.rs b/tests/codegen-llvm/intrinsics/ptr_metadata.rs similarity index 100% rename from tests/codegen/intrinsics/ptr_metadata.rs rename to tests/codegen-llvm/intrinsics/ptr_metadata.rs diff --git a/tests/codegen/intrinsics/rotate_left.rs b/tests/codegen-llvm/intrinsics/rotate_left.rs similarity index 100% rename from tests/codegen/intrinsics/rotate_left.rs rename to tests/codegen-llvm/intrinsics/rotate_left.rs diff --git a/tests/codegen/intrinsics/rustc_intrinsic_must_be_overridden.rs b/tests/codegen-llvm/intrinsics/rustc_intrinsic_must_be_overridden.rs similarity index 100% rename from tests/codegen/intrinsics/rustc_intrinsic_must_be_overridden.rs rename to tests/codegen-llvm/intrinsics/rustc_intrinsic_must_be_overridden.rs diff --git a/tests/codegen/intrinsics/select_unpredictable.rs b/tests/codegen-llvm/intrinsics/select_unpredictable.rs similarity index 100% rename from tests/codegen/intrinsics/select_unpredictable.rs rename to tests/codegen-llvm/intrinsics/select_unpredictable.rs diff --git a/tests/codegen/intrinsics/three_way_compare.rs b/tests/codegen-llvm/intrinsics/three_way_compare.rs similarity index 100% rename from tests/codegen/intrinsics/three_way_compare.rs rename to tests/codegen-llvm/intrinsics/three_way_compare.rs diff --git a/tests/codegen/intrinsics/transmute-niched.rs b/tests/codegen-llvm/intrinsics/transmute-niched.rs similarity index 100% rename from tests/codegen/intrinsics/transmute-niched.rs rename to tests/codegen-llvm/intrinsics/transmute-niched.rs diff --git a/tests/codegen/intrinsics/transmute-x64.rs b/tests/codegen-llvm/intrinsics/transmute-x64.rs similarity index 100% rename from tests/codegen/intrinsics/transmute-x64.rs rename to tests/codegen-llvm/intrinsics/transmute-x64.rs diff --git a/tests/codegen/intrinsics/transmute.rs b/tests/codegen-llvm/intrinsics/transmute.rs similarity index 100% rename from tests/codegen/intrinsics/transmute.rs rename to tests/codegen-llvm/intrinsics/transmute.rs diff --git a/tests/codegen/intrinsics/typed_swap.rs b/tests/codegen-llvm/intrinsics/typed_swap.rs similarity index 100% rename from tests/codegen/intrinsics/typed_swap.rs rename to tests/codegen-llvm/intrinsics/typed_swap.rs diff --git a/tests/codegen/intrinsics/unchecked_math.rs b/tests/codegen-llvm/intrinsics/unchecked_math.rs similarity index 100% rename from tests/codegen/intrinsics/unchecked_math.rs rename to tests/codegen-llvm/intrinsics/unchecked_math.rs diff --git a/tests/codegen/intrinsics/unlikely.rs b/tests/codegen-llvm/intrinsics/unlikely.rs similarity index 100% rename from tests/codegen/intrinsics/unlikely.rs rename to tests/codegen-llvm/intrinsics/unlikely.rs diff --git a/tests/codegen/intrinsics/volatile.rs b/tests/codegen-llvm/intrinsics/volatile.rs similarity index 100% rename from tests/codegen/intrinsics/volatile.rs rename to tests/codegen-llvm/intrinsics/volatile.rs diff --git a/tests/codegen/intrinsics/volatile_order.rs b/tests/codegen-llvm/intrinsics/volatile_order.rs similarity index 100% rename from tests/codegen/intrinsics/volatile_order.rs rename to tests/codegen-llvm/intrinsics/volatile_order.rs diff --git a/tests/codegen/is_val_statically_known.rs b/tests/codegen-llvm/is_val_statically_known.rs similarity index 100% rename from tests/codegen/is_val_statically_known.rs rename to tests/codegen-llvm/is_val_statically_known.rs diff --git a/tests/codegen/issue-97217.rs b/tests/codegen-llvm/issue-97217.rs similarity index 100% rename from tests/codegen/issue-97217.rs rename to tests/codegen-llvm/issue-97217.rs diff --git a/tests/codegen/issues/issue-101048.rs b/tests/codegen-llvm/issues/issue-101048.rs similarity index 100% rename from tests/codegen/issues/issue-101048.rs rename to tests/codegen-llvm/issues/issue-101048.rs diff --git a/tests/codegen/issues/issue-101082.rs b/tests/codegen-llvm/issues/issue-101082.rs similarity index 100% rename from tests/codegen/issues/issue-101082.rs rename to tests/codegen-llvm/issues/issue-101082.rs diff --git a/tests/codegen/issues/issue-101814.rs b/tests/codegen-llvm/issues/issue-101814.rs similarity index 100% rename from tests/codegen/issues/issue-101814.rs rename to tests/codegen-llvm/issues/issue-101814.rs diff --git a/tests/codegen/issues/issue-103132.rs b/tests/codegen-llvm/issues/issue-103132.rs similarity index 100% rename from tests/codegen/issues/issue-103132.rs rename to tests/codegen-llvm/issues/issue-103132.rs diff --git a/tests/codegen/issues/issue-103285-ptr-addr-overflow-check.rs b/tests/codegen-llvm/issues/issue-103285-ptr-addr-overflow-check.rs similarity index 100% rename from tests/codegen/issues/issue-103285-ptr-addr-overflow-check.rs rename to tests/codegen-llvm/issues/issue-103285-ptr-addr-overflow-check.rs diff --git a/tests/codegen/issues/issue-103327.rs b/tests/codegen-llvm/issues/issue-103327.rs similarity index 100% rename from tests/codegen/issues/issue-103327.rs rename to tests/codegen-llvm/issues/issue-103327.rs diff --git a/tests/codegen/issues/issue-103840.rs b/tests/codegen-llvm/issues/issue-103840.rs similarity index 100% rename from tests/codegen/issues/issue-103840.rs rename to tests/codegen-llvm/issues/issue-103840.rs diff --git a/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs b/tests/codegen-llvm/issues/issue-105386-ub-in-debuginfo.rs similarity index 100% rename from tests/codegen/issues/issue-105386-ub-in-debuginfo.rs rename to tests/codegen-llvm/issues/issue-105386-ub-in-debuginfo.rs diff --git a/tests/codegen/issues/issue-106369.rs b/tests/codegen-llvm/issues/issue-106369.rs similarity index 100% rename from tests/codegen/issues/issue-106369.rs rename to tests/codegen-llvm/issues/issue-106369.rs diff --git a/tests/codegen/issues/issue-107681-unwrap_unchecked.rs b/tests/codegen-llvm/issues/issue-107681-unwrap_unchecked.rs similarity index 100% rename from tests/codegen/issues/issue-107681-unwrap_unchecked.rs rename to tests/codegen-llvm/issues/issue-107681-unwrap_unchecked.rs diff --git a/tests/codegen/issues/issue-108395-branchy-bool-match.rs b/tests/codegen-llvm/issues/issue-108395-branchy-bool-match.rs similarity index 100% rename from tests/codegen/issues/issue-108395-branchy-bool-match.rs rename to tests/codegen-llvm/issues/issue-108395-branchy-bool-match.rs diff --git a/tests/codegen/issues/issue-109328-split_first.rs b/tests/codegen-llvm/issues/issue-109328-split_first.rs similarity index 100% rename from tests/codegen/issues/issue-109328-split_first.rs rename to tests/codegen-llvm/issues/issue-109328-split_first.rs diff --git a/tests/codegen/issues/issue-110797-enum-jump-same.rs b/tests/codegen-llvm/issues/issue-110797-enum-jump-same.rs similarity index 100% rename from tests/codegen/issues/issue-110797-enum-jump-same.rs rename to tests/codegen-llvm/issues/issue-110797-enum-jump-same.rs diff --git a/tests/codegen/issues/issue-111603.rs b/tests/codegen-llvm/issues/issue-111603.rs similarity index 100% rename from tests/codegen/issues/issue-111603.rs rename to tests/codegen-llvm/issues/issue-111603.rs diff --git a/tests/codegen/issues/issue-112509-slice-get-andthen-get.rs b/tests/codegen-llvm/issues/issue-112509-slice-get-andthen-get.rs similarity index 100% rename from tests/codegen/issues/issue-112509-slice-get-andthen-get.rs rename to tests/codegen-llvm/issues/issue-112509-slice-get-andthen-get.rs diff --git a/tests/codegen/issues/issue-113757-bounds-check-after-cmp-max.rs b/tests/codegen-llvm/issues/issue-113757-bounds-check-after-cmp-max.rs similarity index 100% rename from tests/codegen/issues/issue-113757-bounds-check-after-cmp-max.rs rename to tests/codegen-llvm/issues/issue-113757-bounds-check-after-cmp-max.rs diff --git a/tests/codegen/issues/issue-114312.rs b/tests/codegen-llvm/issues/issue-114312.rs similarity index 100% rename from tests/codegen/issues/issue-114312.rs rename to tests/codegen-llvm/issues/issue-114312.rs diff --git a/tests/codegen/issues/issue-115385-llvm-jump-threading.rs b/tests/codegen-llvm/issues/issue-115385-llvm-jump-threading.rs similarity index 100% rename from tests/codegen/issues/issue-115385-llvm-jump-threading.rs rename to tests/codegen-llvm/issues/issue-115385-llvm-jump-threading.rs diff --git a/tests/codegen/issues/issue-116878.rs b/tests/codegen-llvm/issues/issue-116878.rs similarity index 100% rename from tests/codegen/issues/issue-116878.rs rename to tests/codegen-llvm/issues/issue-116878.rs diff --git a/tests/codegen/issues/issue-118306.rs b/tests/codegen-llvm/issues/issue-118306.rs similarity index 100% rename from tests/codegen/issues/issue-118306.rs rename to tests/codegen-llvm/issues/issue-118306.rs diff --git a/tests/codegen/issues/issue-118392.rs b/tests/codegen-llvm/issues/issue-118392.rs similarity index 100% rename from tests/codegen/issues/issue-118392.rs rename to tests/codegen-llvm/issues/issue-118392.rs diff --git a/tests/codegen/issues/issue-119422.rs b/tests/codegen-llvm/issues/issue-119422.rs similarity index 100% rename from tests/codegen/issues/issue-119422.rs rename to tests/codegen-llvm/issues/issue-119422.rs diff --git a/tests/codegen/issues/issue-121719-common-field-offset.rs b/tests/codegen-llvm/issues/issue-121719-common-field-offset.rs similarity index 100% rename from tests/codegen/issues/issue-121719-common-field-offset.rs rename to tests/codegen-llvm/issues/issue-121719-common-field-offset.rs diff --git a/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs b/tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs similarity index 100% rename from tests/codegen/issues/issue-122600-ptr-discriminant-update.rs rename to tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs diff --git a/tests/codegen/issues/issue-123712-str-to-lower-autovectorization.rs b/tests/codegen-llvm/issues/issue-123712-str-to-lower-autovectorization.rs similarity index 100% rename from tests/codegen/issues/issue-123712-str-to-lower-autovectorization.rs rename to tests/codegen-llvm/issues/issue-123712-str-to-lower-autovectorization.rs diff --git a/tests/codegen/issues/issue-126585.rs b/tests/codegen-llvm/issues/issue-126585.rs similarity index 100% rename from tests/codegen/issues/issue-126585.rs rename to tests/codegen-llvm/issues/issue-126585.rs diff --git a/tests/codegen/issues/issue-129795.rs b/tests/codegen-llvm/issues/issue-129795.rs similarity index 100% rename from tests/codegen/issues/issue-129795.rs rename to tests/codegen-llvm/issues/issue-129795.rs diff --git a/tests/codegen/issues/issue-13018.rs b/tests/codegen-llvm/issues/issue-13018.rs similarity index 100% rename from tests/codegen/issues/issue-13018.rs rename to tests/codegen-llvm/issues/issue-13018.rs diff --git a/tests/codegen/issues/issue-136329-optnone-noinline.rs b/tests/codegen-llvm/issues/issue-136329-optnone-noinline.rs similarity index 100% rename from tests/codegen/issues/issue-136329-optnone-noinline.rs rename to tests/codegen-llvm/issues/issue-136329-optnone-noinline.rs diff --git a/tests/codegen/issues/issue-15953.rs b/tests/codegen-llvm/issues/issue-15953.rs similarity index 100% rename from tests/codegen/issues/issue-15953.rs rename to tests/codegen-llvm/issues/issue-15953.rs diff --git a/tests/codegen/issues/issue-27130.rs b/tests/codegen-llvm/issues/issue-27130.rs similarity index 100% rename from tests/codegen/issues/issue-27130.rs rename to tests/codegen-llvm/issues/issue-27130.rs diff --git a/tests/codegen/issues/issue-32031.rs b/tests/codegen-llvm/issues/issue-32031.rs similarity index 100% rename from tests/codegen/issues/issue-32031.rs rename to tests/codegen-llvm/issues/issue-32031.rs diff --git a/tests/codegen/issues/issue-32364.rs b/tests/codegen-llvm/issues/issue-32364.rs similarity index 100% rename from tests/codegen/issues/issue-32364.rs rename to tests/codegen-llvm/issues/issue-32364.rs diff --git a/tests/codegen/issues/issue-34634.rs b/tests/codegen-llvm/issues/issue-34634.rs similarity index 100% rename from tests/codegen/issues/issue-34634.rs rename to tests/codegen-llvm/issues/issue-34634.rs diff --git a/tests/codegen/issues/issue-34947-pow-i32.rs b/tests/codegen-llvm/issues/issue-34947-pow-i32.rs similarity index 100% rename from tests/codegen/issues/issue-34947-pow-i32.rs rename to tests/codegen-llvm/issues/issue-34947-pow-i32.rs diff --git a/tests/codegen/issues/issue-36010-some-box-is_some.rs b/tests/codegen-llvm/issues/issue-36010-some-box-is_some.rs similarity index 100% rename from tests/codegen/issues/issue-36010-some-box-is_some.rs rename to tests/codegen-llvm/issues/issue-36010-some-box-is_some.rs diff --git a/tests/codegen/issues/issue-37945.rs b/tests/codegen-llvm/issues/issue-37945.rs similarity index 100% rename from tests/codegen/issues/issue-37945.rs rename to tests/codegen-llvm/issues/issue-37945.rs diff --git a/tests/codegen/issues/issue-45222.rs b/tests/codegen-llvm/issues/issue-45222.rs similarity index 100% rename from tests/codegen/issues/issue-45222.rs rename to tests/codegen-llvm/issues/issue-45222.rs diff --git a/tests/codegen/issues/issue-45466.rs b/tests/codegen-llvm/issues/issue-45466.rs similarity index 100% rename from tests/codegen/issues/issue-45466.rs rename to tests/codegen-llvm/issues/issue-45466.rs diff --git a/tests/codegen/issues/issue-45964-bounds-check-slice-pos.rs b/tests/codegen-llvm/issues/issue-45964-bounds-check-slice-pos.rs similarity index 100% rename from tests/codegen/issues/issue-45964-bounds-check-slice-pos.rs rename to tests/codegen-llvm/issues/issue-45964-bounds-check-slice-pos.rs diff --git a/tests/codegen/issues/issue-47278.rs b/tests/codegen-llvm/issues/issue-47278.rs similarity index 100% rename from tests/codegen/issues/issue-47278.rs rename to tests/codegen-llvm/issues/issue-47278.rs diff --git a/tests/codegen/issues/issue-47442.rs b/tests/codegen-llvm/issues/issue-47442.rs similarity index 100% rename from tests/codegen/issues/issue-47442.rs rename to tests/codegen-llvm/issues/issue-47442.rs diff --git a/tests/codegen/issues/issue-56267-2.rs b/tests/codegen-llvm/issues/issue-56267-2.rs similarity index 100% rename from tests/codegen/issues/issue-56267-2.rs rename to tests/codegen-llvm/issues/issue-56267-2.rs diff --git a/tests/codegen/issues/issue-56267.rs b/tests/codegen-llvm/issues/issue-56267.rs similarity index 100% rename from tests/codegen/issues/issue-56267.rs rename to tests/codegen-llvm/issues/issue-56267.rs diff --git a/tests/codegen/issues/issue-56927.rs b/tests/codegen-llvm/issues/issue-56927.rs similarity index 100% rename from tests/codegen/issues/issue-56927.rs rename to tests/codegen-llvm/issues/issue-56927.rs diff --git a/tests/codegen/issues/issue-58881.rs b/tests/codegen-llvm/issues/issue-58881.rs similarity index 100% rename from tests/codegen/issues/issue-58881.rs rename to tests/codegen-llvm/issues/issue-58881.rs diff --git a/tests/codegen/issues/issue-59352.rs b/tests/codegen-llvm/issues/issue-59352.rs similarity index 100% rename from tests/codegen/issues/issue-59352.rs rename to tests/codegen-llvm/issues/issue-59352.rs diff --git a/tests/codegen/issues/issue-64219-fn-ptr-call-returning-never-is-noreturn.rs b/tests/codegen-llvm/issues/issue-64219-fn-ptr-call-returning-never-is-noreturn.rs similarity index 100% rename from tests/codegen/issues/issue-64219-fn-ptr-call-returning-never-is-noreturn.rs rename to tests/codegen-llvm/issues/issue-64219-fn-ptr-call-returning-never-is-noreturn.rs diff --git a/tests/codegen/issues/issue-68667-unwrap-combinators.rs b/tests/codegen-llvm/issues/issue-68667-unwrap-combinators.rs similarity index 100% rename from tests/codegen/issues/issue-68667-unwrap-combinators.rs rename to tests/codegen-llvm/issues/issue-68667-unwrap-combinators.rs diff --git a/tests/codegen/issues/issue-69101-bounds-check.rs b/tests/codegen-llvm/issues/issue-69101-bounds-check.rs similarity index 100% rename from tests/codegen/issues/issue-69101-bounds-check.rs rename to tests/codegen-llvm/issues/issue-69101-bounds-check.rs diff --git a/tests/codegen/issues/issue-73031.rs b/tests/codegen-llvm/issues/issue-73031.rs similarity index 100% rename from tests/codegen/issues/issue-73031.rs rename to tests/codegen-llvm/issues/issue-73031.rs diff --git a/tests/codegen/issues/issue-73258.rs b/tests/codegen-llvm/issues/issue-73258.rs similarity index 100% rename from tests/codegen/issues/issue-73258.rs rename to tests/codegen-llvm/issues/issue-73258.rs diff --git a/tests/codegen/issues/issue-73338-effecient-cmp.rs b/tests/codegen-llvm/issues/issue-73338-effecient-cmp.rs similarity index 100% rename from tests/codegen/issues/issue-73338-effecient-cmp.rs rename to tests/codegen-llvm/issues/issue-73338-effecient-cmp.rs diff --git a/tests/codegen/issues/issue-73396-bounds-check-after-position.rs b/tests/codegen-llvm/issues/issue-73396-bounds-check-after-position.rs similarity index 100% rename from tests/codegen/issues/issue-73396-bounds-check-after-position.rs rename to tests/codegen-llvm/issues/issue-73396-bounds-check-after-position.rs diff --git a/tests/codegen/issues/issue-73827-bounds-check-index-in-subexpr.rs b/tests/codegen-llvm/issues/issue-73827-bounds-check-index-in-subexpr.rs similarity index 100% rename from tests/codegen/issues/issue-73827-bounds-check-index-in-subexpr.rs rename to tests/codegen-llvm/issues/issue-73827-bounds-check-index-in-subexpr.rs diff --git a/tests/codegen/issues/issue-74938-array-split-at.rs b/tests/codegen-llvm/issues/issue-74938-array-split-at.rs similarity index 100% rename from tests/codegen/issues/issue-74938-array-split-at.rs rename to tests/codegen-llvm/issues/issue-74938-array-split-at.rs diff --git a/tests/codegen/issues/issue-75525-bounds-checks.rs b/tests/codegen-llvm/issues/issue-75525-bounds-checks.rs similarity index 100% rename from tests/codegen/issues/issue-75525-bounds-checks.rs rename to tests/codegen-llvm/issues/issue-75525-bounds-checks.rs diff --git a/tests/codegen/issues/issue-75546.rs b/tests/codegen-llvm/issues/issue-75546.rs similarity index 100% rename from tests/codegen/issues/issue-75546.rs rename to tests/codegen-llvm/issues/issue-75546.rs diff --git a/tests/codegen/issues/issue-75659.rs b/tests/codegen-llvm/issues/issue-75659.rs similarity index 100% rename from tests/codegen/issues/issue-75659.rs rename to tests/codegen-llvm/issues/issue-75659.rs diff --git a/tests/codegen/issues/issue-75978.rs b/tests/codegen-llvm/issues/issue-75978.rs similarity index 100% rename from tests/codegen/issues/issue-75978.rs rename to tests/codegen-llvm/issues/issue-75978.rs diff --git a/tests/codegen/issues/issue-77812.rs b/tests/codegen-llvm/issues/issue-77812.rs similarity index 100% rename from tests/codegen/issues/issue-77812.rs rename to tests/codegen-llvm/issues/issue-77812.rs diff --git a/tests/codegen/issues/issue-84268.rs b/tests/codegen-llvm/issues/issue-84268.rs similarity index 100% rename from tests/codegen/issues/issue-84268.rs rename to tests/codegen-llvm/issues/issue-84268.rs diff --git a/tests/codegen/issues/issue-85872-multiple-reverse.rs b/tests/codegen-llvm/issues/issue-85872-multiple-reverse.rs similarity index 100% rename from tests/codegen/issues/issue-85872-multiple-reverse.rs rename to tests/codegen-llvm/issues/issue-85872-multiple-reverse.rs diff --git a/tests/codegen/issues/issue-86106.rs b/tests/codegen-llvm/issues/issue-86106.rs similarity index 100% rename from tests/codegen/issues/issue-86106.rs rename to tests/codegen-llvm/issues/issue-86106.rs diff --git a/tests/codegen/issues/issue-86109-eliminate-div-by-zero-check.rs b/tests/codegen-llvm/issues/issue-86109-eliminate-div-by-zero-check.rs similarity index 100% rename from tests/codegen/issues/issue-86109-eliminate-div-by-zero-check.rs rename to tests/codegen-llvm/issues/issue-86109-eliminate-div-by-zero-check.rs diff --git a/tests/codegen/issues/issue-93036-assert-index.rs b/tests/codegen-llvm/issues/issue-93036-assert-index.rs similarity index 100% rename from tests/codegen/issues/issue-93036-assert-index.rs rename to tests/codegen-llvm/issues/issue-93036-assert-index.rs diff --git a/tests/codegen/issues/issue-96274.rs b/tests/codegen-llvm/issues/issue-96274.rs similarity index 100% rename from tests/codegen/issues/issue-96274.rs rename to tests/codegen-llvm/issues/issue-96274.rs diff --git a/tests/codegen/issues/issue-96497-slice-size-nowrap.rs b/tests/codegen-llvm/issues/issue-96497-slice-size-nowrap.rs similarity index 100% rename from tests/codegen/issues/issue-96497-slice-size-nowrap.rs rename to tests/codegen-llvm/issues/issue-96497-slice-size-nowrap.rs diff --git a/tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs b/tests/codegen-llvm/issues/issue-98294-get-mut-copy-from-slice-opt.rs similarity index 100% rename from tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs rename to tests/codegen-llvm/issues/issue-98294-get-mut-copy-from-slice-opt.rs diff --git a/tests/codegen/issues/issue-98678-async.rs b/tests/codegen-llvm/issues/issue-98678-async.rs similarity index 100% rename from tests/codegen/issues/issue-98678-async.rs rename to tests/codegen-llvm/issues/issue-98678-async.rs diff --git a/tests/codegen/issues/issue-98678-closure-coroutine.rs b/tests/codegen-llvm/issues/issue-98678-closure-coroutine.rs similarity index 100% rename from tests/codegen/issues/issue-98678-closure-coroutine.rs rename to tests/codegen-llvm/issues/issue-98678-closure-coroutine.rs diff --git a/tests/codegen/issues/issue-98678-enum.rs b/tests/codegen-llvm/issues/issue-98678-enum.rs similarity index 100% rename from tests/codegen/issues/issue-98678-enum.rs rename to tests/codegen-llvm/issues/issue-98678-enum.rs diff --git a/tests/codegen/issues/issue-98678-struct-union.rs b/tests/codegen-llvm/issues/issue-98678-struct-union.rs similarity index 100% rename from tests/codegen/issues/issue-98678-struct-union.rs rename to tests/codegen-llvm/issues/issue-98678-struct-union.rs diff --git a/tests/codegen/issues/issue-99960.rs b/tests/codegen-llvm/issues/issue-99960.rs similarity index 100% rename from tests/codegen/issues/issue-99960.rs rename to tests/codegen-llvm/issues/issue-99960.rs diff --git a/tests/codegen/issues/looping-over-ne-bytes-133528.rs b/tests/codegen-llvm/issues/looping-over-ne-bytes-133528.rs similarity index 100% rename from tests/codegen/issues/looping-over-ne-bytes-133528.rs rename to tests/codegen-llvm/issues/looping-over-ne-bytes-133528.rs diff --git a/tests/codegen/issues/str-to-string-128690.rs b/tests/codegen-llvm/issues/str-to-string-128690.rs similarity index 100% rename from tests/codegen/issues/str-to-string-128690.rs rename to tests/codegen-llvm/issues/str-to-string-128690.rs diff --git a/tests/codegen/iter-repeat-n-trivial-drop.rs b/tests/codegen-llvm/iter-repeat-n-trivial-drop.rs similarity index 100% rename from tests/codegen/iter-repeat-n-trivial-drop.rs rename to tests/codegen-llvm/iter-repeat-n-trivial-drop.rs diff --git a/tests/codegen/layout-size-checks.rs b/tests/codegen-llvm/layout-size-checks.rs similarity index 100% rename from tests/codegen/layout-size-checks.rs rename to tests/codegen-llvm/layout-size-checks.rs diff --git a/tests/codegen/lib-optimizations/iter-sum.rs b/tests/codegen-llvm/lib-optimizations/iter-sum.rs similarity index 100% rename from tests/codegen/lib-optimizations/iter-sum.rs rename to tests/codegen-llvm/lib-optimizations/iter-sum.rs diff --git a/tests/codegen/lib-optimizations/slice_rotate.rs b/tests/codegen-llvm/lib-optimizations/slice_rotate.rs similarity index 100% rename from tests/codegen/lib-optimizations/slice_rotate.rs rename to tests/codegen-llvm/lib-optimizations/slice_rotate.rs diff --git a/tests/codegen/lifetime_start_end.rs b/tests/codegen-llvm/lifetime_start_end.rs similarity index 100% rename from tests/codegen/lifetime_start_end.rs rename to tests/codegen-llvm/lifetime_start_end.rs diff --git a/tests/codegen/link-dead-code.rs b/tests/codegen-llvm/link-dead-code.rs similarity index 100% rename from tests/codegen/link-dead-code.rs rename to tests/codegen-llvm/link-dead-code.rs diff --git a/tests/codegen/link_section.rs b/tests/codegen-llvm/link_section.rs similarity index 100% rename from tests/codegen/link_section.rs rename to tests/codegen-llvm/link_section.rs diff --git a/tests/codegen/llvm-ident.rs b/tests/codegen-llvm/llvm-ident.rs similarity index 100% rename from tests/codegen/llvm-ident.rs rename to tests/codegen-llvm/llvm-ident.rs diff --git a/tests/codegen/llvm_module_flags.rs b/tests/codegen-llvm/llvm_module_flags.rs similarity index 100% rename from tests/codegen/llvm_module_flags.rs rename to tests/codegen-llvm/llvm_module_flags.rs diff --git a/tests/codegen/loads.rs b/tests/codegen-llvm/loads.rs similarity index 100% rename from tests/codegen/loads.rs rename to tests/codegen-llvm/loads.rs diff --git a/tests/codegen/local-generics-in-exe-internalized.rs b/tests/codegen-llvm/local-generics-in-exe-internalized.rs similarity index 100% rename from tests/codegen/local-generics-in-exe-internalized.rs rename to tests/codegen-llvm/local-generics-in-exe-internalized.rs diff --git a/tests/codegen/loongarch-abi/call-llvm-intrinsics.rs b/tests/codegen-llvm/loongarch-abi/call-llvm-intrinsics.rs similarity index 100% rename from tests/codegen/loongarch-abi/call-llvm-intrinsics.rs rename to tests/codegen-llvm/loongarch-abi/call-llvm-intrinsics.rs diff --git a/tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs b/tests/codegen-llvm/loongarch-abi/loongarch64-lp64d-abi.rs similarity index 100% rename from tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs rename to tests/codegen-llvm/loongarch-abi/loongarch64-lp64d-abi.rs diff --git a/tests/codegen/lto-removes-invokes.rs b/tests/codegen-llvm/lto-removes-invokes.rs similarity index 100% rename from tests/codegen/lto-removes-invokes.rs rename to tests/codegen-llvm/lto-removes-invokes.rs diff --git a/tests/codegen/macos/i686-macosx-deployment-target.rs b/tests/codegen-llvm/macos/i686-macosx-deployment-target.rs similarity index 100% rename from tests/codegen/macos/i686-macosx-deployment-target.rs rename to tests/codegen-llvm/macos/i686-macosx-deployment-target.rs diff --git a/tests/codegen/macos/i686-no-macosx-deployment-target.rs b/tests/codegen-llvm/macos/i686-no-macosx-deployment-target.rs similarity index 100% rename from tests/codegen/macos/i686-no-macosx-deployment-target.rs rename to tests/codegen-llvm/macos/i686-no-macosx-deployment-target.rs diff --git a/tests/codegen/macos/x86_64-macosx-deployment-target.rs b/tests/codegen-llvm/macos/x86_64-macosx-deployment-target.rs similarity index 100% rename from tests/codegen/macos/x86_64-macosx-deployment-target.rs rename to tests/codegen-llvm/macos/x86_64-macosx-deployment-target.rs diff --git a/tests/codegen/macos/x86_64-no-macosx-deployment-target.rs b/tests/codegen-llvm/macos/x86_64-no-macosx-deployment-target.rs similarity index 100% rename from tests/codegen/macos/x86_64-no-macosx-deployment-target.rs rename to tests/codegen-llvm/macos/x86_64-no-macosx-deployment-target.rs diff --git a/tests/codegen/mainsubprogram.rs b/tests/codegen-llvm/mainsubprogram.rs similarity index 100% rename from tests/codegen/mainsubprogram.rs rename to tests/codegen-llvm/mainsubprogram.rs diff --git a/tests/codegen/match-optimized.rs b/tests/codegen-llvm/match-optimized.rs similarity index 100% rename from tests/codegen/match-optimized.rs rename to tests/codegen-llvm/match-optimized.rs diff --git a/tests/codegen/match-optimizes-away.rs b/tests/codegen-llvm/match-optimizes-away.rs similarity index 100% rename from tests/codegen/match-optimizes-away.rs rename to tests/codegen-llvm/match-optimizes-away.rs diff --git a/tests/codegen/match-unoptimized.rs b/tests/codegen-llvm/match-unoptimized.rs similarity index 100% rename from tests/codegen/match-unoptimized.rs rename to tests/codegen-llvm/match-unoptimized.rs diff --git a/tests/codegen/maybeuninit-rvo.rs b/tests/codegen-llvm/maybeuninit-rvo.rs similarity index 100% rename from tests/codegen/maybeuninit-rvo.rs rename to tests/codegen-llvm/maybeuninit-rvo.rs diff --git a/tests/codegen/mem-replace-big-type.rs b/tests/codegen-llvm/mem-replace-big-type.rs similarity index 100% rename from tests/codegen/mem-replace-big-type.rs rename to tests/codegen-llvm/mem-replace-big-type.rs diff --git a/tests/codegen/mem-replace-simple-type.rs b/tests/codegen-llvm/mem-replace-simple-type.rs similarity index 100% rename from tests/codegen/mem-replace-simple-type.rs rename to tests/codegen-llvm/mem-replace-simple-type.rs diff --git a/tests/codegen/merge-functions.rs b/tests/codegen-llvm/merge-functions.rs similarity index 100% rename from tests/codegen/merge-functions.rs rename to tests/codegen-llvm/merge-functions.rs diff --git a/tests/codegen/meta-filecheck/check-prefix.rs b/tests/codegen-llvm/meta-filecheck/check-prefix.rs similarity index 100% rename from tests/codegen/meta-filecheck/check-prefix.rs rename to tests/codegen-llvm/meta-filecheck/check-prefix.rs diff --git a/tests/codegen/meta-filecheck/filecheck-flags.rs b/tests/codegen-llvm/meta-filecheck/filecheck-flags.rs similarity index 100% rename from tests/codegen/meta-filecheck/filecheck-flags.rs rename to tests/codegen-llvm/meta-filecheck/filecheck-flags.rs diff --git a/tests/codegen/meta-filecheck/msvc-prefix-bad.rs b/tests/codegen-llvm/meta-filecheck/msvc-prefix-bad.rs similarity index 100% rename from tests/codegen/meta-filecheck/msvc-prefix-bad.rs rename to tests/codegen-llvm/meta-filecheck/msvc-prefix-bad.rs diff --git a/tests/codegen/meta-filecheck/no-directives.rs b/tests/codegen-llvm/meta-filecheck/no-directives.rs similarity index 100% rename from tests/codegen/meta-filecheck/no-directives.rs rename to tests/codegen-llvm/meta-filecheck/no-directives.rs diff --git a/tests/codegen/meta-filecheck/revision-prefix.rs b/tests/codegen-llvm/meta-filecheck/revision-prefix.rs similarity index 100% rename from tests/codegen/meta-filecheck/revision-prefix.rs rename to tests/codegen-llvm/meta-filecheck/revision-prefix.rs diff --git a/tests/codegen/method-declaration.rs b/tests/codegen-llvm/method-declaration.rs similarity index 100% rename from tests/codegen/method-declaration.rs rename to tests/codegen-llvm/method-declaration.rs diff --git a/tests/codegen/min-function-alignment.rs b/tests/codegen-llvm/min-function-alignment.rs similarity index 100% rename from tests/codegen/min-function-alignment.rs rename to tests/codegen-llvm/min-function-alignment.rs diff --git a/tests/codegen/mir-aggregate-no-alloca.rs b/tests/codegen-llvm/mir-aggregate-no-alloca.rs similarity index 100% rename from tests/codegen/mir-aggregate-no-alloca.rs rename to tests/codegen-llvm/mir-aggregate-no-alloca.rs diff --git a/tests/codegen/mir-inlined-line-numbers.rs b/tests/codegen-llvm/mir-inlined-line-numbers.rs similarity index 100% rename from tests/codegen/mir-inlined-line-numbers.rs rename to tests/codegen-llvm/mir-inlined-line-numbers.rs diff --git a/tests/codegen/mir_zst_stores.rs b/tests/codegen-llvm/mir_zst_stores.rs similarity index 100% rename from tests/codegen/mir_zst_stores.rs rename to tests/codegen-llvm/mir_zst_stores.rs diff --git a/tests/codegen/move-before-nocapture-ref-arg.rs b/tests/codegen-llvm/move-before-nocapture-ref-arg.rs similarity index 100% rename from tests/codegen/move-before-nocapture-ref-arg.rs rename to tests/codegen-llvm/move-before-nocapture-ref-arg.rs diff --git a/tests/codegen/move-operands.rs b/tests/codegen-llvm/move-operands.rs similarity index 100% rename from tests/codegen/move-operands.rs rename to tests/codegen-llvm/move-operands.rs diff --git a/tests/codegen/naked-asan.rs b/tests/codegen-llvm/naked-asan.rs similarity index 100% rename from tests/codegen/naked-asan.rs rename to tests/codegen-llvm/naked-asan.rs diff --git a/tests/codegen/naked-fn/aligned.rs b/tests/codegen-llvm/naked-fn/aligned.rs similarity index 100% rename from tests/codegen/naked-fn/aligned.rs rename to tests/codegen-llvm/naked-fn/aligned.rs diff --git a/tests/codegen/naked-fn/generics.rs b/tests/codegen-llvm/naked-fn/generics.rs similarity index 100% rename from tests/codegen/naked-fn/generics.rs rename to tests/codegen-llvm/naked-fn/generics.rs diff --git a/tests/codegen/naked-fn/instruction-set.rs b/tests/codegen-llvm/naked-fn/instruction-set.rs similarity index 100% rename from tests/codegen/naked-fn/instruction-set.rs rename to tests/codegen-llvm/naked-fn/instruction-set.rs diff --git a/tests/codegen/naked-fn/min-function-alignment.rs b/tests/codegen-llvm/naked-fn/min-function-alignment.rs similarity index 100% rename from tests/codegen/naked-fn/min-function-alignment.rs rename to tests/codegen-llvm/naked-fn/min-function-alignment.rs diff --git a/tests/codegen/naked-fn/naked-functions.rs b/tests/codegen-llvm/naked-fn/naked-functions.rs similarity index 100% rename from tests/codegen/naked-fn/naked-functions.rs rename to tests/codegen-llvm/naked-fn/naked-functions.rs diff --git a/tests/codegen/no-alloca-inside-if-false.rs b/tests/codegen-llvm/no-alloca-inside-if-false.rs similarity index 100% rename from tests/codegen/no-alloca-inside-if-false.rs rename to tests/codegen-llvm/no-alloca-inside-if-false.rs diff --git a/tests/codegen/no-assumes-on-casts.rs b/tests/codegen-llvm/no-assumes-on-casts.rs similarity index 100% rename from tests/codegen/no-assumes-on-casts.rs rename to tests/codegen-llvm/no-assumes-on-casts.rs diff --git a/tests/codegen/no-dllimport-w-cross-lang-lto.rs b/tests/codegen-llvm/no-dllimport-w-cross-lang-lto.rs similarity index 100% rename from tests/codegen/no-dllimport-w-cross-lang-lto.rs rename to tests/codegen-llvm/no-dllimport-w-cross-lang-lto.rs diff --git a/tests/codegen/no-jump-tables.rs b/tests/codegen-llvm/no-jump-tables.rs similarity index 100% rename from tests/codegen/no-jump-tables.rs rename to tests/codegen-llvm/no-jump-tables.rs diff --git a/tests/codegen/no-plt.rs b/tests/codegen-llvm/no-plt.rs similarity index 100% rename from tests/codegen/no-plt.rs rename to tests/codegen-llvm/no-plt.rs diff --git a/tests/codegen/no-redundant-item-monomorphization.rs b/tests/codegen-llvm/no-redundant-item-monomorphization.rs similarity index 100% rename from tests/codegen/no-redundant-item-monomorphization.rs rename to tests/codegen-llvm/no-redundant-item-monomorphization.rs diff --git a/tests/codegen/no_builtins-at-crate.rs b/tests/codegen-llvm/no_builtins-at-crate.rs similarity index 100% rename from tests/codegen/no_builtins-at-crate.rs rename to tests/codegen-llvm/no_builtins-at-crate.rs diff --git a/tests/codegen/noalias-box-off.rs b/tests/codegen-llvm/noalias-box-off.rs similarity index 100% rename from tests/codegen/noalias-box-off.rs rename to tests/codegen-llvm/noalias-box-off.rs diff --git a/tests/codegen/noalias-box.rs b/tests/codegen-llvm/noalias-box.rs similarity index 100% rename from tests/codegen/noalias-box.rs rename to tests/codegen-llvm/noalias-box.rs diff --git a/tests/codegen/noalias-flag.rs b/tests/codegen-llvm/noalias-flag.rs similarity index 100% rename from tests/codegen/noalias-flag.rs rename to tests/codegen-llvm/noalias-flag.rs diff --git a/tests/codegen/noalias-freeze.rs b/tests/codegen-llvm/noalias-freeze.rs similarity index 100% rename from tests/codegen/noalias-freeze.rs rename to tests/codegen-llvm/noalias-freeze.rs diff --git a/tests/codegen/noalias-refcell.rs b/tests/codegen-llvm/noalias-refcell.rs similarity index 100% rename from tests/codegen/noalias-refcell.rs rename to tests/codegen-llvm/noalias-refcell.rs diff --git a/tests/codegen/noalias-rwlockreadguard.rs b/tests/codegen-llvm/noalias-rwlockreadguard.rs similarity index 100% rename from tests/codegen/noalias-rwlockreadguard.rs rename to tests/codegen-llvm/noalias-rwlockreadguard.rs diff --git a/tests/codegen/noalias-unpin.rs b/tests/codegen-llvm/noalias-unpin.rs similarity index 100% rename from tests/codegen/noalias-unpin.rs rename to tests/codegen-llvm/noalias-unpin.rs diff --git a/tests/codegen/non-terminate/infinite-loop-1.rs b/tests/codegen-llvm/non-terminate/infinite-loop-1.rs similarity index 100% rename from tests/codegen/non-terminate/infinite-loop-1.rs rename to tests/codegen-llvm/non-terminate/infinite-loop-1.rs diff --git a/tests/codegen/non-terminate/infinite-loop-2.rs b/tests/codegen-llvm/non-terminate/infinite-loop-2.rs similarity index 100% rename from tests/codegen/non-terminate/infinite-loop-2.rs rename to tests/codegen-llvm/non-terminate/infinite-loop-2.rs diff --git a/tests/codegen/non-terminate/infinite-recursion.rs b/tests/codegen-llvm/non-terminate/infinite-recursion.rs similarity index 100% rename from tests/codegen/non-terminate/infinite-recursion.rs rename to tests/codegen-llvm/non-terminate/infinite-recursion.rs diff --git a/tests/codegen/non-terminate/nonempty-infinite-loop.rs b/tests/codegen-llvm/non-terminate/nonempty-infinite-loop.rs similarity index 100% rename from tests/codegen/non-terminate/nonempty-infinite-loop.rs rename to tests/codegen-llvm/non-terminate/nonempty-infinite-loop.rs diff --git a/tests/codegen/noreturn-uninhabited.rs b/tests/codegen-llvm/noreturn-uninhabited.rs similarity index 100% rename from tests/codegen/noreturn-uninhabited.rs rename to tests/codegen-llvm/noreturn-uninhabited.rs diff --git a/tests/codegen/noreturnflag.rs b/tests/codegen-llvm/noreturnflag.rs similarity index 100% rename from tests/codegen/noreturnflag.rs rename to tests/codegen-llvm/noreturnflag.rs diff --git a/tests/codegen/nounwind.rs b/tests/codegen-llvm/nounwind.rs similarity index 100% rename from tests/codegen/nounwind.rs rename to tests/codegen-llvm/nounwind.rs diff --git a/tests/codegen/nrvo.rs b/tests/codegen-llvm/nrvo.rs similarity index 100% rename from tests/codegen/nrvo.rs rename to tests/codegen-llvm/nrvo.rs diff --git a/tests/codegen/optimize-attr-1.rs b/tests/codegen-llvm/optimize-attr-1.rs similarity index 100% rename from tests/codegen/optimize-attr-1.rs rename to tests/codegen-llvm/optimize-attr-1.rs diff --git a/tests/codegen/option-as-slice.rs b/tests/codegen-llvm/option-as-slice.rs similarity index 100% rename from tests/codegen/option-as-slice.rs rename to tests/codegen-llvm/option-as-slice.rs diff --git a/tests/codegen/option-niche-eq.rs b/tests/codegen-llvm/option-niche-eq.rs similarity index 100% rename from tests/codegen/option-niche-eq.rs rename to tests/codegen-llvm/option-niche-eq.rs diff --git a/tests/codegen/option-niche-unfixed/option-nonzero-eq.rs b/tests/codegen-llvm/option-niche-unfixed/option-nonzero-eq.rs similarity index 100% rename from tests/codegen/option-niche-unfixed/option-nonzero-eq.rs rename to tests/codegen-llvm/option-niche-unfixed/option-nonzero-eq.rs diff --git a/tests/codegen/overaligned-constant.rs b/tests/codegen-llvm/overaligned-constant.rs similarity index 100% rename from tests/codegen/overaligned-constant.rs rename to tests/codegen-llvm/overaligned-constant.rs diff --git a/tests/codegen/packed.rs b/tests/codegen-llvm/packed.rs similarity index 100% rename from tests/codegen/packed.rs rename to tests/codegen-llvm/packed.rs diff --git a/tests/codegen/panic-abort-windows.rs b/tests/codegen-llvm/panic-abort-windows.rs similarity index 100% rename from tests/codegen/panic-abort-windows.rs rename to tests/codegen-llvm/panic-abort-windows.rs diff --git a/tests/codegen/panic-in-drop-abort.rs b/tests/codegen-llvm/panic-in-drop-abort.rs similarity index 100% rename from tests/codegen/panic-in-drop-abort.rs rename to tests/codegen-llvm/panic-in-drop-abort.rs diff --git a/tests/codegen/panic-unwind-default-uwtable.rs b/tests/codegen-llvm/panic-unwind-default-uwtable.rs similarity index 100% rename from tests/codegen/panic-unwind-default-uwtable.rs rename to tests/codegen-llvm/panic-unwind-default-uwtable.rs diff --git a/tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs b/tests/codegen-llvm/patchable-function-entry/patchable-function-entry-both-flags.rs similarity index 100% rename from tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs rename to tests/codegen-llvm/patchable-function-entry/patchable-function-entry-both-flags.rs diff --git a/tests/codegen/patchable-function-entry/patchable-function-entry-no-flag.rs b/tests/codegen-llvm/patchable-function-entry/patchable-function-entry-no-flag.rs similarity index 100% rename from tests/codegen/patchable-function-entry/patchable-function-entry-no-flag.rs rename to tests/codegen-llvm/patchable-function-entry/patchable-function-entry-no-flag.rs diff --git a/tests/codegen/patchable-function-entry/patchable-function-entry-one-flag.rs b/tests/codegen-llvm/patchable-function-entry/patchable-function-entry-one-flag.rs similarity index 100% rename from tests/codegen/patchable-function-entry/patchable-function-entry-one-flag.rs rename to tests/codegen-llvm/patchable-function-entry/patchable-function-entry-one-flag.rs diff --git a/tests/codegen/pattern_type_symbols.rs b/tests/codegen-llvm/pattern_type_symbols.rs similarity index 100% rename from tests/codegen/pattern_type_symbols.rs rename to tests/codegen-llvm/pattern_type_symbols.rs diff --git a/tests/codegen/personality_lifetimes.rs b/tests/codegen-llvm/personality_lifetimes.rs similarity index 100% rename from tests/codegen/personality_lifetimes.rs rename to tests/codegen-llvm/personality_lifetimes.rs diff --git a/tests/codegen/pgo-counter-bias.rs b/tests/codegen-llvm/pgo-counter-bias.rs similarity index 100% rename from tests/codegen/pgo-counter-bias.rs rename to tests/codegen-llvm/pgo-counter-bias.rs diff --git a/tests/codegen/pgo-instrumentation.rs b/tests/codegen-llvm/pgo-instrumentation.rs similarity index 100% rename from tests/codegen/pgo-instrumentation.rs rename to tests/codegen-llvm/pgo-instrumentation.rs diff --git a/tests/codegen/pic-relocation-model.rs b/tests/codegen-llvm/pic-relocation-model.rs similarity index 100% rename from tests/codegen/pic-relocation-model.rs rename to tests/codegen-llvm/pic-relocation-model.rs diff --git a/tests/codegen/pie-relocation-model.rs b/tests/codegen-llvm/pie-relocation-model.rs similarity index 100% rename from tests/codegen/pie-relocation-model.rs rename to tests/codegen-llvm/pie-relocation-model.rs diff --git a/tests/codegen/placement-new.rs b/tests/codegen-llvm/placement-new.rs similarity index 100% rename from tests/codegen/placement-new.rs rename to tests/codegen-llvm/placement-new.rs diff --git a/tests/codegen/powerpc64le-struct-align-128.rs b/tests/codegen-llvm/powerpc64le-struct-align-128.rs similarity index 100% rename from tests/codegen/powerpc64le-struct-align-128.rs rename to tests/codegen-llvm/powerpc64le-struct-align-128.rs diff --git a/tests/codegen/precondition-checks.rs b/tests/codegen-llvm/precondition-checks.rs similarity index 100% rename from tests/codegen/precondition-checks.rs rename to tests/codegen-llvm/precondition-checks.rs diff --git a/tests/codegen/ptr-arithmetic.rs b/tests/codegen-llvm/ptr-arithmetic.rs similarity index 100% rename from tests/codegen/ptr-arithmetic.rs rename to tests/codegen-llvm/ptr-arithmetic.rs diff --git a/tests/codegen/ptr-read-metadata.rs b/tests/codegen-llvm/ptr-read-metadata.rs similarity index 100% rename from tests/codegen/ptr-read-metadata.rs rename to tests/codegen-llvm/ptr-read-metadata.rs diff --git a/tests/codegen/range-attribute.rs b/tests/codegen-llvm/range-attribute.rs similarity index 100% rename from tests/codegen/range-attribute.rs rename to tests/codegen-llvm/range-attribute.rs diff --git a/tests/codegen/range-loop.rs b/tests/codegen-llvm/range-loop.rs similarity index 100% rename from tests/codegen/range-loop.rs rename to tests/codegen-llvm/range-loop.rs diff --git a/tests/codegen/range_to_inclusive.rs b/tests/codegen-llvm/range_to_inclusive.rs similarity index 100% rename from tests/codegen/range_to_inclusive.rs rename to tests/codegen-llvm/range_to_inclusive.rs diff --git a/tests/codegen/refs.rs b/tests/codegen-llvm/refs.rs similarity index 100% rename from tests/codegen/refs.rs rename to tests/codegen-llvm/refs.rs diff --git a/tests/codegen/reg-struct-return.rs b/tests/codegen-llvm/reg-struct-return.rs similarity index 100% rename from tests/codegen/reg-struct-return.rs rename to tests/codegen-llvm/reg-struct-return.rs diff --git a/tests/codegen/regparm-inreg.rs b/tests/codegen-llvm/regparm-inreg.rs similarity index 100% rename from tests/codegen/regparm-inreg.rs rename to tests/codegen-llvm/regparm-inreg.rs diff --git a/tests/codegen/remap_path_prefix/aux_mod.rs b/tests/codegen-llvm/remap_path_prefix/aux_mod.rs similarity index 100% rename from tests/codegen/remap_path_prefix/aux_mod.rs rename to tests/codegen-llvm/remap_path_prefix/aux_mod.rs diff --git a/tests/codegen/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs b/tests/codegen-llvm/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs similarity index 100% rename from tests/codegen/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs rename to tests/codegen-llvm/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs diff --git a/tests/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs b/tests/codegen-llvm/remap_path_prefix/auxiliary/xcrate-generic.rs similarity index 100% rename from tests/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs rename to tests/codegen-llvm/remap_path_prefix/auxiliary/xcrate-generic.rs diff --git a/tests/codegen/remap_path_prefix/issue-73167-remap-std.rs b/tests/codegen-llvm/remap_path_prefix/issue-73167-remap-std.rs similarity index 100% rename from tests/codegen/remap_path_prefix/issue-73167-remap-std.rs rename to tests/codegen-llvm/remap_path_prefix/issue-73167-remap-std.rs diff --git a/tests/codegen/remap_path_prefix/main.rs b/tests/codegen-llvm/remap_path_prefix/main.rs similarity index 100% rename from tests/codegen/remap_path_prefix/main.rs rename to tests/codegen-llvm/remap_path_prefix/main.rs diff --git a/tests/codegen/remap_path_prefix/xcrate-generic.rs b/tests/codegen-llvm/remap_path_prefix/xcrate-generic.rs similarity index 100% rename from tests/codegen/remap_path_prefix/xcrate-generic.rs rename to tests/codegen-llvm/remap_path_prefix/xcrate-generic.rs diff --git a/tests/codegen/repeat-operand-zero-len.rs b/tests/codegen-llvm/repeat-operand-zero-len.rs similarity index 100% rename from tests/codegen/repeat-operand-zero-len.rs rename to tests/codegen-llvm/repeat-operand-zero-len.rs diff --git a/tests/codegen/repeat-operand-zst-elem.rs b/tests/codegen-llvm/repeat-operand-zst-elem.rs similarity index 100% rename from tests/codegen/repeat-operand-zst-elem.rs rename to tests/codegen-llvm/repeat-operand-zst-elem.rs diff --git a/tests/codegen/repeat-trusted-len.rs b/tests/codegen-llvm/repeat-trusted-len.rs similarity index 100% rename from tests/codegen/repeat-trusted-len.rs rename to tests/codegen-llvm/repeat-trusted-len.rs diff --git a/tests/codegen/repr/transparent-byval-struct-ptr.rs b/tests/codegen-llvm/repr/transparent-byval-struct-ptr.rs similarity index 100% rename from tests/codegen/repr/transparent-byval-struct-ptr.rs rename to tests/codegen-llvm/repr/transparent-byval-struct-ptr.rs diff --git a/tests/codegen/repr/transparent-imm-array.rs b/tests/codegen-llvm/repr/transparent-imm-array.rs similarity index 100% rename from tests/codegen/repr/transparent-imm-array.rs rename to tests/codegen-llvm/repr/transparent-imm-array.rs diff --git a/tests/codegen/repr/transparent-mips64.rs b/tests/codegen-llvm/repr/transparent-mips64.rs similarity index 100% rename from tests/codegen/repr/transparent-mips64.rs rename to tests/codegen-llvm/repr/transparent-mips64.rs diff --git a/tests/codegen/repr/transparent-opaque-ptr.rs b/tests/codegen-llvm/repr/transparent-opaque-ptr.rs similarity index 100% rename from tests/codegen/repr/transparent-opaque-ptr.rs rename to tests/codegen-llvm/repr/transparent-opaque-ptr.rs diff --git a/tests/codegen/repr/transparent-sparc64.rs b/tests/codegen-llvm/repr/transparent-sparc64.rs similarity index 100% rename from tests/codegen/repr/transparent-sparc64.rs rename to tests/codegen-llvm/repr/transparent-sparc64.rs diff --git a/tests/codegen/repr/transparent-sysv64.rs b/tests/codegen-llvm/repr/transparent-sysv64.rs similarity index 100% rename from tests/codegen/repr/transparent-sysv64.rs rename to tests/codegen-llvm/repr/transparent-sysv64.rs diff --git a/tests/codegen/repr/transparent.rs b/tests/codegen-llvm/repr/transparent.rs similarity index 100% rename from tests/codegen/repr/transparent.rs rename to tests/codegen-llvm/repr/transparent.rs diff --git a/tests/codegen/retpoline.rs b/tests/codegen-llvm/retpoline.rs similarity index 100% rename from tests/codegen/retpoline.rs rename to tests/codegen-llvm/retpoline.rs diff --git a/tests/codegen/riscv-abi/call-llvm-intrinsics.rs b/tests/codegen-llvm/riscv-abi/call-llvm-intrinsics.rs similarity index 100% rename from tests/codegen/riscv-abi/call-llvm-intrinsics.rs rename to tests/codegen-llvm/riscv-abi/call-llvm-intrinsics.rs diff --git a/tests/codegen/riscv-abi/cast-local-large-enough.rs b/tests/codegen-llvm/riscv-abi/cast-local-large-enough.rs similarity index 100% rename from tests/codegen/riscv-abi/cast-local-large-enough.rs rename to tests/codegen-llvm/riscv-abi/cast-local-large-enough.rs diff --git a/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs b/tests/codegen-llvm/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs similarity index 100% rename from tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs rename to tests/codegen-llvm/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs diff --git a/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs b/tests/codegen-llvm/riscv-abi/riscv64-lp64d-abi.rs similarity index 100% rename from tests/codegen/riscv-abi/riscv64-lp64d-abi.rs rename to tests/codegen-llvm/riscv-abi/riscv64-lp64d-abi.rs diff --git a/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs b/tests/codegen-llvm/riscv-abi/riscv64-lp64f-lp64d-abi.rs similarity index 100% rename from tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs rename to tests/codegen-llvm/riscv-abi/riscv64-lp64f-lp64d-abi.rs diff --git a/tests/codegen/riscv-target-abi.rs b/tests/codegen-llvm/riscv-target-abi.rs similarity index 100% rename from tests/codegen/riscv-target-abi.rs rename to tests/codegen-llvm/riscv-target-abi.rs diff --git a/tests/codegen/rust-abi-arch-specific-adjustment.rs b/tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs similarity index 100% rename from tests/codegen/rust-abi-arch-specific-adjustment.rs rename to tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs diff --git a/tests/codegen/s390x-simd.rs b/tests/codegen-llvm/s390x-simd.rs similarity index 100% rename from tests/codegen/s390x-simd.rs rename to tests/codegen-llvm/s390x-simd.rs diff --git a/tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs b/tests/codegen-llvm/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs similarity index 100% rename from tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs rename to tests/codegen-llvm/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs diff --git a/tests/codegen/sanitizer/address-sanitizer-globals-tracking.rs b/tests/codegen-llvm/sanitizer/address-sanitizer-globals-tracking.rs similarity index 100% rename from tests/codegen/sanitizer/address-sanitizer-globals-tracking.rs rename to tests/codegen-llvm/sanitizer/address-sanitizer-globals-tracking.rs diff --git a/tests/codegen/sanitizer/cfi/add-canonical-jump-tables-flag.rs b/tests/codegen-llvm/sanitizer/cfi/add-canonical-jump-tables-flag.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/add-canonical-jump-tables-flag.rs rename to tests/codegen-llvm/sanitizer/cfi/add-canonical-jump-tables-flag.rs diff --git a/tests/codegen/sanitizer/cfi/add-cfi-normalize-integers-flag.rs b/tests/codegen-llvm/sanitizer/cfi/add-cfi-normalize-integers-flag.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/add-cfi-normalize-integers-flag.rs rename to tests/codegen-llvm/sanitizer/cfi/add-cfi-normalize-integers-flag.rs diff --git a/tests/codegen/sanitizer/cfi/add-enable-split-lto-unit-flag.rs b/tests/codegen-llvm/sanitizer/cfi/add-enable-split-lto-unit-flag.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/add-enable-split-lto-unit-flag.rs rename to tests/codegen-llvm/sanitizer/cfi/add-enable-split-lto-unit-flag.rs diff --git a/tests/codegen/sanitizer/cfi/dbg-location-on-cfi-blocks.rs b/tests/codegen-llvm/sanitizer/cfi/dbg-location-on-cfi-blocks.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/dbg-location-on-cfi-blocks.rs rename to tests/codegen-llvm/sanitizer/cfi/dbg-location-on-cfi-blocks.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-checks-attr-no-sanitize.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-checks-attr-no-sanitize.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-checks-attr-no-sanitize.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-checks-attr-no-sanitize.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-checks.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-checks.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-checks.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-checks.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-attr-cfi-encoding.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-attr-cfi-encoding.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-attr-cfi-encoding.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-attr-cfi-encoding.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-const-generics.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-const-generics.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-const-generics.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-const-generics.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-function-types.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-function-types.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-function-types.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-function-types.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-lifetimes.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-lifetimes.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-lifetimes.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-lifetimes.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-method-secondary-typeid.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-method-secondary-typeid.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-method-secondary-typeid.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-method-secondary-typeid.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-pointer-types.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-pointer-types.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-pointer-types.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-pointer-types.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-primitive-types.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-primitive-types.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-primitive-types.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-primitive-types.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-repr-transparent-types.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-repr-transparent-types.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-repr-transparent-types.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-repr-transparent-types.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-sequence-types.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-sequence-types.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-sequence-types.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-sequence-types.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-trait-types.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-trait-types.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-trait-types.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-trait-types.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-generalized.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-generalized.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-generalized.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-generalized.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-trait-objects.rs b/tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-trait-objects.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/emit-type-metadata-trait-objects.rs rename to tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-trait-objects.rs diff --git a/tests/codegen/sanitizer/cfi/external_weak_symbols.rs b/tests/codegen-llvm/sanitizer/cfi/external_weak_symbols.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/external_weak_symbols.rs rename to tests/codegen-llvm/sanitizer/cfi/external_weak_symbols.rs diff --git a/tests/codegen/sanitizer/cfi/generalize-pointers.rs b/tests/codegen-llvm/sanitizer/cfi/generalize-pointers.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/generalize-pointers.rs rename to tests/codegen-llvm/sanitizer/cfi/generalize-pointers.rs diff --git a/tests/codegen/sanitizer/cfi/normalize-integers.rs b/tests/codegen-llvm/sanitizer/cfi/normalize-integers.rs similarity index 100% rename from tests/codegen/sanitizer/cfi/normalize-integers.rs rename to tests/codegen-llvm/sanitizer/cfi/normalize-integers.rs diff --git a/tests/codegen/sanitizer/dataflow-instrument-functions.rs b/tests/codegen-llvm/sanitizer/dataflow-instrument-functions.rs similarity index 100% rename from tests/codegen/sanitizer/dataflow-instrument-functions.rs rename to tests/codegen-llvm/sanitizer/dataflow-instrument-functions.rs diff --git a/tests/codegen/sanitizer/kasan-emits-instrumentation.rs b/tests/codegen-llvm/sanitizer/kasan-emits-instrumentation.rs similarity index 100% rename from tests/codegen/sanitizer/kasan-emits-instrumentation.rs rename to tests/codegen-llvm/sanitizer/kasan-emits-instrumentation.rs diff --git a/tests/codegen/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs b/tests/codegen-llvm/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs rename to tests/codegen-llvm/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs diff --git a/tests/codegen/sanitizer/kcfi/add-kcfi-arity-flag.rs b/tests/codegen-llvm/sanitizer/kcfi/add-kcfi-arity-flag.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/add-kcfi-arity-flag.rs rename to tests/codegen-llvm/sanitizer/kcfi/add-kcfi-arity-flag.rs diff --git a/tests/codegen/sanitizer/kcfi/add-kcfi-flag.rs b/tests/codegen-llvm/sanitizer/kcfi/add-kcfi-flag.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/add-kcfi-flag.rs rename to tests/codegen-llvm/sanitizer/kcfi/add-kcfi-flag.rs diff --git a/tests/codegen/sanitizer/kcfi/add-kcfi-offset-flag.rs b/tests/codegen-llvm/sanitizer/kcfi/add-kcfi-offset-flag.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/add-kcfi-offset-flag.rs rename to tests/codegen-llvm/sanitizer/kcfi/add-kcfi-offset-flag.rs diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs rename to tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs rename to tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs rename to tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs rename to tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs rename to tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle.rs rename to tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle.rs diff --git a/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-type-metadata-trait-objects.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs rename to tests/codegen-llvm/sanitizer/kcfi/emit-type-metadata-trait-objects.rs diff --git a/tests/codegen/sanitizer/kcfi/naked-function.rs b/tests/codegen-llvm/sanitizer/kcfi/naked-function.rs similarity index 100% rename from tests/codegen/sanitizer/kcfi/naked-function.rs rename to tests/codegen-llvm/sanitizer/kcfi/naked-function.rs diff --git a/tests/codegen/sanitizer/memory-track-origins.rs b/tests/codegen-llvm/sanitizer/memory-track-origins.rs similarity index 100% rename from tests/codegen/sanitizer/memory-track-origins.rs rename to tests/codegen-llvm/sanitizer/memory-track-origins.rs diff --git a/tests/codegen/sanitizer/memtag-attr-check.rs b/tests/codegen-llvm/sanitizer/memtag-attr-check.rs similarity index 100% rename from tests/codegen/sanitizer/memtag-attr-check.rs rename to tests/codegen-llvm/sanitizer/memtag-attr-check.rs diff --git a/tests/codegen/sanitizer/no-sanitize-inlining.rs b/tests/codegen-llvm/sanitizer/no-sanitize-inlining.rs similarity index 100% rename from tests/codegen/sanitizer/no-sanitize-inlining.rs rename to tests/codegen-llvm/sanitizer/no-sanitize-inlining.rs diff --git a/tests/codegen/sanitizer/no-sanitize.rs b/tests/codegen-llvm/sanitizer/no-sanitize.rs similarity index 100% rename from tests/codegen/sanitizer/no-sanitize.rs rename to tests/codegen-llvm/sanitizer/no-sanitize.rs diff --git a/tests/codegen/sanitizer/riscv64-shadow-call-stack.rs b/tests/codegen-llvm/sanitizer/riscv64-shadow-call-stack.rs similarity index 100% rename from tests/codegen/sanitizer/riscv64-shadow-call-stack.rs rename to tests/codegen-llvm/sanitizer/riscv64-shadow-call-stack.rs diff --git a/tests/codegen/sanitizer/safestack-attr-check.rs b/tests/codegen-llvm/sanitizer/safestack-attr-check.rs similarity index 100% rename from tests/codegen/sanitizer/safestack-attr-check.rs rename to tests/codegen-llvm/sanitizer/safestack-attr-check.rs diff --git a/tests/codegen/sanitizer/sanitizer-recover.rs b/tests/codegen-llvm/sanitizer/sanitizer-recover.rs similarity index 100% rename from tests/codegen/sanitizer/sanitizer-recover.rs rename to tests/codegen-llvm/sanitizer/sanitizer-recover.rs diff --git a/tests/codegen/sanitizer/scs-attr-check.rs b/tests/codegen-llvm/sanitizer/scs-attr-check.rs similarity index 100% rename from tests/codegen/sanitizer/scs-attr-check.rs rename to tests/codegen-llvm/sanitizer/scs-attr-check.rs diff --git a/tests/codegen/scalar-pair-bool.rs b/tests/codegen-llvm/scalar-pair-bool.rs similarity index 100% rename from tests/codegen/scalar-pair-bool.rs rename to tests/codegen-llvm/scalar-pair-bool.rs diff --git a/tests/codegen/set-discriminant-invalid.rs b/tests/codegen-llvm/set-discriminant-invalid.rs similarity index 100% rename from tests/codegen/set-discriminant-invalid.rs rename to tests/codegen-llvm/set-discriminant-invalid.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-abs.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-abs.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-ceil.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-ceil.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-cos.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-cos.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-exp.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-exp.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-exp2.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-exp2.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-floor.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-floor.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-fma.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-fma.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-fsqrt.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-fsqrt.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-log.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-log.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-log10.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-log10.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-log2.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-log2.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-minmax.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-minmax.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-sin.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-float-sin.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-bitmask.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-bitmask.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-gather.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-gather.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-load.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-load.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-store.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-store.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-scatter.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-scatter.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-select.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-select.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-mask-reduce.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-mask-reduce.rs diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-transmute-array.rs similarity index 100% rename from tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs rename to tests/codegen-llvm/simd-intrinsic/simd-intrinsic-transmute-array.rs diff --git a/tests/codegen/simd/aggregate-simd.rs b/tests/codegen-llvm/simd/aggregate-simd.rs similarity index 100% rename from tests/codegen/simd/aggregate-simd.rs rename to tests/codegen-llvm/simd/aggregate-simd.rs diff --git a/tests/codegen/simd/extract-insert-dyn.rs b/tests/codegen-llvm/simd/extract-insert-dyn.rs similarity index 100% rename from tests/codegen/simd/extract-insert-dyn.rs rename to tests/codegen-llvm/simd/extract-insert-dyn.rs diff --git a/tests/codegen/simd/packed-simd-alignment.rs b/tests/codegen-llvm/simd/packed-simd-alignment.rs similarity index 100% rename from tests/codegen/simd/packed-simd-alignment.rs rename to tests/codegen-llvm/simd/packed-simd-alignment.rs diff --git a/tests/codegen/simd/packed-simd.rs b/tests/codegen-llvm/simd/packed-simd.rs similarity index 100% rename from tests/codegen/simd/packed-simd.rs rename to tests/codegen-llvm/simd/packed-simd.rs diff --git a/tests/codegen/simd/simd-wide-sum.rs b/tests/codegen-llvm/simd/simd-wide-sum.rs similarity index 100% rename from tests/codegen/simd/simd-wide-sum.rs rename to tests/codegen-llvm/simd/simd-wide-sum.rs diff --git a/tests/codegen/simd/simd_arith_offset.rs b/tests/codegen-llvm/simd/simd_arith_offset.rs similarity index 100% rename from tests/codegen/simd/simd_arith_offset.rs rename to tests/codegen-llvm/simd/simd_arith_offset.rs diff --git a/tests/codegen/simd/swap-simd-types.rs b/tests/codegen-llvm/simd/swap-simd-types.rs similarity index 100% rename from tests/codegen/simd/swap-simd-types.rs rename to tests/codegen-llvm/simd/swap-simd-types.rs diff --git a/tests/codegen/simd/unpadded-simd.rs b/tests/codegen-llvm/simd/unpadded-simd.rs similarity index 100% rename from tests/codegen/simd/unpadded-simd.rs rename to tests/codegen-llvm/simd/unpadded-simd.rs diff --git a/tests/codegen/skip-mono-inside-if-false.rs b/tests/codegen-llvm/skip-mono-inside-if-false.rs similarity index 100% rename from tests/codegen/skip-mono-inside-if-false.rs rename to tests/codegen-llvm/skip-mono-inside-if-false.rs diff --git a/tests/codegen/slice-as_chunks.rs b/tests/codegen-llvm/slice-as_chunks.rs similarity index 100% rename from tests/codegen/slice-as_chunks.rs rename to tests/codegen-llvm/slice-as_chunks.rs diff --git a/tests/codegen/slice-indexing.rs b/tests/codegen-llvm/slice-indexing.rs similarity index 100% rename from tests/codegen/slice-indexing.rs rename to tests/codegen-llvm/slice-indexing.rs diff --git a/tests/codegen/slice-init.rs b/tests/codegen-llvm/slice-init.rs similarity index 100% rename from tests/codegen/slice-init.rs rename to tests/codegen-llvm/slice-init.rs diff --git a/tests/codegen/slice-is-ascii.rs b/tests/codegen-llvm/slice-is-ascii.rs similarity index 100% rename from tests/codegen/slice-is-ascii.rs rename to tests/codegen-llvm/slice-is-ascii.rs diff --git a/tests/codegen/slice-iter-fold.rs b/tests/codegen-llvm/slice-iter-fold.rs similarity index 100% rename from tests/codegen/slice-iter-fold.rs rename to tests/codegen-llvm/slice-iter-fold.rs diff --git a/tests/codegen/slice-iter-len-eq-zero.rs b/tests/codegen-llvm/slice-iter-len-eq-zero.rs similarity index 100% rename from tests/codegen/slice-iter-len-eq-zero.rs rename to tests/codegen-llvm/slice-iter-len-eq-zero.rs diff --git a/tests/codegen/slice-iter-nonnull.rs b/tests/codegen-llvm/slice-iter-nonnull.rs similarity index 100% rename from tests/codegen/slice-iter-nonnull.rs rename to tests/codegen-llvm/slice-iter-nonnull.rs diff --git a/tests/codegen/slice-last-elements-optimization.rs b/tests/codegen-llvm/slice-last-elements-optimization.rs similarity index 100% rename from tests/codegen/slice-last-elements-optimization.rs rename to tests/codegen-llvm/slice-last-elements-optimization.rs diff --git a/tests/codegen/slice-pointer-nonnull-unwrap.rs b/tests/codegen-llvm/slice-pointer-nonnull-unwrap.rs similarity index 100% rename from tests/codegen/slice-pointer-nonnull-unwrap.rs rename to tests/codegen-llvm/slice-pointer-nonnull-unwrap.rs diff --git a/tests/codegen/slice-position-bounds-check.rs b/tests/codegen-llvm/slice-position-bounds-check.rs similarity index 100% rename from tests/codegen/slice-position-bounds-check.rs rename to tests/codegen-llvm/slice-position-bounds-check.rs diff --git a/tests/codegen/slice-ref-equality.rs b/tests/codegen-llvm/slice-ref-equality.rs similarity index 100% rename from tests/codegen/slice-ref-equality.rs rename to tests/codegen-llvm/slice-ref-equality.rs diff --git a/tests/codegen/slice-reverse.rs b/tests/codegen-llvm/slice-reverse.rs similarity index 100% rename from tests/codegen/slice-reverse.rs rename to tests/codegen-llvm/slice-reverse.rs diff --git a/tests/codegen/slice-split-at.rs b/tests/codegen-llvm/slice-split-at.rs similarity index 100% rename from tests/codegen/slice-split-at.rs rename to tests/codegen-llvm/slice-split-at.rs diff --git a/tests/codegen/slice-windows-no-bounds-check.rs b/tests/codegen-llvm/slice-windows-no-bounds-check.rs similarity index 100% rename from tests/codegen/slice-windows-no-bounds-check.rs rename to tests/codegen-llvm/slice-windows-no-bounds-check.rs diff --git a/tests/codegen/slice_as_from_ptr_range.rs b/tests/codegen-llvm/slice_as_from_ptr_range.rs similarity index 100% rename from tests/codegen/slice_as_from_ptr_range.rs rename to tests/codegen-llvm/slice_as_from_ptr_range.rs diff --git a/tests/codegen/some-abis-do-extend-params-to-32-bits.rs b/tests/codegen-llvm/some-abis-do-extend-params-to-32-bits.rs similarity index 100% rename from tests/codegen/some-abis-do-extend-params-to-32-bits.rs rename to tests/codegen-llvm/some-abis-do-extend-params-to-32-bits.rs diff --git a/tests/codegen/some-global-nonnull.rs b/tests/codegen-llvm/some-global-nonnull.rs similarity index 100% rename from tests/codegen/some-global-nonnull.rs rename to tests/codegen-llvm/some-global-nonnull.rs diff --git a/tests/codegen/sparc-struct-abi.rs b/tests/codegen-llvm/sparc-struct-abi.rs similarity index 100% rename from tests/codegen/sparc-struct-abi.rs rename to tests/codegen-llvm/sparc-struct-abi.rs diff --git a/tests/codegen/split-lto-unit.rs b/tests/codegen-llvm/split-lto-unit.rs similarity index 100% rename from tests/codegen/split-lto-unit.rs rename to tests/codegen-llvm/split-lto-unit.rs diff --git a/tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs b/tests/codegen-llvm/src-hash-algorithm/src-hash-algorithm-md5.rs similarity index 100% rename from tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs rename to tests/codegen-llvm/src-hash-algorithm/src-hash-algorithm-md5.rs diff --git a/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs b/tests/codegen-llvm/src-hash-algorithm/src-hash-algorithm-sha1.rs similarity index 100% rename from tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs rename to tests/codegen-llvm/src-hash-algorithm/src-hash-algorithm-sha1.rs diff --git a/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs b/tests/codegen-llvm/src-hash-algorithm/src-hash-algorithm-sha256.rs similarity index 100% rename from tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs rename to tests/codegen-llvm/src-hash-algorithm/src-hash-algorithm-sha256.rs diff --git a/tests/codegen/sroa-fragment-debuginfo.rs b/tests/codegen-llvm/sroa-fragment-debuginfo.rs similarity index 100% rename from tests/codegen/sroa-fragment-debuginfo.rs rename to tests/codegen-llvm/sroa-fragment-debuginfo.rs diff --git a/tests/codegen/sse42-implies-crc32.rs b/tests/codegen-llvm/sse42-implies-crc32.rs similarity index 100% rename from tests/codegen/sse42-implies-crc32.rs rename to tests/codegen-llvm/sse42-implies-crc32.rs diff --git a/tests/codegen/stack-probes-inline.rs b/tests/codegen-llvm/stack-probes-inline.rs similarity index 100% rename from tests/codegen/stack-probes-inline.rs rename to tests/codegen-llvm/stack-probes-inline.rs diff --git a/tests/codegen/stack-protector.rs b/tests/codegen-llvm/stack-protector.rs similarity index 100% rename from tests/codegen/stack-protector.rs rename to tests/codegen-llvm/stack-protector.rs diff --git a/tests/codegen/static-relocation-model-msvc.rs b/tests/codegen-llvm/static-relocation-model-msvc.rs similarity index 100% rename from tests/codegen/static-relocation-model-msvc.rs rename to tests/codegen-llvm/static-relocation-model-msvc.rs diff --git a/tests/codegen/staticlib-external-inline-fns.rs b/tests/codegen-llvm/staticlib-external-inline-fns.rs similarity index 100% rename from tests/codegen/staticlib-external-inline-fns.rs rename to tests/codegen-llvm/staticlib-external-inline-fns.rs diff --git a/tests/codegen/step_by-overflow-checks.rs b/tests/codegen-llvm/step_by-overflow-checks.rs similarity index 100% rename from tests/codegen/step_by-overflow-checks.rs rename to tests/codegen-llvm/step_by-overflow-checks.rs diff --git a/tests/codegen/stores.rs b/tests/codegen-llvm/stores.rs similarity index 100% rename from tests/codegen/stores.rs rename to tests/codegen-llvm/stores.rs diff --git a/tests/codegen/string-push.rs b/tests/codegen-llvm/string-push.rs similarity index 100% rename from tests/codegen/string-push.rs rename to tests/codegen-llvm/string-push.rs diff --git a/tests/codegen/swap-large-types.rs b/tests/codegen-llvm/swap-large-types.rs similarity index 100% rename from tests/codegen/swap-large-types.rs rename to tests/codegen-llvm/swap-large-types.rs diff --git a/tests/codegen/swap-small-types.rs b/tests/codegen-llvm/swap-small-types.rs similarity index 100% rename from tests/codegen/swap-small-types.rs rename to tests/codegen-llvm/swap-small-types.rs diff --git a/tests/codegen/target-cpu-on-functions.rs b/tests/codegen-llvm/target-cpu-on-functions.rs similarity index 100% rename from tests/codegen/target-cpu-on-functions.rs rename to tests/codegen-llvm/target-cpu-on-functions.rs diff --git a/tests/codegen/target-feature-inline-closure.rs b/tests/codegen-llvm/target-feature-inline-closure.rs similarity index 100% rename from tests/codegen/target-feature-inline-closure.rs rename to tests/codegen-llvm/target-feature-inline-closure.rs diff --git a/tests/codegen/target-feature-negative-implication.rs b/tests/codegen-llvm/target-feature-negative-implication.rs similarity index 100% rename from tests/codegen/target-feature-negative-implication.rs rename to tests/codegen-llvm/target-feature-negative-implication.rs diff --git a/tests/codegen/target-feature-overrides.rs b/tests/codegen-llvm/target-feature-overrides.rs similarity index 100% rename from tests/codegen/target-feature-overrides.rs rename to tests/codegen-llvm/target-feature-overrides.rs diff --git a/tests/codegen/terminating-catchpad.rs b/tests/codegen-llvm/terminating-catchpad.rs similarity index 100% rename from tests/codegen/terminating-catchpad.rs rename to tests/codegen-llvm/terminating-catchpad.rs diff --git a/tests/codegen/thread-local.rs b/tests/codegen-llvm/thread-local.rs similarity index 100% rename from tests/codegen/thread-local.rs rename to tests/codegen-llvm/thread-local.rs diff --git a/tests/codegen/tied-features-strength.rs b/tests/codegen-llvm/tied-features-strength.rs similarity index 100% rename from tests/codegen/tied-features-strength.rs rename to tests/codegen-llvm/tied-features-strength.rs diff --git a/tests/codegen/to_vec.rs b/tests/codegen-llvm/to_vec.rs similarity index 100% rename from tests/codegen/to_vec.rs rename to tests/codegen-llvm/to_vec.rs diff --git a/tests/codegen/trailing_zeros.rs b/tests/codegen-llvm/trailing_zeros.rs similarity index 100% rename from tests/codegen/trailing_zeros.rs rename to tests/codegen-llvm/trailing_zeros.rs diff --git a/tests/codegen/transmute-optimized.rs b/tests/codegen-llvm/transmute-optimized.rs similarity index 100% rename from tests/codegen/transmute-optimized.rs rename to tests/codegen-llvm/transmute-optimized.rs diff --git a/tests/codegen/transmute-scalar.rs b/tests/codegen-llvm/transmute-scalar.rs similarity index 100% rename from tests/codegen/transmute-scalar.rs rename to tests/codegen-llvm/transmute-scalar.rs diff --git a/tests/codegen/try_question_mark_nop.rs b/tests/codegen-llvm/try_question_mark_nop.rs similarity index 100% rename from tests/codegen/try_question_mark_nop.rs rename to tests/codegen-llvm/try_question_mark_nop.rs diff --git a/tests/codegen/tune-cpu-on-functions.rs b/tests/codegen-llvm/tune-cpu-on-functions.rs similarity index 100% rename from tests/codegen/tune-cpu-on-functions.rs rename to tests/codegen-llvm/tune-cpu-on-functions.rs diff --git a/tests/codegen/tuple-layout-opt.rs b/tests/codegen-llvm/tuple-layout-opt.rs similarity index 100% rename from tests/codegen/tuple-layout-opt.rs rename to tests/codegen-llvm/tuple-layout-opt.rs diff --git a/tests/codegen/ub-checks.rs b/tests/codegen-llvm/ub-checks.rs similarity index 100% rename from tests/codegen/ub-checks.rs rename to tests/codegen-llvm/ub-checks.rs diff --git a/tests/codegen/unchecked-float-casts.rs b/tests/codegen-llvm/unchecked-float-casts.rs similarity index 100% rename from tests/codegen/unchecked-float-casts.rs rename to tests/codegen-llvm/unchecked-float-casts.rs diff --git a/tests/codegen/unchecked_shifts.rs b/tests/codegen-llvm/unchecked_shifts.rs similarity index 100% rename from tests/codegen/unchecked_shifts.rs rename to tests/codegen-llvm/unchecked_shifts.rs diff --git a/tests/codegen/uninhabited-transparent-return-abi.rs b/tests/codegen-llvm/uninhabited-transparent-return-abi.rs similarity index 100% rename from tests/codegen/uninhabited-transparent-return-abi.rs rename to tests/codegen-llvm/uninhabited-transparent-return-abi.rs diff --git a/tests/codegen/uninit-consts.rs b/tests/codegen-llvm/uninit-consts.rs similarity index 100% rename from tests/codegen/uninit-consts.rs rename to tests/codegen-llvm/uninit-consts.rs diff --git a/tests/codegen/uninit-repeat-in-aggregate.rs b/tests/codegen-llvm/uninit-repeat-in-aggregate.rs similarity index 100% rename from tests/codegen/uninit-repeat-in-aggregate.rs rename to tests/codegen-llvm/uninit-repeat-in-aggregate.rs diff --git a/tests/codegen/union-abi.rs b/tests/codegen-llvm/union-abi.rs similarity index 100% rename from tests/codegen/union-abi.rs rename to tests/codegen-llvm/union-abi.rs diff --git a/tests/codegen/union-aggregate.rs b/tests/codegen-llvm/union-aggregate.rs similarity index 100% rename from tests/codegen/union-aggregate.rs rename to tests/codegen-llvm/union-aggregate.rs diff --git a/tests/codegen/unwind-abis/aapcs-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/aapcs-unwind-abi.rs similarity index 100% rename from tests/codegen/unwind-abis/aapcs-unwind-abi.rs rename to tests/codegen-llvm/unwind-abis/aapcs-unwind-abi.rs diff --git a/tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs b/tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs similarity index 100% rename from tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs rename to tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs diff --git a/tests/codegen/unwind-abis/c-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/c-unwind-abi.rs similarity index 100% rename from tests/codegen/unwind-abis/c-unwind-abi.rs rename to tests/codegen-llvm/unwind-abis/c-unwind-abi.rs diff --git a/tests/codegen/unwind-abis/cdecl-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/cdecl-unwind-abi.rs similarity index 100% rename from tests/codegen/unwind-abis/cdecl-unwind-abi.rs rename to tests/codegen-llvm/unwind-abis/cdecl-unwind-abi.rs diff --git a/tests/codegen/unwind-abis/fastcall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/fastcall-unwind-abi.rs similarity index 100% rename from tests/codegen/unwind-abis/fastcall-unwind-abi.rs rename to tests/codegen-llvm/unwind-abis/fastcall-unwind-abi.rs diff --git a/tests/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs b/tests/codegen-llvm/unwind-abis/nounwind-on-stable-panic-abort.rs similarity index 100% rename from tests/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs rename to tests/codegen-llvm/unwind-abis/nounwind-on-stable-panic-abort.rs diff --git a/tests/codegen/unwind-abis/nounwind.rs b/tests/codegen-llvm/unwind-abis/nounwind.rs similarity index 100% rename from tests/codegen/unwind-abis/nounwind.rs rename to tests/codegen-llvm/unwind-abis/nounwind.rs diff --git a/tests/codegen/unwind-abis/stdcall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/stdcall-unwind-abi.rs similarity index 100% rename from tests/codegen/unwind-abis/stdcall-unwind-abi.rs rename to tests/codegen-llvm/unwind-abis/stdcall-unwind-abi.rs diff --git a/tests/codegen/unwind-abis/system-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/system-unwind-abi.rs similarity index 100% rename from tests/codegen/unwind-abis/system-unwind-abi.rs rename to tests/codegen-llvm/unwind-abis/system-unwind-abi.rs diff --git a/tests/codegen/unwind-abis/sysv64-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/sysv64-unwind-abi.rs similarity index 100% rename from tests/codegen/unwind-abis/sysv64-unwind-abi.rs rename to tests/codegen-llvm/unwind-abis/sysv64-unwind-abi.rs diff --git a/tests/codegen/unwind-abis/thiscall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/thiscall-unwind-abi.rs similarity index 100% rename from tests/codegen/unwind-abis/thiscall-unwind-abi.rs rename to tests/codegen-llvm/unwind-abis/thiscall-unwind-abi.rs diff --git a/tests/codegen/unwind-abis/vectorcall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/vectorcall-unwind-abi.rs similarity index 100% rename from tests/codegen/unwind-abis/vectorcall-unwind-abi.rs rename to tests/codegen-llvm/unwind-abis/vectorcall-unwind-abi.rs diff --git a/tests/codegen/unwind-abis/win64-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/win64-unwind-abi.rs similarity index 100% rename from tests/codegen/unwind-abis/win64-unwind-abi.rs rename to tests/codegen-llvm/unwind-abis/win64-unwind-abi.rs diff --git a/tests/codegen/unwind-and-panic-abort.rs b/tests/codegen-llvm/unwind-and-panic-abort.rs similarity index 100% rename from tests/codegen/unwind-and-panic-abort.rs rename to tests/codegen-llvm/unwind-and-panic-abort.rs diff --git a/tests/codegen/unwind-extern-exports.rs b/tests/codegen-llvm/unwind-extern-exports.rs similarity index 100% rename from tests/codegen/unwind-extern-exports.rs rename to tests/codegen-llvm/unwind-extern-exports.rs diff --git a/tests/codegen/unwind-extern-imports.rs b/tests/codegen-llvm/unwind-extern-imports.rs similarity index 100% rename from tests/codegen/unwind-extern-imports.rs rename to tests/codegen-llvm/unwind-extern-imports.rs diff --git a/tests/codegen/unwind-landingpad-cold.rs b/tests/codegen-llvm/unwind-landingpad-cold.rs similarity index 100% rename from tests/codegen/unwind-landingpad-cold.rs rename to tests/codegen-llvm/unwind-landingpad-cold.rs diff --git a/tests/codegen/unwind-landingpad-inline.rs b/tests/codegen-llvm/unwind-landingpad-inline.rs similarity index 100% rename from tests/codegen/unwind-landingpad-inline.rs rename to tests/codegen-llvm/unwind-landingpad-inline.rs diff --git a/tests/codegen/used_with_arg.rs b/tests/codegen-llvm/used_with_arg.rs similarity index 100% rename from tests/codegen/used_with_arg.rs rename to tests/codegen-llvm/used_with_arg.rs diff --git a/tests/codegen/var-names.rs b/tests/codegen-llvm/var-names.rs similarity index 100% rename from tests/codegen/var-names.rs rename to tests/codegen-llvm/var-names.rs diff --git a/tests/codegen/vec-as-ptr.rs b/tests/codegen-llvm/vec-as-ptr.rs similarity index 100% rename from tests/codegen/vec-as-ptr.rs rename to tests/codegen-llvm/vec-as-ptr.rs diff --git a/tests/codegen/vec-calloc.rs b/tests/codegen-llvm/vec-calloc.rs similarity index 100% rename from tests/codegen/vec-calloc.rs rename to tests/codegen-llvm/vec-calloc.rs diff --git a/tests/codegen/vec-in-place.rs b/tests/codegen-llvm/vec-in-place.rs similarity index 100% rename from tests/codegen/vec-in-place.rs rename to tests/codegen-llvm/vec-in-place.rs diff --git a/tests/codegen/vec-iter-collect-len.rs b/tests/codegen-llvm/vec-iter-collect-len.rs similarity index 100% rename from tests/codegen/vec-iter-collect-len.rs rename to tests/codegen-llvm/vec-iter-collect-len.rs diff --git a/tests/codegen/vec-iter.rs b/tests/codegen-llvm/vec-iter.rs similarity index 100% rename from tests/codegen/vec-iter.rs rename to tests/codegen-llvm/vec-iter.rs diff --git a/tests/codegen/vec-len-invariant.rs b/tests/codegen-llvm/vec-len-invariant.rs similarity index 100% rename from tests/codegen/vec-len-invariant.rs rename to tests/codegen-llvm/vec-len-invariant.rs diff --git a/tests/codegen/vec-optimizes-away.rs b/tests/codegen-llvm/vec-optimizes-away.rs similarity index 100% rename from tests/codegen/vec-optimizes-away.rs rename to tests/codegen-llvm/vec-optimizes-away.rs diff --git a/tests/codegen/vec-reserve-extend.rs b/tests/codegen-llvm/vec-reserve-extend.rs similarity index 100% rename from tests/codegen/vec-reserve-extend.rs rename to tests/codegen-llvm/vec-reserve-extend.rs diff --git a/tests/codegen/vec-shrink-panik.rs b/tests/codegen-llvm/vec-shrink-panik.rs similarity index 100% rename from tests/codegen/vec-shrink-panik.rs rename to tests/codegen-llvm/vec-shrink-panik.rs diff --git a/tests/codegen/vec-with-capacity.rs b/tests/codegen-llvm/vec-with-capacity.rs similarity index 100% rename from tests/codegen/vec-with-capacity.rs rename to tests/codegen-llvm/vec-with-capacity.rs diff --git a/tests/codegen/vec_pop_push_noop.rs b/tests/codegen-llvm/vec_pop_push_noop.rs similarity index 100% rename from tests/codegen/vec_pop_push_noop.rs rename to tests/codegen-llvm/vec_pop_push_noop.rs diff --git a/tests/codegen/vecdeque-drain.rs b/tests/codegen-llvm/vecdeque-drain.rs similarity index 100% rename from tests/codegen/vecdeque-drain.rs rename to tests/codegen-llvm/vecdeque-drain.rs diff --git a/tests/codegen/vecdeque-nonempty-get-no-panic.rs b/tests/codegen-llvm/vecdeque-nonempty-get-no-panic.rs similarity index 100% rename from tests/codegen/vecdeque-nonempty-get-no-panic.rs rename to tests/codegen-llvm/vecdeque-nonempty-get-no-panic.rs diff --git a/tests/codegen/vecdeque_no_panic.rs b/tests/codegen-llvm/vecdeque_no_panic.rs similarity index 100% rename from tests/codegen/vecdeque_no_panic.rs rename to tests/codegen-llvm/vecdeque_no_panic.rs diff --git a/tests/codegen/vecdeque_pop_push.rs b/tests/codegen-llvm/vecdeque_pop_push.rs similarity index 100% rename from tests/codegen/vecdeque_pop_push.rs rename to tests/codegen-llvm/vecdeque_pop_push.rs diff --git a/tests/codegen/virtual-call-attrs-issue-137646.rs b/tests/codegen-llvm/virtual-call-attrs-issue-137646.rs similarity index 100% rename from tests/codegen/virtual-call-attrs-issue-137646.rs rename to tests/codegen-llvm/virtual-call-attrs-issue-137646.rs diff --git a/tests/codegen/virtual-function-elimination-32bit.rs b/tests/codegen-llvm/virtual-function-elimination-32bit.rs similarity index 100% rename from tests/codegen/virtual-function-elimination-32bit.rs rename to tests/codegen-llvm/virtual-function-elimination-32bit.rs diff --git a/tests/codegen/virtual-function-elimination.rs b/tests/codegen-llvm/virtual-function-elimination.rs similarity index 100% rename from tests/codegen/virtual-function-elimination.rs rename to tests/codegen-llvm/virtual-function-elimination.rs diff --git a/tests/codegen/vtable-loads.rs b/tests/codegen-llvm/vtable-loads.rs similarity index 100% rename from tests/codegen/vtable-loads.rs rename to tests/codegen-llvm/vtable-loads.rs diff --git a/tests/codegen/vtable-upcast.rs b/tests/codegen-llvm/vtable-upcast.rs similarity index 100% rename from tests/codegen/vtable-upcast.rs rename to tests/codegen-llvm/vtable-upcast.rs diff --git a/tests/codegen/wasm_casts_trapping.rs b/tests/codegen-llvm/wasm_casts_trapping.rs similarity index 100% rename from tests/codegen/wasm_casts_trapping.rs rename to tests/codegen-llvm/wasm_casts_trapping.rs diff --git a/tests/codegen/wasm_exceptions.rs b/tests/codegen-llvm/wasm_exceptions.rs similarity index 100% rename from tests/codegen/wasm_exceptions.rs rename to tests/codegen-llvm/wasm_exceptions.rs diff --git a/tests/codegen/zip.rs b/tests/codegen-llvm/zip.rs similarity index 100% rename from tests/codegen/zip.rs rename to tests/codegen-llvm/zip.rs diff --git a/tests/codegen/zst-offset.rs b/tests/codegen-llvm/zst-offset.rs similarity index 100% rename from tests/codegen/zst-offset.rs rename to tests/codegen-llvm/zst-offset.rs diff --git a/tests/run-make/llvm-ident/rmake.rs b/tests/run-make/llvm-ident/rmake.rs index 47e6fc4de15b..b4d30ee7bfbe 100644 --- a/tests/run-make/llvm-ident/rmake.rs +++ b/tests/run-make/llvm-ident/rmake.rs @@ -27,7 +27,7 @@ fn main() { // Check LLVM IR files (including temporary outputs) have `!llvm.ident` // named metadata, reusing the related codegen test. - let llvm_ident_path = source_root().join("tests/codegen/llvm-ident.rs"); + let llvm_ident_path = source_root().join("tests/codegen-llvm/llvm-ident.rs"); let files = shallow_find_files(".", |path| has_extension(path, "ll")); for file in files { llvm_filecheck().input_file(file).arg(&llvm_ident_path).run(); diff --git a/tests/ui/abi/fixed_x18.rs b/tests/ui/abi/fixed_x18.rs index 09d163030335..baf215ba9031 100644 --- a/tests/ui/abi/fixed_x18.rs +++ b/tests/ui/abi/fixed_x18.rs @@ -1,5 +1,5 @@ // This tests that -Zfixed-x18 causes a compilation failure on targets other than aarch64. -// Behavior on aarch64 is tested by tests/codegen/fixed-x18.rs. +// Behavior on aarch64 is tested by tests/codegen-llvm/fixed-x18.rs. // //@ revisions: x64 i686 arm riscv32 riscv64 //@ dont-check-compiler-stderr diff --git a/triagebot.toml b/triagebot.toml index e34e4a88f42d..162e244c0add 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -304,7 +304,7 @@ trigger_files = [ # Tests "tests/assembly-llvm", "tests/auxiliary", - "tests/codegen", + "tests/codegen-llvm", "tests/codegen-units", "tests/COMPILER_TESTS.md", "tests/coverage", @@ -558,10 +558,10 @@ trigger_files = [ "src/doc/unstable-book/src/language-features/cfg-sanitize.md", "src/doc/unstable-book/src/language-features/cfi-encoding.md", "src/doc/unstable-book/src/language-features/no-sanitize.md", - "tests/codegen/sanitizer", - "tests/codegen/split-lto-unit.rs", - "tests/codegen/stack-probes-inline.rs", - "tests/codegen/stack-protector.rs", + "tests/codegen-llvm/sanitizer", + "tests/codegen-llvm/split-lto-unit.rs", + "tests/codegen-llvm/stack-probes-inline.rs", + "tests/codegen-llvm/stack-protector.rs", "tests/ui/sanitizer", "tests/ui/stack-protector" ] @@ -1183,16 +1183,16 @@ cc = ["@Urgau"] [mentions."src/doc/rustc/src/platform-support"] cc = ["@Noratrieb"] -[mentions."tests/codegen/sanitizer"] +[mentions."tests/codegen-llvm/sanitizer"] cc = ["@rcvalle"] -[mentions."tests/codegen/split-lto-unit.rs"] +[mentions."tests/codegen-llvm/split-lto-unit.rs"] cc = ["@rust-lang/project-exploit-mitigations", "@rcvalle"] -[mentions."tests/codegen/stack-probes-inline.rs"] +[mentions."tests/codegen-llvm/stack-probes-inline.rs"] cc = ["@rust-lang/project-exploit-mitigations", "@rcvalle"] -[mentions."tests/codegen/stack-protector.rs"] +[mentions."tests/codegen-llvm/stack-protector.rs"] cc = ["@rust-lang/project-exploit-mitigations", "@rcvalle"] [mentions."tests/ui/sanitizer"] From 6bfa00816d7e4dcb0aee9fe547bc75dfe59dc613 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 21 Jul 2025 11:51:36 +0200 Subject: [PATCH 165/183] Only run `tests/assembly-*` and `tests/codegen-*` tests if they match the current codegen backend --- src/tools/compiletest/src/common.rs | 4 ++-- src/tools/compiletest/src/lib.rs | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 12084fa0b15d..aceae3e3a3b9 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -57,8 +57,8 @@ impl TestMode { string_enum! { #[derive(Clone, Copy, PartialEq, Debug)] pub enum TestSuite { - Assembly => "assembly", - Codegen => "codegen", + AssemblyLlvm => "assembly-llvm", + CodegenLlvm => "codegen-llvm", CodegenUnits => "codegen-units", Coverage => "coverage", CoverageRunRustdoc => "coverage-run-rustdoc", diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index 41bed8ed8a0a..c712185733c6 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -31,7 +31,7 @@ use std::time::SystemTime; use std::{env, fs, vec}; use build_helper::git::{get_git_modified_files, get_git_untracked_files}; -use camino::{Utf8Path, Utf8PathBuf}; +use camino::{Utf8Component, Utf8Path, Utf8PathBuf}; use getopts::Options; use rayon::iter::{ParallelBridge, ParallelIterator}; use tracing::debug; @@ -799,6 +799,23 @@ fn collect_tests_from_dir( return Ok(TestCollector::new()); } + let mut components = dir.components().rev(); + if let Some(Utf8Component::Normal(last)) = components.next() + && let Some(("assembly" | "codegen", backend)) = last.split_once('-') + && let Some(Utf8Component::Normal(parent)) = components.next() + && parent == "tests" + && let Ok(backend) = CodegenBackend::try_from(backend) + && backend != cx.config.codegen_backend + { + // We ignore asm tests which don't match the current codegen backend. + warning!( + "Ignoring tests in `{dir}` because they don't match the configured codegen \ + backend (`{}`)", + cx.config.codegen_backend.as_str(), + ); + return Ok(TestCollector::new()); + } + // For run-make tests, a "test file" is actually a directory that contains an `rmake.rs`. if cx.config.mode == TestMode::RunMake { let mut collector = TestCollector::new(); From f5a33e88970ef3863a373682b72b533b0648ad63 Mon Sep 17 00:00:00 2001 From: Jens Reidel Date: Tue, 22 Jul 2025 17:31:47 +0200 Subject: [PATCH 166/183] Add powerpc64le-unknown-linux-musl to CI rustc targets I missed this in the promotion to tier 2 with host tools. Signed-off-by: Jens Reidel --- src/bootstrap/src/core/download.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs index d7c6d8dbcc3f..373fcd52052e 100644 --- a/src/bootstrap/src/core/download.rs +++ b/src/bootstrap/src/core/download.rs @@ -875,6 +875,7 @@ pub(crate) fn is_download_ci_available(target_triple: &str, llvm_assertions: boo "powerpc-unknown-linux-gnu", "powerpc64-unknown-linux-gnu", "powerpc64le-unknown-linux-gnu", + "powerpc64le-unknown-linux-musl", "riscv64gc-unknown-linux-gnu", "s390x-unknown-linux-gnu", "x86_64-apple-darwin", From 25bbaf0d5cb212d2d163c244a3ead678bd93f462 Mon Sep 17 00:00:00 2001 From: binarycat Date: Tue, 22 Jul 2025 11:58:34 -0500 Subject: [PATCH 167/183] bootstrap: add package.json and package-lock.json to dist tarball this ensures that js-related tests can still be run from within such a dist tarball. --- src/bootstrap/src/core/build_steps/dist.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index 39e4fb2ac01e..c8a54ad250cb 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -1068,6 +1068,8 @@ impl Step for PlainSourceTarball { "bootstrap.example.toml", "configure", "license-metadata.json", + "package-lock.json", + "package.json", "x", "x.ps1", "x.py", From 5b2de8ab27e4a319e23817b61830a5cc6fd1745e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 4 Jul 2025 09:26:12 +0200 Subject: [PATCH 168/183] Move `std_detect` from `library/stdarch` to `library` --- library/{stdarch/crates => }/std_detect/Cargo.toml | 0 .../{stdarch/crates => }/std_detect/LICENSE-APACHE | 0 library/{stdarch/crates => }/std_detect/LICENSE-MIT | 0 library/{stdarch/crates => }/std_detect/README.md | 0 .../std_detect/src/detect/arch/aarch64.rs | 0 .../crates => }/std_detect/src/detect/arch/arm.rs | 0 .../std_detect/src/detect/arch/loongarch.rs | 0 .../crates => }/std_detect/src/detect/arch/mips.rs | 0 .../std_detect/src/detect/arch/mips64.rs | 0 .../crates => }/std_detect/src/detect/arch/mod.rs | 0 .../std_detect/src/detect/arch/powerpc.rs | 0 .../std_detect/src/detect/arch/powerpc64.rs | 0 .../crates => }/std_detect/src/detect/arch/riscv.rs | 0 .../crates => }/std_detect/src/detect/arch/s390x.rs | 0 .../crates => }/std_detect/src/detect/arch/x86.rs | 0 .../crates => }/std_detect/src/detect/bit.rs | 0 .../crates => }/std_detect/src/detect/cache.rs | 0 .../crates => }/std_detect/src/detect/macros.rs | 0 .../crates => }/std_detect/src/detect/mod.rs | 0 .../crates => }/std_detect/src/detect/os/aarch64.rs | 0 .../std_detect/src/detect/os/darwin/aarch64.rs | 0 .../std_detect/src/detect/os/freebsd/aarch64.rs | 0 .../std_detect/src/detect/os/freebsd/arm.rs | 0 .../std_detect/src/detect/os/freebsd/auxvec.rs | 0 .../std_detect/src/detect/os/freebsd/mod.rs | 0 .../std_detect/src/detect/os/freebsd/powerpc.rs | 0 .../std_detect/src/detect/os/linux/aarch64.rs | 0 .../std_detect/src/detect/os/linux/arm.rs | 0 .../std_detect/src/detect/os/linux/auxvec.rs | 0 .../std_detect/src/detect/os/linux/loongarch.rs | 0 .../std_detect/src/detect/os/linux/mips.rs | 0 .../std_detect/src/detect/os/linux/mod.rs | 0 .../std_detect/src/detect/os/linux/powerpc.rs | 0 .../std_detect/src/detect/os/linux/riscv.rs | 0 .../std_detect/src/detect/os/linux/s390x.rs | 0 .../std_detect/src/detect/os/openbsd/aarch64.rs | 0 .../crates => }/std_detect/src/detect/os/other.rs | 0 .../crates => }/std_detect/src/detect/os/riscv.rs | 0 .../std_detect/src/detect/os/windows/aarch64.rs | 0 .../crates => }/std_detect/src/detect/os/x86.rs | 0 .../detect/test_data/linux-artificial-aarch64.auxv | Bin .../test_data/linux-empty-hwcap2-aarch64.auxv | Bin .../src/detect/test_data/linux-hwcap2-aarch64.auxv | Bin .../detect/test_data/linux-no-hwcap2-aarch64.auxv | Bin .../std_detect/src/detect/test_data/linux-rpi3.auxv | Bin .../macos-virtualbox-linux-x86-4850HQ.auxv | Bin library/{stdarch/crates => }/std_detect/src/lib.rs | 0 .../crates => }/std_detect/tests/cpu-detection.rs | 0 .../std_detect/tests/macro_trailing_commas.rs | 0 .../crates => }/std_detect/tests/x86-specific.rs | 0 50 files changed, 0 insertions(+), 0 deletions(-) rename library/{stdarch/crates => }/std_detect/Cargo.toml (100%) rename library/{stdarch/crates => }/std_detect/LICENSE-APACHE (100%) rename library/{stdarch/crates => }/std_detect/LICENSE-MIT (100%) rename library/{stdarch/crates => }/std_detect/README.md (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/aarch64.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/arm.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/loongarch.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/mips.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/mips64.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/mod.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/powerpc.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/powerpc64.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/riscv.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/s390x.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/arch/x86.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/bit.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/cache.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/macros.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/mod.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/aarch64.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/darwin/aarch64.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/freebsd/aarch64.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/freebsd/arm.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/freebsd/auxvec.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/freebsd/mod.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/freebsd/powerpc.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/linux/aarch64.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/linux/arm.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/linux/auxvec.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/linux/loongarch.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/linux/mips.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/linux/mod.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/linux/powerpc.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/linux/riscv.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/linux/s390x.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/openbsd/aarch64.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/other.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/riscv.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/windows/aarch64.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/os/x86.rs (100%) rename library/{stdarch/crates => }/std_detect/src/detect/test_data/linux-artificial-aarch64.auxv (100%) rename library/{stdarch/crates => }/std_detect/src/detect/test_data/linux-empty-hwcap2-aarch64.auxv (100%) rename library/{stdarch/crates => }/std_detect/src/detect/test_data/linux-hwcap2-aarch64.auxv (100%) rename library/{stdarch/crates => }/std_detect/src/detect/test_data/linux-no-hwcap2-aarch64.auxv (100%) rename library/{stdarch/crates => }/std_detect/src/detect/test_data/linux-rpi3.auxv (100%) rename library/{stdarch/crates => }/std_detect/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv (100%) rename library/{stdarch/crates => }/std_detect/src/lib.rs (100%) rename library/{stdarch/crates => }/std_detect/tests/cpu-detection.rs (100%) rename library/{stdarch/crates => }/std_detect/tests/macro_trailing_commas.rs (100%) rename library/{stdarch/crates => }/std_detect/tests/x86-specific.rs (100%) diff --git a/library/stdarch/crates/std_detect/Cargo.toml b/library/std_detect/Cargo.toml similarity index 100% rename from library/stdarch/crates/std_detect/Cargo.toml rename to library/std_detect/Cargo.toml diff --git a/library/stdarch/crates/std_detect/LICENSE-APACHE b/library/std_detect/LICENSE-APACHE similarity index 100% rename from library/stdarch/crates/std_detect/LICENSE-APACHE rename to library/std_detect/LICENSE-APACHE diff --git a/library/stdarch/crates/std_detect/LICENSE-MIT b/library/std_detect/LICENSE-MIT similarity index 100% rename from library/stdarch/crates/std_detect/LICENSE-MIT rename to library/std_detect/LICENSE-MIT diff --git a/library/stdarch/crates/std_detect/README.md b/library/std_detect/README.md similarity index 100% rename from library/stdarch/crates/std_detect/README.md rename to library/std_detect/README.md diff --git a/library/stdarch/crates/std_detect/src/detect/arch/aarch64.rs b/library/std_detect/src/detect/arch/aarch64.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/aarch64.rs rename to library/std_detect/src/detect/arch/aarch64.rs diff --git a/library/stdarch/crates/std_detect/src/detect/arch/arm.rs b/library/std_detect/src/detect/arch/arm.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/arm.rs rename to library/std_detect/src/detect/arch/arm.rs diff --git a/library/stdarch/crates/std_detect/src/detect/arch/loongarch.rs b/library/std_detect/src/detect/arch/loongarch.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/loongarch.rs rename to library/std_detect/src/detect/arch/loongarch.rs diff --git a/library/stdarch/crates/std_detect/src/detect/arch/mips.rs b/library/std_detect/src/detect/arch/mips.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/mips.rs rename to library/std_detect/src/detect/arch/mips.rs diff --git a/library/stdarch/crates/std_detect/src/detect/arch/mips64.rs b/library/std_detect/src/detect/arch/mips64.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/mips64.rs rename to library/std_detect/src/detect/arch/mips64.rs diff --git a/library/stdarch/crates/std_detect/src/detect/arch/mod.rs b/library/std_detect/src/detect/arch/mod.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/mod.rs rename to library/std_detect/src/detect/arch/mod.rs diff --git a/library/stdarch/crates/std_detect/src/detect/arch/powerpc.rs b/library/std_detect/src/detect/arch/powerpc.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/powerpc.rs rename to library/std_detect/src/detect/arch/powerpc.rs diff --git a/library/stdarch/crates/std_detect/src/detect/arch/powerpc64.rs b/library/std_detect/src/detect/arch/powerpc64.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/powerpc64.rs rename to library/std_detect/src/detect/arch/powerpc64.rs diff --git a/library/stdarch/crates/std_detect/src/detect/arch/riscv.rs b/library/std_detect/src/detect/arch/riscv.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/riscv.rs rename to library/std_detect/src/detect/arch/riscv.rs diff --git a/library/stdarch/crates/std_detect/src/detect/arch/s390x.rs b/library/std_detect/src/detect/arch/s390x.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/s390x.rs rename to library/std_detect/src/detect/arch/s390x.rs diff --git a/library/stdarch/crates/std_detect/src/detect/arch/x86.rs b/library/std_detect/src/detect/arch/x86.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/arch/x86.rs rename to library/std_detect/src/detect/arch/x86.rs diff --git a/library/stdarch/crates/std_detect/src/detect/bit.rs b/library/std_detect/src/detect/bit.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/bit.rs rename to library/std_detect/src/detect/bit.rs diff --git a/library/stdarch/crates/std_detect/src/detect/cache.rs b/library/std_detect/src/detect/cache.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/cache.rs rename to library/std_detect/src/detect/cache.rs diff --git a/library/stdarch/crates/std_detect/src/detect/macros.rs b/library/std_detect/src/detect/macros.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/macros.rs rename to library/std_detect/src/detect/macros.rs diff --git a/library/stdarch/crates/std_detect/src/detect/mod.rs b/library/std_detect/src/detect/mod.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/mod.rs rename to library/std_detect/src/detect/mod.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/aarch64.rs b/library/std_detect/src/detect/os/aarch64.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/aarch64.rs rename to library/std_detect/src/detect/os/aarch64.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/darwin/aarch64.rs b/library/std_detect/src/detect/os/darwin/aarch64.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/darwin/aarch64.rs rename to library/std_detect/src/detect/os/darwin/aarch64.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/freebsd/aarch64.rs b/library/std_detect/src/detect/os/freebsd/aarch64.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/freebsd/aarch64.rs rename to library/std_detect/src/detect/os/freebsd/aarch64.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/freebsd/arm.rs b/library/std_detect/src/detect/os/freebsd/arm.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/freebsd/arm.rs rename to library/std_detect/src/detect/os/freebsd/arm.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/freebsd/auxvec.rs b/library/std_detect/src/detect/os/freebsd/auxvec.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/freebsd/auxvec.rs rename to library/std_detect/src/detect/os/freebsd/auxvec.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/freebsd/mod.rs b/library/std_detect/src/detect/os/freebsd/mod.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/freebsd/mod.rs rename to library/std_detect/src/detect/os/freebsd/mod.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/freebsd/powerpc.rs b/library/std_detect/src/detect/os/freebsd/powerpc.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/freebsd/powerpc.rs rename to library/std_detect/src/detect/os/freebsd/powerpc.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/aarch64.rs b/library/std_detect/src/detect/os/linux/aarch64.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/linux/aarch64.rs rename to library/std_detect/src/detect/os/linux/aarch64.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/arm.rs b/library/std_detect/src/detect/os/linux/arm.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/linux/arm.rs rename to library/std_detect/src/detect/os/linux/arm.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs b/library/std_detect/src/detect/os/linux/auxvec.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs rename to library/std_detect/src/detect/os/linux/auxvec.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/loongarch.rs b/library/std_detect/src/detect/os/linux/loongarch.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/linux/loongarch.rs rename to library/std_detect/src/detect/os/linux/loongarch.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/mips.rs b/library/std_detect/src/detect/os/linux/mips.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/linux/mips.rs rename to library/std_detect/src/detect/os/linux/mips.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/mod.rs b/library/std_detect/src/detect/os/linux/mod.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/linux/mod.rs rename to library/std_detect/src/detect/os/linux/mod.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/powerpc.rs b/library/std_detect/src/detect/os/linux/powerpc.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/linux/powerpc.rs rename to library/std_detect/src/detect/os/linux/powerpc.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/riscv.rs b/library/std_detect/src/detect/os/linux/riscv.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/linux/riscv.rs rename to library/std_detect/src/detect/os/linux/riscv.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/s390x.rs b/library/std_detect/src/detect/os/linux/s390x.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/linux/s390x.rs rename to library/std_detect/src/detect/os/linux/s390x.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/openbsd/aarch64.rs b/library/std_detect/src/detect/os/openbsd/aarch64.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/openbsd/aarch64.rs rename to library/std_detect/src/detect/os/openbsd/aarch64.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/other.rs b/library/std_detect/src/detect/os/other.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/other.rs rename to library/std_detect/src/detect/os/other.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/riscv.rs b/library/std_detect/src/detect/os/riscv.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/riscv.rs rename to library/std_detect/src/detect/os/riscv.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs b/library/std_detect/src/detect/os/windows/aarch64.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs rename to library/std_detect/src/detect/os/windows/aarch64.rs diff --git a/library/stdarch/crates/std_detect/src/detect/os/x86.rs b/library/std_detect/src/detect/os/x86.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/os/x86.rs rename to library/std_detect/src/detect/os/x86.rs diff --git a/library/stdarch/crates/std_detect/src/detect/test_data/linux-artificial-aarch64.auxv b/library/std_detect/src/detect/test_data/linux-artificial-aarch64.auxv similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/test_data/linux-artificial-aarch64.auxv rename to library/std_detect/src/detect/test_data/linux-artificial-aarch64.auxv diff --git a/library/stdarch/crates/std_detect/src/detect/test_data/linux-empty-hwcap2-aarch64.auxv b/library/std_detect/src/detect/test_data/linux-empty-hwcap2-aarch64.auxv similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/test_data/linux-empty-hwcap2-aarch64.auxv rename to library/std_detect/src/detect/test_data/linux-empty-hwcap2-aarch64.auxv diff --git a/library/stdarch/crates/std_detect/src/detect/test_data/linux-hwcap2-aarch64.auxv b/library/std_detect/src/detect/test_data/linux-hwcap2-aarch64.auxv similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/test_data/linux-hwcap2-aarch64.auxv rename to library/std_detect/src/detect/test_data/linux-hwcap2-aarch64.auxv diff --git a/library/stdarch/crates/std_detect/src/detect/test_data/linux-no-hwcap2-aarch64.auxv b/library/std_detect/src/detect/test_data/linux-no-hwcap2-aarch64.auxv similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/test_data/linux-no-hwcap2-aarch64.auxv rename to library/std_detect/src/detect/test_data/linux-no-hwcap2-aarch64.auxv diff --git a/library/stdarch/crates/std_detect/src/detect/test_data/linux-rpi3.auxv b/library/std_detect/src/detect/test_data/linux-rpi3.auxv similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/test_data/linux-rpi3.auxv rename to library/std_detect/src/detect/test_data/linux-rpi3.auxv diff --git a/library/stdarch/crates/std_detect/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv b/library/std_detect/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv similarity index 100% rename from library/stdarch/crates/std_detect/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv rename to library/std_detect/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv diff --git a/library/stdarch/crates/std_detect/src/lib.rs b/library/std_detect/src/lib.rs similarity index 100% rename from library/stdarch/crates/std_detect/src/lib.rs rename to library/std_detect/src/lib.rs diff --git a/library/stdarch/crates/std_detect/tests/cpu-detection.rs b/library/std_detect/tests/cpu-detection.rs similarity index 100% rename from library/stdarch/crates/std_detect/tests/cpu-detection.rs rename to library/std_detect/tests/cpu-detection.rs diff --git a/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs b/library/std_detect/tests/macro_trailing_commas.rs similarity index 100% rename from library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs rename to library/std_detect/tests/macro_trailing_commas.rs diff --git a/library/stdarch/crates/std_detect/tests/x86-specific.rs b/library/std_detect/tests/x86-specific.rs similarity index 100% rename from library/stdarch/crates/std_detect/tests/x86-specific.rs rename to library/std_detect/tests/x86-specific.rs From b23ab7888a06f548e8d9a5951e97cb68399e31b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 4 Jul 2025 09:51:28 +0200 Subject: [PATCH 169/183] Make `std_detect` a direct dependency of `std` --- library/Cargo.lock | 4 ++-- library/std/Cargo.toml | 7 ++----- library/std_detect/Cargo.toml | 12 +++--------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/library/Cargo.lock b/library/Cargo.lock index 8b5275e5065e..94155e083981 100644 --- a/library/Cargo.lock +++ b/library/Cargo.lock @@ -340,10 +340,10 @@ dependencies = [ name = "std_detect" version = "0.1.5" dependencies = [ + "alloc", "cfg-if", + "core", "libc", - "rustc-std-workspace-alloc", - "rustc-std-workspace-core", ] [[package]] diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml index 5c3132a7375a..ba1e1f5218af 100644 --- a/library/std/Cargo.toml +++ b/library/std/Cargo.toml @@ -23,9 +23,7 @@ unwind = { path = "../unwind" } hashbrown = { version = "0.15", default-features = false, features = [ 'rustc-dep-of-std', ] } -std_detect = { path = "../stdarch/crates/std_detect", public = true, default-features = false, features = [ - 'rustc-dep-of-std', -] } +std_detect = { path = "../std_detect", public = true } # Dependencies of the `backtrace` crate rustc-demangle = { version = "0.1.24", features = ['rustc-dep-of-std'] } @@ -118,8 +116,7 @@ optimize_for_size = ["core/optimize_for_size", "alloc/optimize_for_size"] debug_refcell = ["core/debug_refcell"] -# Enable std_detect default features for stdarch/crates/std_detect: -# https://github.com/rust-lang/stdarch/blob/master/crates/std_detect/Cargo.toml +# Enable std_detect features: std_detect_file_io = ["std_detect/std_detect_file_io"] std_detect_dlsym_getauxval = ["std_detect/std_detect_dlsym_getauxval"] diff --git a/library/std_detect/Cargo.toml b/library/std_detect/Cargo.toml index f990e7241252..8d91454726bc 100644 --- a/library/std_detect/Cargo.toml +++ b/library/std_detect/Cargo.toml @@ -22,20 +22,14 @@ maintenance = { status = "experimental" } [dependencies] cfg-if = "1.0.0" - -# When built as part of libstd -core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" } -alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" } +core = { path = "../core" } +alloc = { path = "../alloc" } [target.'cfg(not(windows))'.dependencies] libc = { version = "0.2.0", optional = true, default-features = false } [features] -default = [ "std_detect_dlsym_getauxval", "std_detect_file_io" ] +default = [] std_detect_file_io = [ "libc" ] std_detect_dlsym_getauxval = [ "libc" ] std_detect_env_override = [ "libc" ] -rustc-dep-of-std = [ - "core", - "alloc", -] From 1057a2213af6fd273da86f13edeae559bfdd587d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 4 Jul 2025 10:08:50 +0200 Subject: [PATCH 170/183] Allow platform-specific code in `std_detect` --- src/tools/tidy/src/pal.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/tidy/src/pal.rs b/src/tools/tidy/src/pal.rs index b7d4a331891a..5b8b44429bbc 100644 --- a/src/tools/tidy/src/pal.rs +++ b/src/tools/tidy/src/pal.rs @@ -37,6 +37,7 @@ use crate::walk::{filter_dirs, walk}; // Paths that may contain platform-specific code. const EXCEPTION_PATHS: &[&str] = &[ "library/compiler-builtins", + "library/std_detect", "library/windows_targets", "library/panic_abort", "library/panic_unwind", From ee6f2c5276c3e19b919abb61693e66b0ded9c8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 4 Jul 2025 10:08:58 +0200 Subject: [PATCH 171/183] Reformat `std_detect` --- library/std_detect/src/detect/cache.rs | 38 +++----------- library/std_detect/src/detect/mod.rs | 1 - library/std_detect/src/detect/os/aarch64.rs | 8 ++- .../src/detect/os/darwin/aarch64.rs | 11 ++-- .../src/detect/os/freebsd/auxvec.rs | 7 +-- .../std_detect/src/detect/os/linux/aarch64.rs | 10 +--- .../src/detect/os/linux/loongarch.rs | 15 ++---- .../std_detect/src/detect/os/linux/riscv.rs | 11 +--- .../src/detect/os/openbsd/aarch64.rs | 4 +- library/std_detect/src/detect/os/x86.rs | 39 ++++----------- library/std_detect/tests/cpu-detection.rs | 50 ++++--------------- library/std_detect/tests/x86-specific.rs | 42 +++------------- 12 files changed, 54 insertions(+), 182 deletions(-) diff --git a/library/std_detect/src/detect/cache.rs b/library/std_detect/src/detect/cache.rs index 83bcedea612e..1a42e0914631 100644 --- a/library/std_detect/src/detect/cache.rs +++ b/library/std_detect/src/detect/cache.rs @@ -3,9 +3,7 @@ #![allow(dead_code)] // not used on all platforms -use core::sync::atomic::Ordering; - -use core::sync::atomic::AtomicUsize; +use core::sync::atomic::{AtomicUsize, Ordering}; /// Sets the `bit` of `x`. #[inline] @@ -40,20 +38,14 @@ impl Initializer { /// Tests the `bit` of the cache. #[inline] pub(crate) fn test(self, bit: u32) -> bool { - debug_assert!( - bit < CACHE_CAPACITY, - "too many features, time to increase the cache size!" - ); + debug_assert!(bit < CACHE_CAPACITY, "too many features, time to increase the cache size!"); test_bit(self.0, bit) } /// Sets the `bit` of the cache. #[inline] pub(crate) fn set(&mut self, bit: u32) { - debug_assert!( - bit < CACHE_CAPACITY, - "too many features, time to increase the cache size!" - ); + debug_assert!(bit < CACHE_CAPACITY, "too many features, time to increase the cache size!"); let v = self.0; self.0 = set_bit(v, bit); } @@ -61,10 +53,7 @@ impl Initializer { /// Unsets the `bit` of the cache. #[inline] pub(crate) fn unset(&mut self, bit: u32) { - debug_assert!( - bit < CACHE_CAPACITY, - "too many features, time to increase the cache size!" - ); + debug_assert!(bit < CACHE_CAPACITY, "too many features, time to increase the cache size!"); let v = self.0; self.0 = unset_bit(v, bit); } @@ -73,11 +62,7 @@ impl Initializer { /// This global variable is a cache of the features supported by the CPU. // Note: the third slot is only used in x86 // Another Slot can be added if needed without any change to `Initializer` -static CACHE: [Cache; 3] = [ - Cache::uninitialized(), - Cache::uninitialized(), - Cache::uninitialized(), -]; +static CACHE: [Cache; 3] = [Cache::uninitialized(), Cache::uninitialized(), Cache::uninitialized()]; /// Feature cache with capacity for `size_of::() * 8 - 1` features. /// @@ -104,19 +89,14 @@ impl Cache { #[inline] pub(crate) fn test(&self, bit: u32) -> Option { let cached = self.0.load(Ordering::Relaxed); - if cached == 0 { - None - } else { - Some(test_bit(cached as u128, bit)) - } + if cached == 0 { None } else { Some(test_bit(cached as u128, bit)) } } /// Initializes the cache. #[inline] fn initialize(&self, value: usize) -> usize { debug_assert_eq!((value & !Cache::MASK), 0); - self.0 - .store(value | Cache::INITIALIZED_BIT, Ordering::Relaxed); + self.0.store(value | Cache::INITIALIZED_BIT, Ordering::Relaxed); value } } @@ -217,7 +197,5 @@ pub(crate) fn test(bit: u32) -> bool { } else { (bit - 2 * Cache::CAPACITY, 2) }; - CACHE[idx] - .test(relative_bit) - .unwrap_or_else(|| detect_and_initialize().test(bit)) + CACHE[idx].test(relative_bit).unwrap_or_else(|| detect_and_initialize().test(bit)) } diff --git a/library/std_detect/src/detect/mod.rs b/library/std_detect/src/detect/mod.rs index a9e9709c1f67..f936a5a1345d 100644 --- a/library/std_detect/src/detect/mod.rs +++ b/library/std_detect/src/detect/mod.rs @@ -29,7 +29,6 @@ mod arch; #[doc(hidden)] #[unstable(feature = "stdarch_internal", issue = "none")] pub use self::arch::__is_feature_detected; - pub(crate) use self::arch::Feature; mod bit; diff --git a/library/std_detect/src/detect/os/aarch64.rs b/library/std_detect/src/detect/os/aarch64.rs index 1ff2a17e6e1e..c2c754ccf8db 100644 --- a/library/std_detect/src/detect/os/aarch64.rs +++ b/library/std_detect/src/detect/os/aarch64.rs @@ -17,9 +17,10 @@ //! - [Linux documentation](https://www.kernel.org/doc/Documentation/arm64/cpu-feature-registers.txt) //! - [ARM documentation](https://developer.arm.com/documentation/ddi0601/2022-12/AArch64-Registers?lang=en) -use crate::detect::{Feature, cache}; use core::arch::asm; +use crate::detect::{Feature, cache}; + /// Try to read the features from the system registers. /// /// This will cause SIGILL if the current OS is not trapping the mrs instruction. @@ -104,10 +105,7 @@ pub(crate) fn parse_system_registers( let sha2 = bits_shift(aa64isar0, 15, 12) >= 1; enable_feature(Feature::sha2, asimd && sha1 && sha2); enable_feature(Feature::rdm, asimd && bits_shift(aa64isar0, 31, 28) >= 1); - enable_feature( - Feature::dotprod, - asimd && bits_shift(aa64isar0, 47, 44) >= 1, - ); + enable_feature(Feature::dotprod, asimd && bits_shift(aa64isar0, 47, 44) >= 1); enable_feature(Feature::sve, asimd && bits_shift(aa64pfr0, 35, 32) >= 1); } diff --git a/library/std_detect/src/detect/os/darwin/aarch64.rs b/library/std_detect/src/detect/os/darwin/aarch64.rs index 44d921689e5a..f5409361d93b 100644 --- a/library/std_detect/src/detect/os/darwin/aarch64.rs +++ b/library/std_detect/src/detect/os/darwin/aarch64.rs @@ -2,9 +2,10 @@ //! //! -use crate::detect::{Feature, cache}; use core::ffi::CStr; +use crate::detect::{Feature, cache}; + #[inline] fn _sysctlbyname(name: &CStr) -> bool { use libc; @@ -14,13 +15,7 @@ fn _sysctlbyname(name: &CStr) -> bool { let enabled_ptr = &mut enabled as *mut i32 as *mut libc::c_void; let ret = unsafe { - libc::sysctlbyname( - name.as_ptr(), - enabled_ptr, - &mut enabled_len, - core::ptr::null_mut(), - 0, - ) + libc::sysctlbyname(name.as_ptr(), enabled_ptr, &mut enabled_len, core::ptr::null_mut(), 0) }; match ret { diff --git a/library/std_detect/src/detect/os/freebsd/auxvec.rs b/library/std_detect/src/detect/os/freebsd/auxvec.rs index 4e72bf22d76c..2a7b87c05d1c 100644 --- a/library/std_detect/src/detect/os/freebsd/auxvec.rs +++ b/library/std_detect/src/detect/os/freebsd/auxvec.rs @@ -54,11 +54,8 @@ fn archauxv(key: libc::c_int) -> usize { // https://github.com/freebsd/freebsd-src/blob/release/11.4.0/sys/sys/auxv.h // FreeBSD 11 support in std has been removed in Rust 1.75 (https://github.com/rust-lang/rust/pull/114521), // so we can safely use this function. - let res = libc::elf_aux_info( - key, - &mut out as *mut libc::c_ulong as *mut libc::c_void, - OUT_LEN, - ); + let res = + libc::elf_aux_info(key, &mut out as *mut libc::c_ulong as *mut libc::c_void, OUT_LEN); // If elf_aux_info fails, `out` will be left at zero (which is the proper default value). debug_assert!(res == 0 || out == 0); } diff --git a/library/std_detect/src/detect/os/linux/aarch64.rs b/library/std_detect/src/detect/os/linux/aarch64.rs index 22a9cefff7b8..0de4beeae8b3 100644 --- a/library/std_detect/src/detect/os/linux/aarch64.rs +++ b/library/std_detect/src/detect/os/linux/aarch64.rs @@ -343,14 +343,8 @@ impl AtHwcap { enable_feature(Feature::sve2, sve2); enable_feature(Feature::sve2p1, self.sve2p1 && sve2); // SVE2 extensions require SVE2 and crypto features - enable_feature( - Feature::sve2_aes, - self.sveaes && self.svepmull && sve2 && self.aes, - ); - enable_feature( - Feature::sve2_sm4, - self.svesm4 && sve2 && self.sm3 && self.sm4, - ); + enable_feature(Feature::sve2_aes, self.sveaes && self.svepmull && sve2 && self.aes); + enable_feature(Feature::sve2_sm4, self.svesm4 && sve2 && self.sm3 && self.sm4); enable_feature( Feature::sve2_sha3, self.svesha3 && sve2 && self.sha512 && self.sha3 && self.sha1 && self.sha2, diff --git a/library/std_detect/src/detect/os/linux/loongarch.rs b/library/std_detect/src/detect/os/linux/loongarch.rs index 14cc7a731835..e97fda11d08f 100644 --- a/library/std_detect/src/detect/os/linux/loongarch.rs +++ b/library/std_detect/src/detect/os/linux/loongarch.rs @@ -1,8 +1,9 @@ //! Run-time feature detection for LoongArch on Linux. +use core::arch::asm; + use super::auxvec; use crate::detect::{Feature, bit, cache}; -use core::arch::asm; /// Try to read the features from the auxiliary vector. pub(crate) fn detect_features() -> cache::Initializer { @@ -43,16 +44,8 @@ pub(crate) fn detect_features() -> cache::Initializer { // // [hwcap]: https://github.com/torvalds/linux/blob/master/arch/loongarch/include/uapi/asm/hwcap.h if let Ok(auxv) = auxvec::auxv() { - enable_feature( - &mut value, - Feature::f, - bit::test(cpucfg2, 1) && bit::test(auxv.hwcap, 3), - ); - enable_feature( - &mut value, - Feature::d, - bit::test(cpucfg2, 2) && bit::test(auxv.hwcap, 3), - ); + enable_feature(&mut value, Feature::f, bit::test(cpucfg2, 1) && bit::test(auxv.hwcap, 3)); + enable_feature(&mut value, Feature::d, bit::test(cpucfg2, 2) && bit::test(auxv.hwcap, 3)); enable_feature(&mut value, Feature::lsx, bit::test(auxv.hwcap, 4)); enable_feature(&mut value, Feature::lasx, bit::test(auxv.hwcap, 5)); enable_feature( diff --git a/library/std_detect/src/detect/os/linux/riscv.rs b/library/std_detect/src/detect/os/linux/riscv.rs index db20538af951..dbb3664890e5 100644 --- a/library/std_detect/src/detect/os/linux/riscv.rs +++ b/library/std_detect/src/detect/os/linux/riscv.rs @@ -119,16 +119,7 @@ fn _riscv_hwprobe(out: &mut [riscv_hwprobe]) -> bool { cpus: *mut libc::c_ulong, flags: libc::c_uint, ) -> libc::c_long { - unsafe { - libc::syscall( - __NR_riscv_hwprobe, - pairs, - pair_count, - cpu_set_size, - cpus, - flags, - ) - } + unsafe { libc::syscall(__NR_riscv_hwprobe, pairs, pair_count, cpu_set_size, cpus, flags) } } unsafe { __riscv_hwprobe(out.as_mut_ptr(), out.len(), 0, ptr::null_mut(), 0) == 0 } diff --git a/library/std_detect/src/detect/os/openbsd/aarch64.rs b/library/std_detect/src/detect/os/openbsd/aarch64.rs index cfe4ad10ad64..2fae47b05c40 100644 --- a/library/std_detect/src/detect/os/openbsd/aarch64.rs +++ b/library/std_detect/src/detect/os/openbsd/aarch64.rs @@ -4,8 +4,10 @@ //! https://github.com/openbsd/src/commit/d335af936b9d7dd9cf655cae1ce19560c45de6c8 //! https://github.com/golang/go/commit/cd54ef1f61945459486e9eea2f016d99ef1da925 +use core::mem::MaybeUninit; +use core::ptr; + use crate::detect::cache; -use core::{mem::MaybeUninit, ptr}; // Defined in machine/cpu.h. // https://github.com/openbsd/src/blob/72ccc03bd11da614f31f7ff76e3f6fce99bc1c79/sys/arch/arm64/include/cpu.h#L25-L40 diff --git a/library/std_detect/src/detect/os/x86.rs b/library/std_detect/src/detect/os/x86.rs index 8565c2f85e24..20f848ab05ca 100644 --- a/library/std_detect/src/detect/os/x86.rs +++ b/library/std_detect/src/detect/os/x86.rs @@ -4,7 +4,6 @@ use core::arch::x86::*; #[cfg(target_arch = "x86_64")] use core::arch::x86_64::*; - use core::mem; use crate::detect::{Feature, bit, cache}; @@ -42,12 +41,7 @@ pub(crate) fn detect_features() -> cache::Initializer { // 0x8000_0000]. - The vendor ID is stored in 12 u8 ascii chars, // returned in EBX, EDX, and ECX (in that order): let (max_basic_leaf, vendor_id) = unsafe { - let CpuidResult { - eax: max_basic_leaf, - ebx, - ecx, - edx, - } = __cpuid(0); + let CpuidResult { eax: max_basic_leaf, ebx, ecx, edx } = __cpuid(0); let vendor_id: [[u8; 4]; 3] = [ebx.to_ne_bytes(), edx.to_ne_bytes(), ecx.to_ne_bytes()]; let vendor_id: [u8; 12] = mem::transmute(vendor_id); (max_basic_leaf, vendor_id) @@ -60,11 +54,8 @@ pub(crate) fn detect_features() -> cache::Initializer { // EAX = 1, ECX = 0: Queries "Processor Info and Feature Bits"; // Contains information about most x86 features. - let CpuidResult { - ecx: proc_info_ecx, - edx: proc_info_edx, - .. - } = unsafe { __cpuid(0x0000_0001_u32) }; + let CpuidResult { ecx: proc_info_ecx, edx: proc_info_edx, .. } = + unsafe { __cpuid(0x0000_0001_u32) }; // EAX = 7: Queries "Extended Features"; // Contains information about bmi,bmi2, and avx2 support. @@ -76,11 +67,8 @@ pub(crate) fn detect_features() -> cache::Initializer { extended_features_edx_leaf_1, ) = if max_basic_leaf >= 7 { let CpuidResult { ebx, ecx, edx, .. } = unsafe { __cpuid(0x0000_0007_u32) }; - let CpuidResult { - eax: eax_1, - edx: edx_1, - .. - } = unsafe { __cpuid_count(0x0000_0007_u32, 0x0000_0001_u32) }; + let CpuidResult { eax: eax_1, edx: edx_1, .. } = + unsafe { __cpuid_count(0x0000_0007_u32, 0x0000_0001_u32) }; (ebx, ecx, edx, eax_1, edx_1) } else { (0, 0, 0, 0, 0) // CPUID does not support "Extended Features" @@ -89,10 +77,7 @@ pub(crate) fn detect_features() -> cache::Initializer { // EAX = 0x8000_0000, ECX = 0: Get Highest Extended Function Supported // - EAX returns the max leaf value for extended information, that is, // `cpuid` calls in range [0x8000_0000; u32::MAX]: - let CpuidResult { - eax: extended_max_basic_leaf, - .. - } = unsafe { __cpuid(0x8000_0000_u32) }; + let CpuidResult { eax: extended_max_basic_leaf, .. } = unsafe { __cpuid(0x8000_0000_u32) }; // EAX = 0x8000_0001, ECX=0: Queries "Extended Processor Info and Feature // Bits" @@ -208,10 +193,8 @@ pub(crate) fn detect_features() -> cache::Initializer { // Processor Extended State Enumeration Sub-leaf (EAX = 0DH, // ECX = 1): if max_basic_leaf >= 0xd { - let CpuidResult { - eax: proc_extended_state1_eax, - .. - } = unsafe { __cpuid_count(0xd_u32, 1) }; + let CpuidResult { eax: proc_extended_state1_eax, .. } = + unsafe { __cpuid_count(0xd_u32, 1) }; enable(proc_extended_state1_eax, 0, Feature::xsaveopt); enable(proc_extended_state1_eax, 1, Feature::xsavec); enable(proc_extended_state1_eax, 3, Feature::xsaves); @@ -269,10 +252,8 @@ pub(crate) fn detect_features() -> cache::Initializer { enable(extended_features_edx_leaf_1, 8, Feature::amx_complex); if max_basic_leaf >= 0x1e { - let CpuidResult { - eax: amx_feature_flags_eax, - .. - } = unsafe { __cpuid_count(0x1e_u32, 1) }; + let CpuidResult { eax: amx_feature_flags_eax, .. } = + unsafe { __cpuid_count(0x1e_u32, 1) }; enable(amx_feature_flags_eax, 4, Feature::amx_fp8); enable(amx_feature_flags_eax, 5, Feature::amx_transpose); diff --git a/library/std_detect/tests/cpu-detection.rs b/library/std_detect/tests/cpu-detection.rs index 7976aedc7585..09a73572c1fd 100644 --- a/library/std_detect/tests/cpu-detection.rs +++ b/library/std_detect/tests/cpu-detection.rs @@ -59,10 +59,7 @@ fn arm_linux() { } #[test] -#[cfg(all( - target_arch = "aarch64", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")))] fn aarch64_linux() { println!("asimd: {}", is_aarch64_feature_detected!("asimd")); println!("neon: {}", is_aarch64_feature_detected!("neon")); @@ -97,10 +94,7 @@ fn aarch64_linux() { println!("sve2-aes: {}", is_aarch64_feature_detected!("sve2-aes")); println!("sve2-sm4: {}", is_aarch64_feature_detected!("sve2-sm4")); println!("sve2-sha3: {}", is_aarch64_feature_detected!("sve2-sha3")); - println!( - "sve2-bitperm: {}", - is_aarch64_feature_detected!("sve2-bitperm") - ); + println!("sve2-bitperm: {}", is_aarch64_feature_detected!("sve2-bitperm")); println!("frintts: {}", is_aarch64_feature_detected!("frintts")); println!("i8mm: {}", is_aarch64_feature_detected!("i8mm")); println!("f32mm: {}", is_aarch64_feature_detected!("f32mm")); @@ -138,25 +132,13 @@ fn aarch64_linux() { println!("sme-lutv2: {}", is_aarch64_feature_detected!("sme-lutv2")); println!("sme-f8f16: {}", is_aarch64_feature_detected!("sme-f8f16")); println!("sme-f8f32: {}", is_aarch64_feature_detected!("sme-f8f32")); - println!( - "ssve-fp8fma: {}", - is_aarch64_feature_detected!("ssve-fp8fma") - ); - println!( - "ssve-fp8dot4: {}", - is_aarch64_feature_detected!("ssve-fp8dot4") - ); - println!( - "ssve-fp8dot2: {}", - is_aarch64_feature_detected!("ssve-fp8dot2") - ); + println!("ssve-fp8fma: {}", is_aarch64_feature_detected!("ssve-fp8fma")); + println!("ssve-fp8dot4: {}", is_aarch64_feature_detected!("ssve-fp8dot4")); + println!("ssve-fp8dot2: {}", is_aarch64_feature_detected!("ssve-fp8dot2")); } #[test] -#[cfg(all( - any(target_arch = "aarch64", target_arch = "arm64ec"), - target_os = "windows" -))] +#[cfg(all(any(target_arch = "aarch64", target_arch = "arm64ec"), target_os = "windows"))] fn aarch64_windows() { println!("asimd: {:?}", is_aarch64_feature_detected!("asimd")); println!("fp: {:?}", is_aarch64_feature_detected!("fp")); @@ -171,10 +153,7 @@ fn aarch64_windows() { } #[test] -#[cfg(all( - target_arch = "aarch64", - any(target_os = "freebsd", target_os = "openbsd") -))] +#[cfg(all(target_arch = "aarch64", any(target_os = "freebsd", target_os = "openbsd")))] fn aarch64_bsd() { println!("asimd: {:?}", is_aarch64_feature_detected!("asimd")); println!("pmull: {:?}", is_aarch64_feature_detected!("pmull")); @@ -236,14 +215,8 @@ fn riscv_linux() { println!("rv32e: {}", is_riscv_feature_detected!("rv32e")); println!("rv64i: {}", is_riscv_feature_detected!("rv64i")); println!("rv128i: {}", is_riscv_feature_detected!("rv128i")); - println!( - "unaligned-scalar-mem: {}", - is_riscv_feature_detected!("unaligned-scalar-mem") - ); - println!( - "unaligned-vector-mem: {}", - is_riscv_feature_detected!("unaligned-vector-mem") - ); + println!("unaligned-scalar-mem: {}", is_riscv_feature_detected!("unaligned-scalar-mem")); + println!("unaligned-vector-mem: {}", is_riscv_feature_detected!("unaligned-vector-mem")); println!("zicsr: {}", is_riscv_feature_detected!("zicsr")); println!("zicntr: {}", is_riscv_feature_detected!("zicntr")); println!("zihpm: {}", is_riscv_feature_detected!("zihpm")); @@ -336,10 +309,7 @@ fn powerpc_linux() { } #[test] -#[cfg(all( - target_arch = "powerpc64", - any(target_os = "linux", target_os = "freebsd"), -))] +#[cfg(all(target_arch = "powerpc64", any(target_os = "linux", target_os = "freebsd"),))] fn powerpc64_linux_or_freebsd() { println!("altivec: {}", is_powerpc64_feature_detected!("altivec")); println!("vsx: {}", is_powerpc64_feature_detected!("vsx")); diff --git a/library/std_detect/tests/x86-specific.rs b/library/std_detect/tests/x86-specific.rs index d9ec79821baf..2ed2bb2a99ec 100644 --- a/library/std_detect/tests/x86-specific.rs +++ b/library/std_detect/tests/x86-specific.rs @@ -1,11 +1,6 @@ #![cfg(any(target_arch = "x86", target_arch = "x86_64"))] #![allow(internal_features)] -#![feature( - stdarch_internal, - x86_amx_intrinsics, - xop_target_feature, - movrs_target_feature -)] +#![feature(stdarch_internal, x86_amx_intrinsics, xop_target_feature, movrs_target_feature)] #[macro_use] extern crate std_detect; @@ -40,24 +35,15 @@ fn dump() { println!("avx512vl: {:?}", is_x86_feature_detected!("avx512vl")); println!("avx512_ifma: {:?}", is_x86_feature_detected!("avx512ifma")); println!("avx512vbmi {:?}", is_x86_feature_detected!("avx512vbmi")); - println!( - "avx512_vpopcntdq: {:?}", - is_x86_feature_detected!("avx512vpopcntdq") - ); + println!("avx512_vpopcntdq: {:?}", is_x86_feature_detected!("avx512vpopcntdq")); println!("avx512vbmi2: {:?}", is_x86_feature_detected!("avx512vbmi2")); println!("gfni: {:?}", is_x86_feature_detected!("gfni")); println!("vaes: {:?}", is_x86_feature_detected!("vaes")); println!("vpclmulqdq: {:?}", is_x86_feature_detected!("vpclmulqdq")); println!("avx512vnni: {:?}", is_x86_feature_detected!("avx512vnni")); - println!( - "avx512bitalg: {:?}", - is_x86_feature_detected!("avx512bitalg") - ); + println!("avx512bitalg: {:?}", is_x86_feature_detected!("avx512bitalg")); println!("avx512bf16: {:?}", is_x86_feature_detected!("avx512bf16")); - println!( - "avx512vp2intersect: {:?}", - is_x86_feature_detected!("avx512vp2intersect") - ); + println!("avx512vp2intersect: {:?}", is_x86_feature_detected!("avx512vp2intersect")); println!("avx512fp16: {:?}", is_x86_feature_detected!("avx512fp16")); println!("fma: {:?}", is_x86_feature_detected!("fma")); println!("abm: {:?}", is_x86_feature_detected!("abm")); @@ -77,15 +63,9 @@ fn dump() { println!("movbe: {:?}", is_x86_feature_detected!("movbe")); println!("avxvnni: {:?}", is_x86_feature_detected!("avxvnni")); println!("avxvnniint8: {:?}", is_x86_feature_detected!("avxvnniint8")); - println!( - "avxneconvert: {:?}", - is_x86_feature_detected!("avxneconvert") - ); + println!("avxneconvert: {:?}", is_x86_feature_detected!("avxneconvert")); println!("avxifma: {:?}", is_x86_feature_detected!("avxifma")); - println!( - "avxvnniint16: {:?}", - is_x86_feature_detected!("avxvnniint16") - ); + println!("avxvnniint16: {:?}", is_x86_feature_detected!("avxvnniint16")); println!("amx-bf16: {:?}", is_x86_feature_detected!("amx-bf16")); println!("amx-tile: {:?}", is_x86_feature_detected!("amx-tile")); println!("amx-int8: {:?}", is_x86_feature_detected!("amx-int8")); @@ -96,10 +76,7 @@ fn dump() { println!("widekl: {:?}", is_x86_feature_detected!("widekl")); println!("movrs: {:?}", is_x86_feature_detected!("movrs")); println!("amx-fp8: {:?}", is_x86_feature_detected!("amx-fp8")); - println!( - "amx-transpose: {:?}", - is_x86_feature_detected!("amx-transpose") - ); + println!("amx-transpose: {:?}", is_x86_feature_detected!("amx-transpose")); println!("amx-tf32: {:?}", is_x86_feature_detected!("amx-tf32")); println!("amx-avx512: {:?}", is_x86_feature_detected!("amx-avx512")); println!("amx-movrs: {:?}", is_x86_feature_detected!("amx-movrs")); @@ -110,8 +87,5 @@ fn dump() { fn x86_deprecated() { println!("avx512gfni {:?}", is_x86_feature_detected!("avx512gfni")); println!("avx512vaes {:?}", is_x86_feature_detected!("avx512vaes")); - println!( - "avx512vpclmulqdq {:?}", - is_x86_feature_detected!("avx512vpclmulqdq") - ); + println!("avx512vpclmulqdq {:?}", is_x86_feature_detected!("avx512vpclmulqdq")); } From 8dc2abb5c3a8de5982dd979ddaf722b4b6cc40fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 4 Jul 2025 10:15:38 +0200 Subject: [PATCH 172/183] Update stdarch README --- library/stdarch/README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/library/stdarch/README.md b/library/stdarch/README.md index 9a35f4cd6ff5..50905b49e80d 100644 --- a/library/stdarch/README.md +++ b/library/stdarch/README.md @@ -4,16 +4,8 @@ stdarch - Rust's standard library SIMD components [![Actions Status](https://github.com/rust-lang/stdarch/workflows/CI/badge.svg)](https://github.com/rust-lang/stdarch/actions) -# Crates - -This repository contains two main crates: - -* [`core_arch`](crates/core_arch/README.md) implements `core::arch` - Rust's - core library architecture-specific intrinsics, and +This repository contains the [`core_arch`](crates/core_arch/README.md) crate, which implements `core::arch` - Rust's core library architecture-specific intrinsics. -* [`std_detect`](crates/std_detect/README.md) implements `std::detect` - Rust's - standard library run-time CPU feature detection. - The `std::simd` component now lives in the [`packed_simd_2`](https://github.com/rust-lang/packed_simd) crate. From e07a1bbb79fc3fb400ac4a2f25bb37cd8a0c245b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 4 Jul 2025 10:23:36 +0200 Subject: [PATCH 173/183] Move tests around to appease `tidy` --- library/std_detect/src/detect/macros.rs | 2 +- .../std_detect/src/detect/os/linux/aarch64.rs | 82 +------------ .../src/detect/os/linux/aarch64/tests.rs | 77 ++++++++++++ .../std_detect/src/detect/os/linux/auxvec.rs | 114 +----------------- .../src/detect/os/linux/auxvec/tests.rs | 111 +++++++++++++++++ library/std_detect/src/detect/os/riscv.rs | 67 +--------- .../std_detect/src/detect/os/riscv/tests.rs | 64 ++++++++++ src/tools/tidy/src/unit_tests.rs | 3 +- 8 files changed, 258 insertions(+), 262 deletions(-) create mode 100644 library/std_detect/src/detect/os/linux/aarch64/tests.rs create mode 100644 library/std_detect/src/detect/os/linux/auxvec/tests.rs create mode 100644 library/std_detect/src/detect/os/riscv/tests.rs diff --git a/library/std_detect/src/detect/macros.rs b/library/std_detect/src/detect/macros.rs index a2994fb7daa7..c2a006d3753a 100644 --- a/library/std_detect/src/detect/macros.rs +++ b/library/std_detect/src/detect/macros.rs @@ -131,7 +131,7 @@ macro_rules! features { }; } - #[test] + #[test] //tidy:skip #[deny(unexpected_cfgs)] #[deny(unfulfilled_lint_expectations)] fn unexpected_cfgs() { diff --git a/library/std_detect/src/detect/os/linux/aarch64.rs b/library/std_detect/src/detect/os/linux/aarch64.rs index 0de4beeae8b3..87a9d6ebb887 100644 --- a/library/std_detect/src/detect/os/linux/aarch64.rs +++ b/library/std_detect/src/detect/os/linux/aarch64.rs @@ -395,84 +395,4 @@ impl AtHwcap { #[cfg(target_endian = "little")] #[cfg(test)] -mod tests { - use super::*; - - #[cfg(feature = "std_detect_file_io")] - mod auxv_from_file { - use super::auxvec::auxv_from_file; - use super::*; - // The baseline hwcaps used in the (artificial) auxv test files. - fn baseline_hwcaps() -> AtHwcap { - AtHwcap { - fp: true, - asimd: true, - aes: true, - pmull: true, - sha1: true, - sha2: true, - crc32: true, - atomics: true, - fphp: true, - asimdhp: true, - asimdrdm: true, - lrcpc: true, - dcpop: true, - asimddp: true, - ssbs: true, - ..AtHwcap::default() - } - } - - #[test] - fn linux_empty_hwcap2_aarch64() { - let file = concat!( - env!("CARGO_MANIFEST_DIR"), - "/src/detect/test_data/linux-empty-hwcap2-aarch64.auxv" - ); - println!("file: {file}"); - let v = auxv_from_file(file).unwrap(); - println!("HWCAP : 0x{:0x}", v.hwcap); - println!("HWCAP2: 0x{:0x}", v.hwcap2); - assert_eq!(AtHwcap::from(v), baseline_hwcaps()); - } - #[test] - fn linux_no_hwcap2_aarch64() { - let file = concat!( - env!("CARGO_MANIFEST_DIR"), - "/src/detect/test_data/linux-no-hwcap2-aarch64.auxv" - ); - println!("file: {file}"); - let v = auxv_from_file(file).unwrap(); - println!("HWCAP : 0x{:0x}", v.hwcap); - println!("HWCAP2: 0x{:0x}", v.hwcap2); - assert_eq!(AtHwcap::from(v), baseline_hwcaps()); - } - #[test] - fn linux_hwcap2_aarch64() { - let file = concat!( - env!("CARGO_MANIFEST_DIR"), - "/src/detect/test_data/linux-hwcap2-aarch64.auxv" - ); - println!("file: {file}"); - let v = auxv_from_file(file).unwrap(); - println!("HWCAP : 0x{:0x}", v.hwcap); - println!("HWCAP2: 0x{:0x}", v.hwcap2); - assert_eq!( - AtHwcap::from(v), - AtHwcap { - // Some other HWCAP bits. - paca: true, - pacg: true, - // HWCAP2-only bits. - dcpodp: true, - frint: true, - rng: true, - bti: true, - mte: true, - ..baseline_hwcaps() - } - ); - } - } -} +mod tests; diff --git a/library/std_detect/src/detect/os/linux/aarch64/tests.rs b/library/std_detect/src/detect/os/linux/aarch64/tests.rs new file mode 100644 index 000000000000..a3562f2fd936 --- /dev/null +++ b/library/std_detect/src/detect/os/linux/aarch64/tests.rs @@ -0,0 +1,77 @@ +use super::*; + +#[cfg(feature = "std_detect_file_io")] +mod auxv_from_file { + use super::auxvec::auxv_from_file; + use super::*; + // The baseline hwcaps used in the (artificial) auxv test files. + fn baseline_hwcaps() -> AtHwcap { + AtHwcap { + fp: true, + asimd: true, + aes: true, + pmull: true, + sha1: true, + sha2: true, + crc32: true, + atomics: true, + fphp: true, + asimdhp: true, + asimdrdm: true, + lrcpc: true, + dcpop: true, + asimddp: true, + ssbs: true, + ..AtHwcap::default() + } + } + + #[test] + fn linux_empty_hwcap2_aarch64() { + let file = concat!( + env!("CARGO_MANIFEST_DIR"), + "/src/detect/test_data/linux-empty-hwcap2-aarch64.auxv" + ); + println!("file: {file}"); + let v = auxv_from_file(file).unwrap(); + println!("HWCAP : 0x{:0x}", v.hwcap); + println!("HWCAP2: 0x{:0x}", v.hwcap2); + assert_eq!(AtHwcap::from(v), baseline_hwcaps()); + } + #[test] + fn linux_no_hwcap2_aarch64() { + let file = concat!( + env!("CARGO_MANIFEST_DIR"), + "/src/detect/test_data/linux-no-hwcap2-aarch64.auxv" + ); + println!("file: {file}"); + let v = auxv_from_file(file).unwrap(); + println!("HWCAP : 0x{:0x}", v.hwcap); + println!("HWCAP2: 0x{:0x}", v.hwcap2); + assert_eq!(AtHwcap::from(v), baseline_hwcaps()); + } + #[test] + fn linux_hwcap2_aarch64() { + let file = + concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-hwcap2-aarch64.auxv"); + println!("file: {file}"); + let v = auxv_from_file(file).unwrap(); + println!("HWCAP : 0x{:0x}", v.hwcap); + println!("HWCAP2: 0x{:0x}", v.hwcap2); + assert_eq!( + AtHwcap::from(v), + AtHwcap { + // Some other HWCAP bits. + paca: true, + pacg: true, + // HWCAP2-only bits. + dcpodp: true, + frint: true, + rng: true, + bti: true, + mte: true, + ..baseline_hwcaps() + } + ); + } +} diff --git a/library/std_detect/src/detect/os/linux/auxvec.rs b/library/std_detect/src/detect/os/linux/auxvec.rs index 54f52aa75330..1ed395f45b9e 100644 --- a/library/std_detect/src/detect/os/linux/auxvec.rs +++ b/library/std_detect/src/detect/os/linux/auxvec.rs @@ -226,116 +226,4 @@ fn auxv_from_buf(buf: &[usize]) -> Result { } #[cfg(test)] -mod tests { - use super::*; - - // FIXME: on mips/mips64 getauxval returns 0, and /proc/self/auxv - // does not always contain the AT_HWCAP key under qemu. - #[cfg(any( - target_arch = "arm", - target_arch = "powerpc", - target_arch = "powerpc64", - target_arch = "s390x", - ))] - #[test] - fn auxv_crate() { - let v = auxv(); - if let Ok(hwcap) = getauxval(AT_HWCAP) { - let rt_hwcap = v.expect("failed to find hwcap key").hwcap; - assert_eq!(rt_hwcap, hwcap); - } - - // Targets with AT_HWCAP and AT_HWCAP2: - #[cfg(any( - target_arch = "aarch64", - target_arch = "arm", - target_arch = "powerpc", - target_arch = "powerpc64", - target_arch = "s390x", - ))] - { - if let Ok(hwcap2) = getauxval(AT_HWCAP2) { - let rt_hwcap2 = v.expect("failed to find hwcap2 key").hwcap2; - assert_eq!(rt_hwcap2, hwcap2); - } - } - } - - #[test] - fn auxv_dump() { - if let Ok(auxvec) = auxv() { - println!("{:?}", auxvec); - } else { - println!("both getauxval() and reading /proc/self/auxv failed!"); - } - } - - #[cfg(feature = "std_detect_file_io")] - cfg_if::cfg_if! { - if #[cfg(target_arch = "arm")] { - #[test] - fn linux_rpi3() { - let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-rpi3.auxv"); - println!("file: {file}"); - let v = auxv_from_file(file).unwrap(); - assert_eq!(v.hwcap, 4174038); - assert_eq!(v.hwcap2, 16); - } - - #[test] - fn linux_macos_vb() { - let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv"); - println!("file: {file}"); - // The file contains HWCAP but not HWCAP2. In that case, we treat HWCAP2 as zero. - let v = auxv_from_file(file).unwrap(); - assert_eq!(v.hwcap, 126614527); - assert_eq!(v.hwcap2, 0); - } - } else if #[cfg(target_arch = "aarch64")] { - #[cfg(target_endian = "little")] - #[test] - fn linux_artificial_aarch64() { - let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-artificial-aarch64.auxv"); - println!("file: {file}"); - let v = auxv_from_file(file).unwrap(); - assert_eq!(v.hwcap, 0x0123456789abcdef); - assert_eq!(v.hwcap2, 0x02468ace13579bdf); - } - #[cfg(target_endian = "little")] - #[test] - fn linux_no_hwcap2_aarch64() { - let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-no-hwcap2-aarch64.auxv"); - println!("file: {file}"); - let v = auxv_from_file(file).unwrap(); - // An absent HWCAP2 is treated as zero, and does not prevent acceptance of HWCAP. - assert_ne!(v.hwcap, 0); - assert_eq!(v.hwcap2, 0); - } - } - } - - #[test] - #[cfg(feature = "std_detect_file_io")] - fn auxv_dump_procfs() { - if let Ok(auxvec) = auxv_from_file("/proc/self/auxv") { - println!("{:?}", auxvec); - } else { - println!("reading /proc/self/auxv failed!"); - } - } - - #[cfg(any( - target_arch = "aarch64", - target_arch = "arm", - target_arch = "powerpc", - target_arch = "powerpc64", - target_arch = "s390x", - ))] - #[test] - #[cfg(feature = "std_detect_file_io")] - fn auxv_crate_procfs() { - if let Ok(procfs_auxv) = auxv_from_file("/proc/self/auxv") { - assert_eq!(auxv().unwrap(), procfs_auxv); - } - } -} +mod tests; diff --git a/library/std_detect/src/detect/os/linux/auxvec/tests.rs b/library/std_detect/src/detect/os/linux/auxvec/tests.rs new file mode 100644 index 000000000000..c0e0ae12a05f --- /dev/null +++ b/library/std_detect/src/detect/os/linux/auxvec/tests.rs @@ -0,0 +1,111 @@ +use super::*; + +// FIXME: on mips/mips64 getauxval returns 0, and /proc/self/auxv +// does not always contain the AT_HWCAP key under qemu. +#[cfg(any( + target_arch = "arm", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "s390x", +))] +#[test] +fn auxv_crate() { + let v = auxv(); + if let Ok(hwcap) = getauxval(AT_HWCAP) { + let rt_hwcap = v.expect("failed to find hwcap key").hwcap; + assert_eq!(rt_hwcap, hwcap); + } + + // Targets with AT_HWCAP and AT_HWCAP2: + #[cfg(any( + target_arch = "aarch64", + target_arch = "arm", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "s390x", + ))] + { + if let Ok(hwcap2) = getauxval(AT_HWCAP2) { + let rt_hwcap2 = v.expect("failed to find hwcap2 key").hwcap2; + assert_eq!(rt_hwcap2, hwcap2); + } + } +} + +#[test] +fn auxv_dump() { + if let Ok(auxvec) = auxv() { + println!("{:?}", auxvec); + } else { + println!("both getauxval() and reading /proc/self/auxv failed!"); + } +} + +#[cfg(feature = "std_detect_file_io")] +cfg_if::cfg_if! { + if #[cfg(target_arch = "arm")] { + #[test] + fn linux_rpi3() { + let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-rpi3.auxv"); + println!("file: {file}"); + let v = auxv_from_file(file).unwrap(); + assert_eq!(v.hwcap, 4174038); + assert_eq!(v.hwcap2, 16); + } + + #[test] + fn linux_macos_vb() { + let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv"); + println!("file: {file}"); + // The file contains HWCAP but not HWCAP2. In that case, we treat HWCAP2 as zero. + let v = auxv_from_file(file).unwrap(); + assert_eq!(v.hwcap, 126614527); + assert_eq!(v.hwcap2, 0); + } + } else if #[cfg(target_arch = "aarch64")] { + #[cfg(target_endian = "little")] + #[test] + fn linux_artificial_aarch64() { + let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-artificial-aarch64.auxv"); + println!("file: {file}"); + let v = auxv_from_file(file).unwrap(); + assert_eq!(v.hwcap, 0x0123456789abcdef); + assert_eq!(v.hwcap2, 0x02468ace13579bdf); + } + #[cfg(target_endian = "little")] + #[test] + fn linux_no_hwcap2_aarch64() { + let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-no-hwcap2-aarch64.auxv"); + println!("file: {file}"); + let v = auxv_from_file(file).unwrap(); + // An absent HWCAP2 is treated as zero, and does not prevent acceptance of HWCAP. + assert_ne!(v.hwcap, 0); + assert_eq!(v.hwcap2, 0); + } + } +} + +#[test] +#[cfg(feature = "std_detect_file_io")] +fn auxv_dump_procfs() { + if let Ok(auxvec) = auxv_from_file("/proc/self/auxv") { + println!("{:?}", auxvec); + } else { + println!("reading /proc/self/auxv failed!"); + } +} + +#[cfg(any( + target_arch = "aarch64", + target_arch = "arm", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "s390x", +))] +#[test] +#[cfg(feature = "std_detect_file_io")] +fn auxv_crate_procfs() { + if let Ok(procfs_auxv) = auxv_from_file("/proc/self/auxv") { + assert_eq!(auxv().unwrap(), procfs_auxv); + } +} diff --git a/library/std_detect/src/detect/os/riscv.rs b/library/std_detect/src/detect/os/riscv.rs index 4c59ede80293..46b7dd71eb35 100644 --- a/library/std_detect/src/detect/os/riscv.rs +++ b/library/std_detect/src/detect/os/riscv.rs @@ -135,69 +135,4 @@ pub(crate) fn imply_features(mut value: cache::Initializer) -> cache::Initialize } #[cfg(test)] -mod tests { - use super::*; - - #[test] - fn simple_direct() { - let mut value = cache::Initializer::default(); - value.set(Feature::f as u32); - // F (and other extensions with CSRs) -> Zicsr - assert!(imply_features(value).test(Feature::zicsr as u32)); - } - - #[test] - fn simple_indirect() { - let mut value = cache::Initializer::default(); - value.set(Feature::q as u32); - // Q -> D, D -> F, F -> Zicsr - assert!(imply_features(value).test(Feature::zicsr as u32)); - } - - #[test] - fn complex_zcd() { - let mut value = cache::Initializer::default(); - // C & D -> Zcd - value.set(Feature::c as u32); - assert!(!imply_features(value).test(Feature::zcd as u32)); - value.set(Feature::d as u32); - assert!(imply_features(value).test(Feature::zcd as u32)); - } - - #[test] - fn group_simple_forward() { - let mut value = cache::Initializer::default(); - // A -> Zalrsc & Zaamo (forward implication) - value.set(Feature::a as u32); - let value = imply_features(value); - assert!(value.test(Feature::zalrsc as u32)); - assert!(value.test(Feature::zaamo as u32)); - } - - #[test] - fn group_simple_backward() { - let mut value = cache::Initializer::default(); - // Zalrsc & Zaamo -> A (reverse implication) - value.set(Feature::zalrsc as u32); - value.set(Feature::zaamo as u32); - assert!(imply_features(value).test(Feature::a as u32)); - } - - #[test] - fn group_complex_convergence() { - let mut value = cache::Initializer::default(); - // Needs 3 iterations to converge - // (and 4th iteration for convergence checking): - // 1. [Zvksc] -> Zvks & Zvbc - // 2. Zvks -> Zvksed & Zvksh & Zvkb & Zvkt - // 3a. [Zvkned] & [Zvknhb] & [Zvkb] & Zvkt -> {Zvkn} - // 3b. Zvkn & Zvbc -> {Zvknc} - value.set(Feature::zvksc as u32); - value.set(Feature::zvkned as u32); - value.set(Feature::zvknhb as u32); - value.set(Feature::zvkb as u32); - let value = imply_features(value); - assert!(value.test(Feature::zvkn as u32)); - assert!(value.test(Feature::zvknc as u32)); - } -} +mod tests; diff --git a/library/std_detect/src/detect/os/riscv/tests.rs b/library/std_detect/src/detect/os/riscv/tests.rs new file mode 100644 index 000000000000..99a81dee05a6 --- /dev/null +++ b/library/std_detect/src/detect/os/riscv/tests.rs @@ -0,0 +1,64 @@ +use super::*; + +#[test] +fn simple_direct() { + let mut value = cache::Initializer::default(); + value.set(Feature::f as u32); + // F (and other extensions with CSRs) -> Zicsr + assert!(imply_features(value).test(Feature::zicsr as u32)); +} + +#[test] +fn simple_indirect() { + let mut value = cache::Initializer::default(); + value.set(Feature::q as u32); + // Q -> D, D -> F, F -> Zicsr + assert!(imply_features(value).test(Feature::zicsr as u32)); +} + +#[test] +fn complex_zcd() { + let mut value = cache::Initializer::default(); + // C & D -> Zcd + value.set(Feature::c as u32); + assert!(!imply_features(value).test(Feature::zcd as u32)); + value.set(Feature::d as u32); + assert!(imply_features(value).test(Feature::zcd as u32)); +} + +#[test] +fn group_simple_forward() { + let mut value = cache::Initializer::default(); + // A -> Zalrsc & Zaamo (forward implication) + value.set(Feature::a as u32); + let value = imply_features(value); + assert!(value.test(Feature::zalrsc as u32)); + assert!(value.test(Feature::zaamo as u32)); +} + +#[test] +fn group_simple_backward() { + let mut value = cache::Initializer::default(); + // Zalrsc & Zaamo -> A (reverse implication) + value.set(Feature::zalrsc as u32); + value.set(Feature::zaamo as u32); + assert!(imply_features(value).test(Feature::a as u32)); +} + +#[test] +fn group_complex_convergence() { + let mut value = cache::Initializer::default(); + // Needs 3 iterations to converge + // (and 4th iteration for convergence checking): + // 1. [Zvksc] -> Zvks & Zvbc + // 2. Zvks -> Zvksed & Zvksh & Zvkb & Zvkt + // 3a. [Zvkned] & [Zvknhb] & [Zvkb] & Zvkt -> {Zvkn} + // 3b. Zvkn & Zvbc -> {Zvknc} + value.set(Feature::zvksc as u32); + value.set(Feature::zvkned as u32); + value.set(Feature::zvknhb as u32); + value.set(Feature::zvkb as u32); + let value = imply_features(value); + assert!(value.test(Feature::zvkn as u32)); + assert!(value.test(Feature::zvknc as u32)); +} diff --git a/src/tools/tidy/src/unit_tests.rs b/src/tools/tidy/src/unit_tests.rs index 90ef36d5882d..df9146b51474 100644 --- a/src/tools/tidy/src/unit_tests.rs +++ b/src/tools/tidy/src/unit_tests.rs @@ -56,7 +56,8 @@ pub fn check(root_path: &Path, bad: &mut bool) { let line = line.trim(); let is_test = || line.contains("#[test]") && !line.contains("`#[test]"); let is_bench = || line.contains("#[bench]") && !line.contains("`#[bench]"); - if !line.starts_with("//") && (is_test() || is_bench()) { + let manual_skip = line.contains("//tidy:skip"); + if !line.starts_with("//") && (is_test() || is_bench()) && !manual_skip { let explanation = if is_core { "`core` unit tests and benchmarks must be placed into `coretests`" } else if is_alloc { From ffa97a647e3786add894093aa2cc7561c7c64607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 4 Jul 2025 15:25:28 +0200 Subject: [PATCH 174/183] Fix warning --- library/std_detect/tests/cpu-detection.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/std_detect/tests/cpu-detection.rs b/library/std_detect/tests/cpu-detection.rs index 09a73572c1fd..5ad32d83237c 100644 --- a/library/std_detect/tests/cpu-detection.rs +++ b/library/std_detect/tests/cpu-detection.rs @@ -27,6 +27,16 @@ ), macro_use )] +#[cfg(any( + target_arch = "arm", + target_arch = "aarch64", + target_arch = "arm64ec", + target_arch = "riscv32", + target_arch = "riscv64", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "s390x", +))] extern crate std_detect; #[test] From 608297247a776a32c4aca08f1784caca8a3c33e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sun, 13 Jul 2025 13:08:17 +0200 Subject: [PATCH 175/183] Remove `std_detect` from stdarch examples --- library/stdarch/Cargo.lock | 23 ----------------------- library/stdarch/examples/Cargo.toml | 1 - library/stdarch/examples/connect5.rs | 16 ++++++++++++---- library/stdarch/examples/hex.rs | 8 ++++++-- 4 files changed, 18 insertions(+), 30 deletions(-) diff --git a/library/stdarch/Cargo.lock b/library/stdarch/Cargo.lock index 4806682e6e0a..21ce304db0d8 100644 --- a/library/stdarch/Cargo.lock +++ b/library/stdarch/Cargo.lock @@ -580,18 +580,6 @@ version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" -[[package]] -name = "rustc-std-workspace-alloc" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d441c3b2ebf55cebf796bfdc265d67fa09db17b7bb6bd4be75c509e1e8fec3" - -[[package]] -name = "rustc-std-workspace-core" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9c45b374136f52f2d6311062c7146bff20fec063c3f5d46a410bd937746955" - [[package]] name = "ryu" version = "1.0.20" @@ -694,16 +682,6 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "std_detect" -version = "0.1.5" -dependencies = [ - "cfg-if", - "libc", - "rustc-std-workspace-alloc", - "rustc-std-workspace-core", -] - [[package]] name = "stdarch-gen-arm" version = "0.1.0" @@ -756,7 +734,6 @@ dependencies = [ "core_arch", "quickcheck", "rand", - "std_detect", ] [[package]] diff --git a/library/stdarch/examples/Cargo.toml b/library/stdarch/examples/Cargo.toml index 61184494e157..61451edee841 100644 --- a/library/stdarch/examples/Cargo.toml +++ b/library/stdarch/examples/Cargo.toml @@ -12,7 +12,6 @@ default-run = "hex" [dependencies] core_arch = { path = "../crates/core_arch" } -std_detect = { path = "../crates/std_detect" } quickcheck = "1.0" rand = "0.8" diff --git a/library/stdarch/examples/connect5.rs b/library/stdarch/examples/connect5.rs index 1d8e0f0990a6..371b28552b32 100644 --- a/library/stdarch/examples/connect5.rs +++ b/library/stdarch/examples/connect5.rs @@ -40,9 +40,13 @@ use std::cmp; use std::time::Instant; #[cfg(target_arch = "x86")] -use {core_arch::arch::x86::*, std_detect::is_x86_feature_detected}; +use core_arch::arch::x86::*; #[cfg(target_arch = "x86_64")] -use {core_arch::arch::x86_64::*, std_detect::is_x86_feature_detected}; +use core_arch::arch::x86_64::*; +#[cfg(target_arch = "x86")] +use std::is_x86_feature_detected; +#[cfg(target_arch = "x86_64")] +use std::is_x86_feature_detected; // types @@ -558,8 +562,12 @@ fn search(pos: &Pos, alpha: i32, beta: i32, depth: i32, _ply: i32) -> i32 { assert_ne!(bm, MOVE_NONE); assert!(bs >= -EVAL_INF && bs <= EVAL_INF); - // best move at the root node, best score elsewhere - if _ply == 0 { bm } else { bs } + //best move at the root node, best score elsewhere + if _ply == 0 { + bm + } else { + bs + } } /// Evaluation function: give different scores to different patterns after a fixed depth. diff --git a/library/stdarch/examples/hex.rs b/library/stdarch/examples/hex.rs index e393ad727168..95ffbaf666ce 100644 --- a/library/stdarch/examples/hex.rs +++ b/library/stdarch/examples/hex.rs @@ -36,9 +36,13 @@ use std::{ }; #[cfg(target_arch = "x86")] -use {core_arch::arch::x86::*, std_detect::is_x86_feature_detected}; +use core_arch::arch::x86::*; #[cfg(target_arch = "x86_64")] -use {core_arch::arch::x86_64::*, std_detect::is_x86_feature_detected}; +use core_arch::arch::x86_64::*; +#[cfg(target_arch = "x86")] +use std::is_x86_feature_detected; +#[cfg(target_arch = "x86_64")] +use std::is_x86_feature_detected; fn main() { let mut input = Vec::new(); From 847f8db5ad2d3b369ce97935dd770a15280ddf96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sun, 13 Jul 2025 13:41:22 +0200 Subject: [PATCH 176/183] Remove `std_detect` from stdarch's CI --- library/stdarch/.github/workflows/main.yml | 13 +----- library/stdarch/ci/build-std-detect.sh | 46 ---------------------- library/stdarch/ci/dox.sh | 3 -- library/stdarch/ci/run-docker.sh | 1 - library/stdarch/ci/run.sh | 10 +---- 5 files changed, 2 insertions(+), 71 deletions(-) delete mode 100755 library/stdarch/ci/build-std-detect.sh diff --git a/library/stdarch/.github/workflows/main.yml b/library/stdarch/.github/workflows/main.yml index 59aad0b5d014..048ce9864604 100644 --- a/library/stdarch/.github/workflows/main.yml +++ b/library/stdarch/.github/workflows/main.yml @@ -258,7 +258,7 @@ jobs: # Check that the generated files agree with the checked-in versions. check-stdarch-gen: needs: [style] - name: Check stdarch-gen-{arm, loongarch} output + name: Check stdarch-gen-{arm, loongarch} output runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -277,22 +277,11 @@ jobs: cargo run --bin=stdarch-gen-loongarch --release -- crates/stdarch-gen-loongarch/lasx.spec git diff --exit-code - build-std-detect: - needs: [style] - name: Build std_detect - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update nightly && rustup default nightly - - run: ./ci/build-std-detect.sh - conclusion: needs: - docs - verify - test - - build-std-detect - check-stdarch-gen runs-on: ubuntu-latest # We need to ensure this job does *not* get skipped if its dependencies fail, diff --git a/library/stdarch/ci/build-std-detect.sh b/library/stdarch/ci/build-std-detect.sh deleted file mode 100755 index e79a497cc359..000000000000 --- a/library/stdarch/ci/build-std-detect.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash - -# Build std_detect on non-Linux & non-x86 targets. -# -# In std_detect, non-x86 targets have OS-specific implementations, -# but we can test only Linux in CI. This script builds targets supported -# by std_detect but cannot be tested in CI. - -set -ex -cd "$(dirname "$0")"/.. - -targets=( - # Linux - aarch64-unknown-linux-musl - armv5te-unknown-linux-musleabi - aarch64-unknown-linux-ohos - armv7-unknown-linux-ohos - - # Android - aarch64-linux-android - arm-linux-androideabi - - # FreeBSD - aarch64-unknown-freebsd - armv6-unknown-freebsd - powerpc-unknown-freebsd - powerpc64-unknown-freebsd - - # OpenBSD - aarch64-unknown-openbsd - - # Windows - aarch64-pc-windows-msvc -) - -rustup component add rust-src # for -Z build-std - -cd crates/std_detect -for target in "${targets[@]}"; do - if rustup target add "${target}" &>/dev/null; then - cargo build --target "${target}" - else - # tier 3 targets requires -Z build-std. - cargo build -Z build-std="core,alloc" --target "${target}" - fi -done diff --git a/library/stdarch/ci/dox.sh b/library/stdarch/ci/dox.sh index 910265fad84d..94d76d430472 100755 --- a/library/stdarch/ci/dox.sh +++ b/library/stdarch/ci/dox.sh @@ -16,10 +16,7 @@ dox() { cargo clean --target "${1}" cargo build --verbose --target "${1}" --manifest-path crates/core_arch/Cargo.toml - cargo build --verbose --target "${1}" --manifest-path crates/std_detect/Cargo.toml - cargo doc --verbose --target "${1}" --manifest-path crates/core_arch/Cargo.toml - cargo doc --verbose --target "${1}" --manifest-path crates/std_detect/Cargo.toml } if [ -z "$1" ]; then diff --git a/library/stdarch/ci/run-docker.sh b/library/stdarch/ci/run-docker.sh index 657353004dcb..d7aa50a8c96f 100755 --- a/library/stdarch/ci/run-docker.sh +++ b/library/stdarch/ci/run-docker.sh @@ -37,7 +37,6 @@ run() { --env NORUN \ --env RUSTFLAGS \ --env CARGO_UNSTABLE_BUILD_STD \ - --env RUST_STD_DETECT_UNSTABLE \ --volume "${HOME}/.cargo":/cargo \ --volume "$(rustc --print sysroot)":/rust:ro \ --volume "$(pwd)":/checkout:ro \ diff --git a/library/stdarch/ci/run.sh b/library/stdarch/ci/run.sh index 78a808b46a04..aa4479395d5b 100755 --- a/library/stdarch/ci/run.sh +++ b/library/stdarch/ci/run.sh @@ -78,20 +78,12 @@ cargo_test() { } CORE_ARCH="--manifest-path=crates/core_arch/Cargo.toml" -STD_DETECT="--manifest-path=crates/std_detect/Cargo.toml" STDARCH_EXAMPLES="--manifest-path=examples/Cargo.toml" INTRINSIC_TEST="--manifest-path=crates/intrinsic-test/Cargo.toml" cargo_test "${CORE_ARCH} ${PROFILE}" if [ "$NOSTD" != "1" ]; then - cargo_test "${STD_DETECT} ${PROFILE}" - - cargo_test "${STD_DETECT} --no-default-features" - cargo_test "${STD_DETECT} --no-default-features --features=std_detect_file_io" - cargo_test "${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval" - cargo_test "${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval,std_detect_file_io" - cargo_test "${STDARCH_EXAMPLES} ${PROFILE}" fi @@ -139,7 +131,7 @@ case ${TARGET} in cargo_test "${PROFILE}" ;; - # Setup aarch64 & armv7 specific variables, the runner, along with some + # Setup aarch64 & armv7 specific variables, the runner, along with some # tests to skip aarch64-unknown-linux-gnu*) TEST_CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/" From cbd9fe012acad68ce8ea2cb90b23589cd2bb0c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sun, 13 Jul 2025 14:37:28 +0200 Subject: [PATCH 177/183] Bless bootstrap tests --- src/bootstrap/src/core/builder/tests.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 105d4229e75e..6ea5d4e65532 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -999,7 +999,7 @@ mod snapshot { [build] llvm [build] rustc 0 -> rustc 1 [build] rustdoc 0 - [doc] std 1 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] + [doc] std 1 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] "); } @@ -1048,7 +1048,7 @@ mod snapshot { [build] rustc 1 -> std 1 [build] rustc 1 -> rustc 2 [build] rustdoc 1 - [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] + [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] [build] rustc 2 -> std 2 [build] rustc 0 -> LintDocs 1 [build] rustc 0 -> RustInstaller 1 @@ -1090,7 +1090,7 @@ mod snapshot { [build] rustc 1 -> WasmComponentLd 2 [build] rustc 1 -> LlvmBitcodeLinker 2 [build] rustdoc 1 - [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] + [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] [build] rustc 2 -> std 2 [build] rustc 0 -> LintDocs 1 [build] rustc 0 -> RustInstaller 1 @@ -1126,8 +1126,8 @@ mod snapshot { [build] rustc 1 -> std 1 [build] rustc 1 -> rustc 2 [build] rustdoc 1 - [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] - [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] + [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] + [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] [build] rustc 2 -> std 2 [build] rustc 0 -> LintDocs 1 [build] rustc 0 -> RustInstaller 1 @@ -1163,7 +1163,7 @@ mod snapshot { [build] rustc 1 -> std 1 [build] rustc 1 -> rustc 2 [build] rustdoc 1 - [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] + [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] [build] rustc 2 -> std 2 [build] rustc 0 -> LintDocs 1 [build] rustc 1 -> std 1 @@ -1200,8 +1200,8 @@ mod snapshot { [build] rustc 1 -> std 1 [build] rustc 1 -> rustc 2 [build] rustdoc 1 - [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] - [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] + [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] + [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] [build] rustc 2 -> std 2 [build] rustc 0 -> LintDocs 1 [build] rustc 1 -> std 1 @@ -1242,7 +1242,7 @@ mod snapshot { [build] rustc 1 -> std 1 [build] rustc 1 -> rustc 2 [build] rustdoc 1 - [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] + [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] [build] rustc 2 -> std 2 [build] rustc 0 -> RustInstaller 1 [dist] docs @@ -1274,7 +1274,7 @@ mod snapshot { [build] rustc 1 -> rustc 2 [build] rustc 1 -> WasmComponentLd 2 [build] rustdoc 1 - [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] + [doc] std 2 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] [build] rustc 2 -> std 2 [build] rustc 1 -> std 1 [build] rustc 2 -> std 2 @@ -1620,7 +1620,7 @@ mod snapshot { [build] llvm [build] rustc 0 -> rustc 1 [build] rustdoc 0 - [doc] std 1 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,sysroot,test,unwind] + [doc] std 1 crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,std,std_detect,sysroot,test,unwind] "); } From 5e52677a82c6c146469561c97ca4c63a75242102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Mon, 14 Jul 2025 21:57:08 +0200 Subject: [PATCH 178/183] Remove licenses from std-detect They are subsumed by the main repo licenses. --- library/std_detect/LICENSE-APACHE | 201 ------------------------------ library/std_detect/LICENSE-MIT | 25 ---- 2 files changed, 226 deletions(-) delete mode 100644 library/std_detect/LICENSE-APACHE delete mode 100644 library/std_detect/LICENSE-MIT diff --git a/library/std_detect/LICENSE-APACHE b/library/std_detect/LICENSE-APACHE deleted file mode 100644 index 16fe87b06e80..000000000000 --- a/library/std_detect/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/library/std_detect/LICENSE-MIT b/library/std_detect/LICENSE-MIT deleted file mode 100644 index 52d82415d8b6..000000000000 --- a/library/std_detect/LICENSE-MIT +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2017 The Rust Project Developers - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. From 81d90d8257e59bc27acd6ec98f3cce3d27de6755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 18 Jul 2025 08:49:28 +0200 Subject: [PATCH 179/183] Improve error messages of auxv loading --- .../std_detect/src/detect/os/linux/auxvec.rs | 17 +++++++++++------ library/std_detect/src/detect/os/linux/mod.rs | 10 ++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/library/std_detect/src/detect/os/linux/auxvec.rs b/library/std_detect/src/detect/os/linux/auxvec.rs index 1ed395f45b9e..443caaaa1863 100644 --- a/library/std_detect/src/detect/os/linux/auxvec.rs +++ b/library/std_detect/src/detect/os/linux/auxvec.rs @@ -119,7 +119,7 @@ pub(crate) fn auxv() -> Result { { // If calling getauxval fails, try to read the auxiliary vector from // its file: - auxv_from_file("/proc/self/auxv") + auxv_from_file("/proc/self/auxv").map_err(|_| ()) } #[cfg(not(feature = "std_detect_file_io"))] { @@ -157,17 +157,22 @@ fn getauxval(key: usize) -> Result { /// Tries to read the auxiliary vector from the `file`. If this fails, this /// function returns `Err`. #[cfg(feature = "std_detect_file_io")] -pub(super) fn auxv_from_file(file: &str) -> Result { +pub(super) fn auxv_from_file(file: &str) -> Result { let file = super::read_file(file)?; + auxv_from_file_bytes(&file) +} +/// Read auxiliary vector from a slice of bytes. +#[cfg(feature = "std_detect_file_io")] +pub(super) fn auxv_from_file_bytes(bytes: &[u8]) -> Result { // See . // // The auxiliary vector contains at most 34 (key,value) fields: from // `AT_MINSIGSTKSZ` to `AT_NULL`, but its number may increase. - let len = file.len(); + let len = bytes.len(); let mut buf = alloc::vec![0_usize; 1 + len / core::mem::size_of::()]; unsafe { - core::ptr::copy_nonoverlapping(file.as_ptr(), buf.as_mut_ptr() as *mut u8, len); + core::ptr::copy_nonoverlapping(bytes.as_ptr(), buf.as_mut_ptr() as *mut u8, len); } auxv_from_buf(&buf) @@ -176,7 +181,7 @@ pub(super) fn auxv_from_file(file: &str) -> Result { /// Tries to interpret the `buffer` as an auxiliary vector. If that fails, this /// function returns `Err`. #[cfg(feature = "std_detect_file_io")] -fn auxv_from_buf(buf: &[usize]) -> Result { +fn auxv_from_buf(buf: &[usize]) -> Result { // Targets with only AT_HWCAP: #[cfg(any( target_arch = "riscv32", @@ -222,7 +227,7 @@ fn auxv_from_buf(buf: &[usize]) -> Result { } // Suppress unused variable let _ = buf; - Err(()) + Err(alloc::string::String::from("hwcap not found")) } #[cfg(test)] diff --git a/library/std_detect/src/detect/os/linux/mod.rs b/library/std_detect/src/detect/os/linux/mod.rs index 9accd41717b9..5ae2aaeab5b8 100644 --- a/library/std_detect/src/detect/os/linux/mod.rs +++ b/library/std_detect/src/detect/os/linux/mod.rs @@ -6,14 +6,16 @@ use alloc::vec::Vec; mod auxvec; #[cfg(feature = "std_detect_file_io")] -fn read_file(path: &str) -> Result, ()> { - let mut path = Vec::from(path.as_bytes()); +fn read_file(orig_path: &str) -> Result, alloc::string::String> { + use alloc::format; + + let mut path = Vec::from(orig_path.as_bytes()); path.push(0); unsafe { let file = libc::open(path.as_ptr() as *const libc::c_char, libc::O_RDONLY); if file == -1 { - return Err(()); + return Err(format!("Cannot open file at {orig_path}")); } let mut data = Vec::new(); @@ -23,7 +25,7 @@ fn read_file(path: &str) -> Result, ()> { match libc::read(file, spare.as_mut_ptr() as *mut _, spare.len()) { -1 => { libc::close(file); - return Err(()); + return Err(format!("Error while reading from file at {orig_path}")); } 0 => break, n => data.set_len(data.len() + n as usize), From 9a1179c4de485759d8d8f3bf978e26fc4e86af64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 18 Jul 2025 08:49:59 +0200 Subject: [PATCH 180/183] Embed auxv files directly into the test binary --- .../src/detect/os/linux/auxvec/tests.rs | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/library/std_detect/src/detect/os/linux/auxvec/tests.rs b/library/std_detect/src/detect/os/linux/auxvec/tests.rs index c0e0ae12a05f..536615fa2725 100644 --- a/library/std_detect/src/detect/os/linux/auxvec/tests.rs +++ b/library/std_detect/src/detect/os/linux/auxvec/tests.rs @@ -44,21 +44,21 @@ fn auxv_dump() { #[cfg(feature = "std_detect_file_io")] cfg_if::cfg_if! { if #[cfg(target_arch = "arm")] { + // The tests below can be executed under qemu, where we do not have access to the test + // files on disk, so we need to embed them with `include_bytes!`. #[test] fn linux_rpi3() { - let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-rpi3.auxv"); - println!("file: {file}"); - let v = auxv_from_file(file).unwrap(); + let auxv = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-rpi3.auxv")); + let v = auxv_from_file_bytes(auxv).unwrap(); assert_eq!(v.hwcap, 4174038); assert_eq!(v.hwcap2, 16); } #[test] fn linux_macos_vb() { - let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv"); - println!("file: {file}"); + let auxv = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv")); // The file contains HWCAP but not HWCAP2. In that case, we treat HWCAP2 as zero. - let v = auxv_from_file(file).unwrap(); + let v = auxv_from_file_bytes(auxv).unwrap(); assert_eq!(v.hwcap, 126614527); assert_eq!(v.hwcap2, 0); } @@ -66,18 +66,16 @@ cfg_if::cfg_if! { #[cfg(target_endian = "little")] #[test] fn linux_artificial_aarch64() { - let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-artificial-aarch64.auxv"); - println!("file: {file}"); - let v = auxv_from_file(file).unwrap(); + let auxv = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-artificial-aarch64.auxv")); + let v = auxv_from_file_bytes(auxv).unwrap(); assert_eq!(v.hwcap, 0x0123456789abcdef); assert_eq!(v.hwcap2, 0x02468ace13579bdf); } #[cfg(target_endian = "little")] #[test] fn linux_no_hwcap2_aarch64() { - let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-no-hwcap2-aarch64.auxv"); - println!("file: {file}"); - let v = auxv_from_file(file).unwrap(); + let auxv = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-no-hwcap2-aarch64.auxv")); + let v = auxv_from_file_bytes(auxv).unwrap(); // An absent HWCAP2 is treated as zero, and does not prevent acceptance of HWCAP. assert_ne!(v.hwcap, 0); assert_eq!(v.hwcap2, 0); From a460b46d0f7d95a0a07bad444606f6fd53aea62c Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Sat, 12 Jul 2025 17:42:39 +0200 Subject: [PATCH 181/183] Ports `#[macro_use]` and `#[macro_escape]` to the new attribute parsing infrastructure --- .../src/attributes.rs | 19 +++ .../src/encode_cross_crate.rs | 2 + .../rustc_attr_data_structures/src/lib.rs | 4 +- .../src/attributes/macro_attrs.rs | 115 ++++++++++++++++++ .../rustc_attr_parsing/src/attributes/mod.rs | 1 + .../src/attributes/must_use.rs | 2 +- compiler/rustc_attr_parsing/src/context.rs | 14 +++ .../src/session_diagnostics.rs | 10 +- compiler/rustc_hir/src/hir.rs | 1 + compiler/rustc_parse/src/validate_attr.rs | 2 + compiler/rustc_passes/src/check_attr.rs | 17 ++- compiler/rustc_resolve/messages.ftl | 2 - .../rustc_resolve/src/build_reduced_graph.rs | 67 +++++----- compiler/rustc_resolve/src/errors.rs | 7 -- .../clippy/clippy_lints/src/macro_use.rs | 8 +- 15 files changed, 206 insertions(+), 65 deletions(-) create mode 100644 compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs index 9f99b33adcc4..1e2576bef2c7 100644 --- a/compiler/rustc_attr_data_structures/src/attributes.rs +++ b/compiler/rustc_attr_data_structures/src/attributes.rs @@ -157,6 +157,19 @@ pub enum UsedBy { Linker, } +#[derive(Encodable, Decodable, Clone, Debug, PartialEq, Eq, Hash)] +#[derive(HashStable_Generic, PrintAttribute)] +pub enum MacroUseArgs { + UseAll, + UseSpecific(ThinVec), +} + +impl Default for MacroUseArgs { + fn default() -> Self { + Self::UseSpecific(ThinVec::new()) + } +} + #[derive(Debug, Clone, Encodable, Decodable, HashStable_Generic)] pub struct StrippedCfgItem { pub parent_module: ModId, @@ -351,9 +364,15 @@ pub enum AttributeKind { /// Represents `#[loop_match]`. LoopMatch(Span), + /// Represents `#[macro_escape]`. + MacroEscape(Span), + /// Represents `#[rustc_macro_transparency]`. MacroTransparency(Transparency), + /// Represents `#[macro_use]`. + MacroUse { span: Span, arguments: MacroUseArgs }, + /// Represents `#[marker]`. Marker(Span), diff --git a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs index 86d9ddba4d23..159b807a3b2b 100644 --- a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs +++ b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs @@ -45,7 +45,9 @@ impl AttributeKind { LinkOrdinal { .. } => No, LinkSection { .. } => Yes, // Needed for rustdoc LoopMatch(..) => No, + MacroEscape(..) => No, MacroTransparency(..) => Yes, + MacroUse { .. } => No, Marker(..) => No, MayDangle(..) => No, MustUse { .. } => Yes, diff --git a/compiler/rustc_attr_data_structures/src/lib.rs b/compiler/rustc_attr_data_structures/src/lib.rs index ecca0e390638..4c5af805ca90 100644 --- a/compiler/rustc_attr_data_structures/src/lib.rs +++ b/compiler/rustc_attr_data_structures/src/lib.rs @@ -24,7 +24,7 @@ use rustc_ast::token::CommentKind; use rustc_ast::{AttrStyle, IntTy, UintTy}; use rustc_ast_pretty::pp::Printer; use rustc_span::hygiene::Transparency; -use rustc_span::{ErrorGuaranteed, Span, Symbol}; +use rustc_span::{ErrorGuaranteed, Ident, Span, Symbol}; pub use stability::*; use thin_vec::ThinVec; pub use version::*; @@ -172,7 +172,7 @@ macro_rules! print_tup { print_tup!(A B C D E F G H); print_skip!(Span, (), ErrorGuaranteed); print_disp!(u16, bool, NonZero); -print_debug!(Symbol, UintTy, IntTy, Align, AttrStyle, CommentKind, Transparency); +print_debug!(Symbol, Ident, UintTy, IntTy, Align, AttrStyle, CommentKind, Transparency); /// Finds attributes in sequences of attributes by pattern matching. /// diff --git a/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs new file mode 100644 index 000000000000..eade49180ace --- /dev/null +++ b/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs @@ -0,0 +1,115 @@ +use rustc_attr_data_structures::{AttributeKind, MacroUseArgs}; +use rustc_errors::DiagArgValue; +use rustc_feature::{AttributeTemplate, template}; +use rustc_span::{Span, Symbol, sym}; +use thin_vec::ThinVec; + +use crate::attributes::{AcceptMapping, AttributeParser, NoArgsAttributeParser, OnDuplicate}; +use crate::context::{AcceptContext, FinalizeContext, Stage}; +use crate::parser::ArgParser; +use crate::session_diagnostics; + +pub(crate) struct MacroEscapeParser; +impl NoArgsAttributeParser for MacroEscapeParser { + const PATH: &[Symbol] = &[sym::macro_escape]; + const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn; + const CREATE: fn(Span) -> AttributeKind = AttributeKind::MacroEscape; +} + +/// `#[macro_use]` attributes can either: +/// - Use all macros from a crate, if provided without arguments +/// - Use specific macros from a crate, if provided with arguments `#[macro_use(macro1, macro2)]` +/// A warning should be provided if an use all is combined with specific uses, or if multiple use-alls are used. +#[derive(Default)] +pub(crate) struct MacroUseParser { + state: MacroUseArgs, + + /// Spans of all `#[macro_use]` arguments with arguments, used for linting + uses_attr_spans: ThinVec, + /// If `state` is `UseSpecific`, stores the span of the first `#[macro_use]` argument, used as the span for this attribute + /// If `state` is `UseAll`, stores the span of the first `#[macro_use]` arguments without arguments + first_span: Option, +} + +const MACRO_USE_TEMPLATE: AttributeTemplate = template!(Word, List: "name1, name2, ..."); + +impl AttributeParser for MacroUseParser { + const ATTRIBUTES: AcceptMapping = &[( + &[sym::macro_use], + MACRO_USE_TEMPLATE, + |group: &mut Self, cx: &mut AcceptContext<'_, '_, S>, args| { + let span = cx.attr_span; + group.first_span.get_or_insert(span); + match args { + ArgParser::NoArgs => { + match group.state { + MacroUseArgs::UseAll => { + let first_span = group.first_span.expect( + "State is UseAll is some so this is not the first attribute", + ); + // Since there is a `#[macro_use]` import already, give a warning + cx.warn_unused_duplicate(first_span, span); + } + MacroUseArgs::UseSpecific(_) => { + group.state = MacroUseArgs::UseAll; + group.first_span = Some(span); + // If there is a `#[macro_use]` attribute, warn on all `#[macro_use(...)]` attributes since everything is already imported + for specific_use in group.uses_attr_spans.drain(..) { + cx.warn_unused_duplicate(span, specific_use); + } + } + } + } + ArgParser::List(list) => { + if list.is_empty() { + cx.warn_empty_attribute(list.span); + return; + } + + match &mut group.state { + MacroUseArgs::UseAll => { + let first_span = group.first_span.expect( + "State is UseAll is some so this is not the first attribute", + ); + cx.warn_unused_duplicate(first_span, span); + } + MacroUseArgs::UseSpecific(arguments) => { + // Store here so if we encounter a `UseAll` later we can still lint this attribute + group.uses_attr_spans.push(cx.attr_span); + + for item in list.mixed() { + let Some(item) = item.meta_item() else { + cx.expected_identifier(item.span()); + continue; + }; + if let Err(err_span) = item.args().no_args() { + cx.expected_no_args(err_span); + continue; + } + let Some(item) = item.path().word() else { + cx.expected_identifier(item.span()); + continue; + }; + arguments.push(item); + } + } + } + } + ArgParser::NameValue(_) => { + let suggestions = MACRO_USE_TEMPLATE.suggestions(false, sym::macro_use); + cx.emit_err(session_diagnostics::IllFormedAttributeInputLint { + num_suggestions: suggestions.len(), + suggestions: DiagArgValue::StrListSepByAnd( + suggestions.into_iter().map(|s| format!("`{s}`").into()).collect(), + ), + span, + }); + } + } + }, + )]; + + fn finalize(self, _cx: &FinalizeContext<'_, '_, S>) -> Option { + Some(AttributeKind::MacroUse { span: self.first_span?, arguments: self.state }) + } +} diff --git a/compiler/rustc_attr_parsing/src/attributes/mod.rs b/compiler/rustc_attr_parsing/src/attributes/mod.rs index 200f13819602..15b90bd2ed72 100644 --- a/compiler/rustc_attr_parsing/src/attributes/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/mod.rs @@ -36,6 +36,7 @@ pub(crate) mod inline; pub(crate) mod link_attrs; pub(crate) mod lint_helpers; pub(crate) mod loop_match; +pub(crate) mod macro_attrs; pub(crate) mod must_use; pub(crate) mod no_implicit_prelude; pub(crate) mod non_exhaustive; diff --git a/compiler/rustc_attr_parsing/src/attributes/must_use.rs b/compiler/rustc_attr_parsing/src/attributes/must_use.rs index e0a3e6755099..42af3ed0bfab 100644 --- a/compiler/rustc_attr_parsing/src/attributes/must_use.rs +++ b/compiler/rustc_attr_parsing/src/attributes/must_use.rs @@ -34,7 +34,7 @@ impl SingleAttributeParser for MustUseParser { ArgParser::List(_) => { let suggestions = >::TEMPLATE.suggestions(false, "must_use"); - cx.emit_err(session_diagnostics::MustUseIllFormedAttributeInput { + cx.emit_err(session_diagnostics::IllFormedAttributeInputLint { num_suggestions: suggestions.len(), suggestions: DiagArgValue::StrListSepByAnd( suggestions.into_iter().map(|s| format!("`{s}`").into()).collect(), diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs index 4d692d9562c1..45bfe3452071 100644 --- a/compiler/rustc_attr_parsing/src/context.rs +++ b/compiler/rustc_attr_parsing/src/context.rs @@ -33,6 +33,7 @@ use crate::attributes::lint_helpers::{ AsPtrParser, AutomaticallyDerivedParser, PassByValueParser, PubTransparentParser, }; use crate::attributes::loop_match::{ConstContinueParser, LoopMatchParser}; +use crate::attributes::macro_attrs::{MacroEscapeParser, MacroUseParser}; use crate::attributes::must_use::MustUseParser; use crate::attributes::no_implicit_prelude::NoImplicitPreludeParser; use crate::attributes::non_exhaustive::NonExhaustiveParser; @@ -126,6 +127,7 @@ attribute_parsers!( BodyStabilityParser, ConfusablesParser, ConstStabilityParser, + MacroUseParser, NakedParser, StabilityParser, UsedParser, @@ -174,6 +176,7 @@ attribute_parsers!( Single>, Single>, Single>, + Single>, Single>, Single>, Single>, @@ -386,6 +389,17 @@ impl<'f, 'sess: 'f, S: Stage> AcceptContext<'f, 'sess, S> { }) } + /// emit an error that a `name` was expected here + pub(crate) fn expected_identifier(&self, span: Span) -> ErrorGuaranteed { + self.emit_err(AttributeParseError { + span, + attr_span: self.attr_span, + template: self.template.clone(), + attribute: self.attr_path.clone(), + reason: AttributeParseErrorReason::ExpectedIdentifier, + }) + } + /// emit an error that a `name = value` pair was expected at this span. The symbol can be given for /// a nicer error message talking about the specific name that was found lacking a value. pub(crate) fn expected_name_value(&self, span: Span, name: Option) -> ErrorGuaranteed { diff --git a/compiler/rustc_attr_parsing/src/session_diagnostics.rs b/compiler/rustc_attr_parsing/src/session_diagnostics.rs index 9a400e0fe104..1de25ca252b8 100644 --- a/compiler/rustc_attr_parsing/src/session_diagnostics.rs +++ b/compiler/rustc_attr_parsing/src/session_diagnostics.rs @@ -438,7 +438,7 @@ pub(crate) struct IllFormedAttributeInput { #[derive(Diagnostic)] #[diag(attr_parsing_ill_formed_attribute_input)] -pub(crate) struct MustUseIllFormedAttributeInput { +pub(crate) struct IllFormedAttributeInputLint { #[primary_span] pub span: Span, pub num_suggestions: usize, @@ -549,6 +549,7 @@ pub(crate) enum AttributeParseErrorReason { /// Should we tell the user to write a list when they didn't? list: bool, }, + ExpectedIdentifier, } pub(crate) struct AttributeParseError { @@ -600,11 +601,11 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError { diag.code(E0538); } AttributeParseErrorReason::UnexpectedLiteral => { - diag.span_label(self.span, format!("didn't expect a literal here")); + diag.span_label(self.span, "didn't expect a literal here"); diag.code(E0565); } AttributeParseErrorReason::ExpectedNoArgs => { - diag.span_label(self.span, format!("didn't expect any arguments here")); + diag.span_label(self.span, "didn't expect any arguments here"); diag.code(E0565); } AttributeParseErrorReason::ExpectedNameValue(None) => { @@ -684,6 +685,9 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError { } } } + AttributeParseErrorReason::ExpectedIdentifier => { + diag.span_label(self.span, "expected a valid identifier here"); + } } let suggestions = self.template.suggestions(false, &name); diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index e7898648c2b0..e83f6a1df720 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1302,6 +1302,7 @@ impl AttributeExt for Attribute { // FIXME: should not be needed anymore when all attrs are parsed Attribute::Parsed(AttributeKind::Deprecation { span, .. }) => *span, Attribute::Parsed(AttributeKind::DocComment { span, .. }) => *span, + Attribute::Parsed(AttributeKind::MacroUse { span, .. }) => *span, Attribute::Parsed(AttributeKind::MayDangle(span)) => *span, Attribute::Parsed(AttributeKind::Ignore { span, .. }) => *span, Attribute::Parsed(AttributeKind::AutomaticallyDerived(span)) => *span, diff --git a/compiler/rustc_parse/src/validate_attr.rs b/compiler/rustc_parse/src/validate_attr.rs index cca621103b5d..ed7fb774908a 100644 --- a/compiler/rustc_parse/src/validate_attr.rs +++ b/compiler/rustc_parse/src/validate_attr.rs @@ -303,6 +303,8 @@ pub fn check_builtin_meta_item( | sym::cold | sym::target_feature | sym::rustc_allow_const_fn_unstable + | sym::macro_use + | sym::macro_escape | sym::naked | sym::no_mangle | sym::non_exhaustive diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 96c895e71dfe..04c1933f243a 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -227,6 +227,12 @@ impl<'tcx> CheckAttrVisitor<'tcx> { Attribute::Parsed(AttributeKind::LinkSection { span: attr_span, .. }) => { self.check_link_section(hir_id, *attr_span, span, target) } + Attribute::Parsed(AttributeKind::MacroUse { span, .. }) => { + self.check_macro_use(hir_id, sym::macro_use, *span, target) + } + Attribute::Parsed(AttributeKind::MacroEscape(span)) => { + self.check_macro_use(hir_id, sym::macro_escape, *span, target) + } Attribute::Parsed(AttributeKind::Naked(attr_span)) => { self.check_naked(hir_id, *attr_span, span, target) } @@ -362,9 +368,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> { [sym::ffi_pure, ..] => self.check_ffi_pure(attr.span(), attrs, target), [sym::ffi_const, ..] => self.check_ffi_const(attr.span(), target), [sym::link, ..] => self.check_link(hir_id, attr, span, target), - [sym::macro_use, ..] | [sym::macro_escape, ..] => { - self.check_macro_use(hir_id, attr, target) - } [sym::path, ..] => self.check_generic_attr_unparsed(hir_id, attr, target, Target::Mod), [sym::macro_export, ..] => self.check_macro_export(hir_id, attr, target), [sym::should_panic, ..] => { @@ -2411,17 +2414,14 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } } - fn check_macro_use(&self, hir_id: HirId, attr: &Attribute, target: Target) { - let Some(name) = attr.name() else { - return; - }; + fn check_macro_use(&self, hir_id: HirId, name: Symbol, attr_span: Span, target: Target) { match target { Target::ExternCrate | Target::Mod => {} _ => { self.tcx.emit_node_span_lint( UNUSED_ATTRIBUTES, hir_id, - attr.span(), + attr_span, errors::MacroUse { name }, ); } @@ -2474,7 +2474,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> { // Warn on useless empty attributes. // FIXME(jdonszelmann): this lint should be moved to attribute parsing, see `AcceptContext::warn_empty_attribute` let note = if attr.has_any_name(&[ - sym::macro_use, sym::allow, sym::expect, sym::warn, diff --git a/compiler/rustc_resolve/messages.ftl b/compiler/rustc_resolve/messages.ftl index aa818cc9c464..39e9a9cc58af 100644 --- a/compiler/rustc_resolve/messages.ftl +++ b/compiler/rustc_resolve/messages.ftl @@ -41,8 +41,6 @@ resolve_attempt_to_use_non_constant_value_in_constant_without_suggestion = resolve_attributes_starting_with_rustc_are_reserved = attributes starting with `rustc` are reserved for use by the `rustc` compiler -resolve_bad_macro_import = bad macro import - resolve_binding_in_never_pattern = never patterns cannot contain variable bindings .suggestion = use a wildcard `_` instead diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index 737577baa7ad..fe7fa71a7fcb 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -11,11 +11,14 @@ use std::sync::Arc; use rustc_ast::visit::{self, AssocCtxt, Visitor, WalkItemKind}; use rustc_ast::{ self as ast, AssocItem, AssocItemKind, Block, ConstItem, Delegation, Fn, ForeignItem, - ForeignItemKind, Impl, Item, ItemKind, MetaItemKind, NodeId, StaticItem, StmtKind, TyAlias, + ForeignItemKind, Impl, Item, ItemKind, NodeId, StaticItem, StmtKind, TyAlias, }; +use rustc_attr_data_structures::{AttributeKind, MacroUseArgs}; use rustc_attr_parsing as attr; +use rustc_attr_parsing::AttributeParser; use rustc_expand::base::ResolverExpand; use rustc_expand::expand::AstFragment; +use rustc_hir::Attribute; use rustc_hir::def::{self, *}; use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LocalDefId}; use rustc_index::bit_set::DenseBitSet; @@ -25,6 +28,7 @@ use rustc_middle::metadata::ModChild; use rustc_middle::ty::{Feed, Visibility}; use rustc_span::hygiene::{ExpnId, LocalExpnId, MacroKind}; use rustc_span::{Ident, Span, Symbol, kw, sym}; +use thin_vec::ThinVec; use tracing::debug; use crate::Namespace::{MacroNS, TypeNS, ValueNS}; @@ -1019,42 +1023,31 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> { /// Returns `true` if we should consider the underlying `extern crate` to be used. fn process_macro_use_imports(&mut self, item: &Item, module: Module<'ra>) -> bool { let mut import_all = None; - let mut single_imports = Vec::new(); - for attr in &item.attrs { - if attr.has_name(sym::macro_use) { - if self.parent_scope.module.parent.is_some() { - self.r.dcx().emit_err(errors::ExternCrateLoadingMacroNotAtCrateRoot { - span: item.span, - }); - } - if let ItemKind::ExternCrate(Some(orig_name), _) = item.kind - && orig_name == kw::SelfLower - { - self.r.dcx().emit_err(errors::MacroUseExternCrateSelf { span: attr.span }); - } - let ill_formed = |span| { - self.r.dcx().emit_err(errors::BadMacroImport { span }); - }; - match attr.meta() { - Some(meta) => match meta.kind { - MetaItemKind::Word => { - import_all = Some(meta.span); - break; - } - MetaItemKind::List(meta_item_inners) => { - for meta_item_inner in meta_item_inners { - match meta_item_inner.ident() { - Some(ident) if meta_item_inner.is_word() => { - single_imports.push(ident) - } - _ => ill_formed(meta_item_inner.span()), - } - } - } - MetaItemKind::NameValue(..) => ill_formed(meta.span), - }, - None => ill_formed(attr.span), - } + let mut single_imports = ThinVec::new(); + if let Some(Attribute::Parsed(AttributeKind::MacroUse { span, arguments })) = + AttributeParser::parse_limited( + self.r.tcx.sess, + &item.attrs, + sym::macro_use, + item.span, + item.id, + None, + ) + { + if self.parent_scope.module.parent.is_some() { + self.r + .dcx() + .emit_err(errors::ExternCrateLoadingMacroNotAtCrateRoot { span: item.span }); + } + if let ItemKind::ExternCrate(Some(orig_name), _) = item.kind + && orig_name == kw::SelfLower + { + self.r.dcx().emit_err(errors::MacroUseExternCrateSelf { span }); + } + + match arguments { + MacroUseArgs::UseAll => import_all = Some(span), + MacroUseArgs::UseSpecific(imports) => single_imports = imports, } } diff --git a/compiler/rustc_resolve/src/errors.rs b/compiler/rustc_resolve/src/errors.rs index b34bcb38f844..d6b1e4de6ea1 100644 --- a/compiler/rustc_resolve/src/errors.rs +++ b/compiler/rustc_resolve/src/errors.rs @@ -815,13 +815,6 @@ pub(crate) struct ExternCrateLoadingMacroNotAtCrateRoot { pub(crate) span: Span, } -#[derive(Diagnostic)] -#[diag(resolve_bad_macro_import, code = E0466)] -pub(crate) struct BadMacroImport { - #[primary_span] - pub(crate) span: Span, -} - #[derive(Diagnostic)] #[diag(resolve_extern_crate_self_requires_renaming)] pub(crate) struct ExternCrateSelfRequiresRenaming { diff --git a/src/tools/clippy/clippy_lints/src/macro_use.rs b/src/tools/clippy/clippy_lints/src/macro_use.rs index c1a26c5a9c73..d1a54df988f5 100644 --- a/src/tools/clippy/clippy_lints/src/macro_use.rs +++ b/src/tools/clippy/clippy_lints/src/macro_use.rs @@ -7,8 +7,9 @@ use rustc_hir::{self as hir, AmbigArg}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_session::impl_lint_pass; use rustc_span::edition::Edition; -use rustc_span::{Span, sym}; +use rustc_span::{Span}; use std::collections::BTreeMap; +use rustc_attr_data_structures::{AttributeKind, find_attr}; declare_clippy_lint! { /// ### What it does @@ -99,15 +100,14 @@ impl LateLintPass<'_> for MacroUseImports { && let hir::ItemKind::Use(path, _kind) = &item.kind && let hir_id = item.hir_id() && let attrs = cx.tcx.hir_attrs(hir_id) - && let Some(mac_attr) = attrs.iter().find(|attr| attr.has_name(sym::macro_use)) + && let Some(mac_attr_span) = find_attr!(attrs, AttributeKind::MacroUse {span, ..} => *span) && let Some(Res::Def(DefKind::Mod, id)) = path.res.type_ns && !id.is_local() { for kid in cx.tcx.module_children(id) { if let Res::Def(DefKind::Macro(_mac_type), mac_id) = kid.res { - let span = mac_attr.span(); let def_path = cx.tcx.def_path_str(mac_id); - self.imports.push((def_path, span, hir_id)); + self.imports.push((def_path, mac_attr_span, hir_id)); } } } else if item.span.from_expansion() { From 3303534dc8825258f8a5d3a1b1e4572d55cccd9a Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Sat, 12 Jul 2025 17:34:43 +0200 Subject: [PATCH 182/183] Update uitest stderrs Signed-off-by: Jonathan Brouwer --- .../src/error_codes/E0466.md | 4 +- tests/pretty/hir-delegation.pp | 2 +- tests/pretty/hir-fn-params.pp | 2 +- tests/pretty/hir-fn-variadic.pp | 2 +- tests/pretty/hir-if-else.pp | 2 +- tests/pretty/hir-lifetimes.pp | 2 +- tests/pretty/hir-pretty-attr.pp | 2 +- tests/pretty/hir-pretty-loop.pp | 2 +- tests/pretty/hir-struct-expr.pp | 2 +- tests/pretty/issue-4264.pp | 2 +- tests/pretty/issue-85089.pp | 2 +- tests/pretty/pin-ergonomics-hir.pp | 2 +- tests/ui/attributes/invalid-macro-use.rs | 53 +++++++ tests/ui/attributes/invalid-macro-use.stderr | 131 ++++++++++++++++++ tests/ui/attributes/malformed-attrs.rs | 2 +- tests/ui/attributes/malformed-attrs.stderr | 21 +-- .../issue-43106-gating-of-macro_use.rs | 2 +- .../issue-43106-gating-of-macro_use.stderr | 11 +- .../lint/unused/unused-attr-duplicate.stderr | 24 ++-- .../unused/unused-attr-macro-rules.stderr | 16 +-- .../genercs-in-path-with-prettry-hir.stdout | 2 +- tests/ui/macros/macro-use-all-and-none.stderr | 5 +- tests/ui/macros/macro-use-bad-args-1.rs | 2 +- tests/ui/macros/macro-use-bad-args-1.stderr | 19 ++- tests/ui/macros/macro-use-bad-args-2.rs | 2 +- tests/ui/macros/macro-use-bad-args-2.stderr | 19 ++- tests/ui/match/issue-82392.stdout | 2 +- .../type-alias-impl-trait/issue-60662.stdout | 2 +- tests/ui/unpretty/bad-literal.stdout | 2 +- tests/ui/unpretty/debug-fmt-hir.stdout | 2 +- tests/ui/unpretty/deprecated-attr.stdout | 2 +- tests/ui/unpretty/diagnostic-attr.stdout | 2 +- tests/ui/unpretty/exhaustive-asm.hir.stdout | 2 +- tests/ui/unpretty/exhaustive.hir.stdout | 2 +- .../ui/unpretty/flattened-format-args.stdout | 2 +- tests/ui/unpretty/let-else-hir.stdout | 2 +- tests/ui/unpretty/self-hir.stdout | 2 +- tests/ui/unpretty/unpretty-expr-fn-arg.stdout | 2 +- 38 files changed, 274 insertions(+), 85 deletions(-) create mode 100644 tests/ui/attributes/invalid-macro-use.rs create mode 100644 tests/ui/attributes/invalid-macro-use.stderr diff --git a/compiler/rustc_error_codes/src/error_codes/E0466.md b/compiler/rustc_error_codes/src/error_codes/E0466.md index 7aefedbc0875..28016eb395e9 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0466.md +++ b/compiler/rustc_error_codes/src/error_codes/E0466.md @@ -1,8 +1,10 @@ +#### Note: this error code is no longer emitted by the compiler. + Macro import declaration was malformed. Erroneous code examples: -```compile_fail,E0466 +```compile_fail #[macro_use(a_macro(another_macro))] // error: invalid import declaration extern crate core as some_crate; diff --git a/tests/pretty/hir-delegation.pp b/tests/pretty/hir-delegation.pp index e452cee63659..c0d724cccb51 100644 --- a/tests/pretty/hir-delegation.pp +++ b/tests/pretty/hir-delegation.pp @@ -6,7 +6,7 @@ #![feature(fn_delegation)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; fn b(e: C) { } diff --git a/tests/pretty/hir-fn-params.pp b/tests/pretty/hir-fn-params.pp index 3799c8a3c3b7..cfb33cc93eba 100644 --- a/tests/pretty/hir-fn-params.pp +++ b/tests/pretty/hir-fn-params.pp @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir diff --git a/tests/pretty/hir-fn-variadic.pp b/tests/pretty/hir-fn-variadic.pp index b6bc8e95127f..99919e7fc6b2 100644 --- a/tests/pretty/hir-fn-variadic.pp +++ b/tests/pretty/hir-fn-variadic.pp @@ -5,7 +5,7 @@ #![feature(c_variadic)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; extern "C" { diff --git a/tests/pretty/hir-if-else.pp b/tests/pretty/hir-if-else.pp index 200e34ac4f5a..4bccde663eb5 100644 --- a/tests/pretty/hir-if-else.pp +++ b/tests/pretty/hir-if-else.pp @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir diff --git a/tests/pretty/hir-lifetimes.pp b/tests/pretty/hir-lifetimes.pp index 58de6d819158..1bb2f17cdfb4 100644 --- a/tests/pretty/hir-lifetimes.pp +++ b/tests/pretty/hir-lifetimes.pp @@ -7,7 +7,7 @@ #![allow(unused)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; struct Foo<'a> { diff --git a/tests/pretty/hir-pretty-attr.pp b/tests/pretty/hir-pretty-attr.pp index db7489c12641..c780f8e3639f 100644 --- a/tests/pretty/hir-pretty-attr.pp +++ b/tests/pretty/hir-pretty-attr.pp @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir diff --git a/tests/pretty/hir-pretty-loop.pp b/tests/pretty/hir-pretty-loop.pp index 15f1677885ae..c07120273c90 100644 --- a/tests/pretty/hir-pretty-loop.pp +++ b/tests/pretty/hir-pretty-loop.pp @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir diff --git a/tests/pretty/hir-struct-expr.pp b/tests/pretty/hir-struct-expr.pp index f85d17542dff..177eb5e8631f 100644 --- a/tests/pretty/hir-struct-expr.pp +++ b/tests/pretty/hir-struct-expr.pp @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir diff --git a/tests/pretty/issue-4264.pp b/tests/pretty/issue-4264.pp index eb808f7122a9..f4b641335d1d 100644 --- a/tests/pretty/issue-4264.pp +++ b/tests/pretty/issue-4264.pp @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir,typed diff --git a/tests/pretty/issue-85089.pp b/tests/pretty/issue-85089.pp index f4e0eb3dd5ff..31c0f90bf27e 100644 --- a/tests/pretty/issue-85089.pp +++ b/tests/pretty/issue-85089.pp @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; // Test to print lifetimes on HIR pretty-printing. diff --git a/tests/pretty/pin-ergonomics-hir.pp b/tests/pretty/pin-ergonomics-hir.pp index 212e0e174dae..58a1c62f712c 100644 --- a/tests/pretty/pin-ergonomics-hir.pp +++ b/tests/pretty/pin-ergonomics-hir.pp @@ -6,7 +6,7 @@ #![allow(dead_code, incomplete_features)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; use std::pin::Pin; diff --git a/tests/ui/attributes/invalid-macro-use.rs b/tests/ui/attributes/invalid-macro-use.rs new file mode 100644 index 000000000000..cfb13fd183c7 --- /dev/null +++ b/tests/ui/attributes/invalid-macro-use.rs @@ -0,0 +1,53 @@ +#![deny(unused_attributes)] +//~^ NOTE the lint level is defined here + +#[macro_use = 5] +//~^ ERROR valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` +extern crate std as s1; + +#[macro_use(5)] +//~^ ERROR malformed `macro_use` attribute input +//~| NOTE expected a valid identifier here +extern crate std as s2; + +#[macro_use(a = "b")] +//~^ ERROR malformed `macro_use` attribute input +//~| NOTE didn't expect any arguments here +extern crate std as s3; + +#[macro_use(a(b))] +//~^ ERROR malformed `macro_use` attribute input +//~| NOTE didn't expect any arguments here +extern crate std as s4; + +#[macro_use(a::b)] +//~^ ERROR malformed `macro_use` attribute input +//~| NOTE expected a valid identifier here +extern crate std as s5; + +#[macro_use(a)] +//~^ ERROR unused attribute +#[macro_use] +//~^ NOTE attribute also specified here +extern crate std as s6; + +#[macro_use] +//~^ NOTE attribute also specified here +#[macro_use(a)] +//~^ ERROR unused attribute +extern crate std as s7; + +#[macro_use] +//~^ NOTE attribute also specified here +#[macro_use] +//~^ ERROR unused attribute +extern crate std as s8; + +// This is fine, both are importing different names +#[macro_use(a)] +//~^ ERROR imported macro not found +#[macro_use(b)] +//~^ ERROR imported macro not found +extern crate std as s9; + +fn main() {} diff --git a/tests/ui/attributes/invalid-macro-use.stderr b/tests/ui/attributes/invalid-macro-use.stderr new file mode 100644 index 000000000000..4f5db5c558a5 --- /dev/null +++ b/tests/ui/attributes/invalid-macro-use.stderr @@ -0,0 +1,131 @@ +error[E0469]: imported macro not found + --> $DIR/invalid-macro-use.rs:47:13 + | +LL | #[macro_use(a)] + | ^ + +error[E0469]: imported macro not found + --> $DIR/invalid-macro-use.rs:49:13 + | +LL | #[macro_use(b)] + | ^ + +error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` + --> $DIR/invalid-macro-use.rs:4:1 + | +LL | #[macro_use = 5] + | ^^^^^^^^^^^^^^^^ + +error[E0539]: malformed `macro_use` attribute input + --> $DIR/invalid-macro-use.rs:8:1 + | +LL | #[macro_use(5)] + | ^^^^^^^^^^^^-^^ + | | + | expected a valid identifier here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(5)] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(5)] +LL + #[macro_use] + | + +error[E0565]: malformed `macro_use` attribute input + --> $DIR/invalid-macro-use.rs:13:1 + | +LL | #[macro_use(a = "b")] + | ^^^^^^^^^^^^^^-----^^ + | | + | didn't expect any arguments here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(a = "b")] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(a = "b")] +LL + #[macro_use] + | + +error[E0565]: malformed `macro_use` attribute input + --> $DIR/invalid-macro-use.rs:18:1 + | +LL | #[macro_use(a(b))] + | ^^^^^^^^^^^^^---^^ + | | + | didn't expect any arguments here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(a(b))] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(a(b))] +LL + #[macro_use] + | + +error[E0539]: malformed `macro_use` attribute input + --> $DIR/invalid-macro-use.rs:23:1 + | +LL | #[macro_use(a::b)] + | ^^^^^^^^^^^^----^^ + | | + | expected a valid identifier here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(a::b)] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(a::b)] +LL + #[macro_use] + | + +error: unused attribute + --> $DIR/invalid-macro-use.rs:28:1 + | +LL | #[macro_use(a)] + | ^^^^^^^^^^^^^^^ help: remove this attribute + | +note: attribute also specified here + --> $DIR/invalid-macro-use.rs:30:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ +note: the lint level is defined here + --> $DIR/invalid-macro-use.rs:1:9 + | +LL | #![deny(unused_attributes)] + | ^^^^^^^^^^^^^^^^^ + +error: unused attribute + --> $DIR/invalid-macro-use.rs:36:1 + | +LL | #[macro_use(a)] + | ^^^^^^^^^^^^^^^ help: remove this attribute + | +note: attribute also specified here + --> $DIR/invalid-macro-use.rs:34:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ + +error: unused attribute + --> $DIR/invalid-macro-use.rs:42:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ help: remove this attribute + | +note: attribute also specified here + --> $DIR/invalid-macro-use.rs:40:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ + +error: aborting due to 10 previous errors + +Some errors have detailed explanations: E0469, E0539, E0565. +For more information about an error, try `rustc --explain E0469`. diff --git a/tests/ui/attributes/malformed-attrs.rs b/tests/ui/attributes/malformed-attrs.rs index d4c6ecaa1892..2a8b7b41e58f 100644 --- a/tests/ui/attributes/malformed-attrs.rs +++ b/tests/ui/attributes/malformed-attrs.rs @@ -208,7 +208,7 @@ static mut TLS: u8 = 42; #[no_link()] //~^ ERROR malformed #[macro_use = 1] -//~^ ERROR malformed +//~^ ERROR valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` extern crate wloop; //~^ ERROR can't find crate for `wloop` [E0463] diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index de53af851a3e..7ae24db8b5fe 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -154,21 +154,6 @@ error: malformed `no_link` attribute input LL | #[no_link()] | ^^^^^^^^^^^^ help: must be of the form: `#[no_link]` -error: malformed `macro_use` attribute input - --> $DIR/malformed-attrs.rs:210:1 - | -LL | #[macro_use = 1] - | ^^^^^^^^^^^^^^^^ - | -help: the following are the possible correct uses - | -LL - #[macro_use = 1] -LL + #[macro_use(name1, name2, ...)] - | -LL - #[macro_use = 1] -LL + #[macro_use] - | - error: malformed `macro_export` attribute input --> $DIR/malformed-attrs.rs:215:1 | @@ -567,6 +552,12 @@ LL | #[non_exhaustive = 1] | | didn't expect any arguments here | help: must be of the form: `#[non_exhaustive]` +error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` + --> $DIR/malformed-attrs.rs:210:1 + | +LL | #[macro_use = 1] + | ^^^^^^^^^^^^^^^^ + error[E0565]: malformed `type_const` attribute input --> $DIR/malformed-attrs.rs:144:5 | diff --git a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.rs b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.rs index 6a7ef793924a..0438152ff35f 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.rs @@ -13,7 +13,7 @@ mod macro_escape { //~^ ERROR arguments to `macro_use` are not allowed here #[macro_use = "2700"] struct S; - //~^ ERROR malformed `macro_use` attribute + //~^ ERROR valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` #[macro_use] fn f() { } diff --git a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr index 8987b87f84e9..4da717668379 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr @@ -16,20 +16,11 @@ error: arguments to `macro_use` are not allowed here LL | #![macro_use(my_macro)] | ^^^^^^^^^^^^^^^^^^^^^^^ -error: malformed `macro_use` attribute input +error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` --> $DIR/issue-43106-gating-of-macro_use.rs:15:5 | LL | #[macro_use = "2700"] struct S; | ^^^^^^^^^^^^^^^^^^^^^ - | -help: the following are the possible correct uses - | -LL - #[macro_use = "2700"] struct S; -LL + #[macro_use(name1, name2, ...)] struct S; - | -LL - #[macro_use = "2700"] struct S; -LL + #[macro_use] struct S; - | error: aborting due to 4 previous errors diff --git a/tests/ui/lint/unused/unused-attr-duplicate.stderr b/tests/ui/lint/unused/unused-attr-duplicate.stderr index ecc1b7ff5a46..e277f5203c69 100644 --- a/tests/ui/lint/unused/unused-attr-duplicate.stderr +++ b/tests/ui/lint/unused/unused-attr-duplicate.stderr @@ -15,18 +15,6 @@ note: the lint level is defined here LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -error: unused attribute - --> $DIR/unused-attr-duplicate.rs:37:1 - | -LL | #[macro_use] - | ^^^^^^^^^^^^ help: remove this attribute - | -note: attribute also specified here - --> $DIR/unused-attr-duplicate.rs:36:1 - | -LL | #[macro_use] - | ^^^^^^^^^^^^ - error: unused attribute --> $DIR/unused-attr-duplicate.rs:55:1 | @@ -128,6 +116,18 @@ note: attribute also specified here LL | #[macro_export] | ^^^^^^^^^^^^^^^ +error: unused attribute + --> $DIR/unused-attr-duplicate.rs:37:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ help: remove this attribute + | +note: attribute also specified here + --> $DIR/unused-attr-duplicate.rs:36:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ + error: unused attribute --> $DIR/unused-attr-duplicate.rs:47:1 | diff --git a/tests/ui/lint/unused/unused-attr-macro-rules.stderr b/tests/ui/lint/unused/unused-attr-macro-rules.stderr index 4698e3814258..1e1211af5e29 100644 --- a/tests/ui/lint/unused/unused-attr-macro-rules.stderr +++ b/tests/ui/lint/unused/unused-attr-macro-rules.stderr @@ -1,8 +1,8 @@ -error: `#[macro_use]` only has an effect on `extern crate` and modules - --> $DIR/unused-attr-macro-rules.rs:7:1 +error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` + --> $DIR/unused-attr-macro-rules.rs:9:1 | -LL | #[macro_use] - | ^^^^^^^^^^^^ +LL | #[recursion_limit="1"] + | ^^^^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/unused-attr-macro-rules.rs:1:9 @@ -10,11 +10,11 @@ note: the lint level is defined here LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/unused-attr-macro-rules.rs:9:1 +error: `#[macro_use]` only has an effect on `extern crate` and modules + --> $DIR/unused-attr-macro-rules.rs:7:1 | -LL | #[recursion_limit="1"] - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[macro_use] + | ^^^^^^^^^^^^ error: `#[path]` only has an effect on modules --> $DIR/unused-attr-macro-rules.rs:8:1 diff --git a/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout b/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout index 7c41225f95e6..6b0300132b5f 100644 --- a/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout +++ b/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ compile-flags: -Zunpretty=hir //@ edition: 2015 diff --git a/tests/ui/macros/macro-use-all-and-none.stderr b/tests/ui/macros/macro-use-all-and-none.stderr index 00b10dccd001..a5efb065a21b 100644 --- a/tests/ui/macros/macro-use-all-and-none.stderr +++ b/tests/ui/macros/macro-use-all-and-none.stderr @@ -1,10 +1,9 @@ warning: unused attribute - --> $DIR/macro-use-all-and-none.rs:7:1 + --> $DIR/macro-use-all-and-none.rs:7:12 | LL | #[macro_use()] - | ^^^^^^^^^^^^^^ help: remove this attribute + | ^^ help: remove this attribute | - = note: attribute `macro_use` with an empty list has no effect note: the lint level is defined here --> $DIR/macro-use-all-and-none.rs:4:9 | diff --git a/tests/ui/macros/macro-use-bad-args-1.rs b/tests/ui/macros/macro-use-bad-args-1.rs index ec0b64a10953..bfc19981804d 100644 --- a/tests/ui/macros/macro-use-bad-args-1.rs +++ b/tests/ui/macros/macro-use-bad-args-1.rs @@ -1,6 +1,6 @@ #![no_std] -#[macro_use(foo(bar))] //~ ERROR bad macro import +#[macro_use(foo(bar))] //~ ERROR malformed `macro_use` attribute input extern crate std; fn main() {} diff --git a/tests/ui/macros/macro-use-bad-args-1.stderr b/tests/ui/macros/macro-use-bad-args-1.stderr index 6d2f159a5740..2f43d0997df5 100644 --- a/tests/ui/macros/macro-use-bad-args-1.stderr +++ b/tests/ui/macros/macro-use-bad-args-1.stderr @@ -1,9 +1,20 @@ -error[E0466]: bad macro import - --> $DIR/macro-use-bad-args-1.rs:3:13 +error[E0565]: malformed `macro_use` attribute input + --> $DIR/macro-use-bad-args-1.rs:3:1 | LL | #[macro_use(foo(bar))] - | ^^^^^^^^ + | ^^^^^^^^^^^^^^^-----^^ + | | + | didn't expect any arguments here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(foo(bar))] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(foo(bar))] +LL + #[macro_use] + | error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0466`. +For more information about this error, try `rustc --explain E0565`. diff --git a/tests/ui/macros/macro-use-bad-args-2.rs b/tests/ui/macros/macro-use-bad-args-2.rs index c5f8f62c1868..e328b6285d91 100644 --- a/tests/ui/macros/macro-use-bad-args-2.rs +++ b/tests/ui/macros/macro-use-bad-args-2.rs @@ -1,6 +1,6 @@ #![no_std] -#[macro_use(foo="bar")] //~ ERROR bad macro import +#[macro_use(foo="bar")] //~ ERROR malformed `macro_use` attribute input extern crate std; fn main() {} diff --git a/tests/ui/macros/macro-use-bad-args-2.stderr b/tests/ui/macros/macro-use-bad-args-2.stderr index 364f3da6e15a..d7b03c935886 100644 --- a/tests/ui/macros/macro-use-bad-args-2.stderr +++ b/tests/ui/macros/macro-use-bad-args-2.stderr @@ -1,9 +1,20 @@ -error[E0466]: bad macro import - --> $DIR/macro-use-bad-args-2.rs:3:13 +error[E0565]: malformed `macro_use` attribute input + --> $DIR/macro-use-bad-args-2.rs:3:1 | LL | #[macro_use(foo="bar")] - | ^^^^^^^^^ + | ^^^^^^^^^^^^^^^------^^ + | | + | didn't expect any arguments here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(foo="bar")] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(foo="bar")] +LL + #[macro_use] + | error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0466`. +For more information about this error, try `rustc --explain E0565`. diff --git a/tests/ui/match/issue-82392.stdout b/tests/ui/match/issue-82392.stdout index a0d83d962e73..3efc964e053b 100644 --- a/tests/ui/match/issue-82392.stdout +++ b/tests/ui/match/issue-82392.stdout @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; // https://github.com/rust-lang/rust/issues/82329 //@ compile-flags: -Zunpretty=hir,typed diff --git a/tests/ui/type-alias-impl-trait/issue-60662.stdout b/tests/ui/type-alias-impl-trait/issue-60662.stdout index 56fef852e37b..52152a73affe 100644 --- a/tests/ui/type-alias-impl-trait/issue-60662.stdout +++ b/tests/ui/type-alias-impl-trait/issue-60662.stdout @@ -5,7 +5,7 @@ #![feature(type_alias_impl_trait)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; trait Animal { } diff --git a/tests/ui/unpretty/bad-literal.stdout b/tests/ui/unpretty/bad-literal.stdout index 06116a4ab553..ba8467359cd6 100644 --- a/tests/ui/unpretty/bad-literal.stdout +++ b/tests/ui/unpretty/bad-literal.stdout @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-fail diff --git a/tests/ui/unpretty/debug-fmt-hir.stdout b/tests/ui/unpretty/debug-fmt-hir.stdout index dc18675ea803..1d224c9e91ff 100644 --- a/tests/ui/unpretty/debug-fmt-hir.stdout +++ b/tests/ui/unpretty/debug-fmt-hir.stdout @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass diff --git a/tests/ui/unpretty/deprecated-attr.stdout b/tests/ui/unpretty/deprecated-attr.stdout index 042c2f61bd4c..0abeef6f61e0 100644 --- a/tests/ui/unpretty/deprecated-attr.stdout +++ b/tests/ui/unpretty/deprecated-attr.stdout @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass diff --git a/tests/ui/unpretty/diagnostic-attr.stdout b/tests/ui/unpretty/diagnostic-attr.stdout index 3b15a845d68f..a1325c61ca73 100644 --- a/tests/ui/unpretty/diagnostic-attr.stdout +++ b/tests/ui/unpretty/diagnostic-attr.stdout @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass diff --git a/tests/ui/unpretty/exhaustive-asm.hir.stdout b/tests/ui/unpretty/exhaustive-asm.hir.stdout index ec9bda573312..bbd846a88454 100644 --- a/tests/ui/unpretty/exhaustive-asm.hir.stdout +++ b/tests/ui/unpretty/exhaustive-asm.hir.stdout @@ -1,6 +1,6 @@ #[prelude_import] use std::prelude::rust_2024::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ revisions: expanded hir //@[expanded]compile-flags: -Zunpretty=expanded diff --git a/tests/ui/unpretty/exhaustive.hir.stdout b/tests/ui/unpretty/exhaustive.hir.stdout index a559d51ed5d6..77807728c9d3 100644 --- a/tests/ui/unpretty/exhaustive.hir.stdout +++ b/tests/ui/unpretty/exhaustive.hir.stdout @@ -30,7 +30,7 @@ #![allow(incomplete_features)] #[prelude_import] use std::prelude::rust_2024::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] diff --git a/tests/ui/unpretty/flattened-format-args.stdout b/tests/ui/unpretty/flattened-format-args.stdout index 4af82924c7b4..3cd027346655 100644 --- a/tests/ui/unpretty/flattened-format-args.stdout +++ b/tests/ui/unpretty/flattened-format-args.stdout @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ compile-flags: -Zunpretty=hir -Zflatten-format-args=yes //@ check-pass diff --git a/tests/ui/unpretty/let-else-hir.stdout b/tests/ui/unpretty/let-else-hir.stdout index a6dd943ec1b7..a83790d8bee5 100644 --- a/tests/ui/unpretty/let-else-hir.stdout +++ b/tests/ui/unpretty/let-else-hir.stdout @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass diff --git a/tests/ui/unpretty/self-hir.stdout b/tests/ui/unpretty/self-hir.stdout index a9e80b1f5920..1eafc3c8b46b 100644 --- a/tests/ui/unpretty/self-hir.stdout +++ b/tests/ui/unpretty/self-hir.stdout @@ -1,6 +1,6 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass diff --git a/tests/ui/unpretty/unpretty-expr-fn-arg.stdout b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout index fd2e794fcac8..e9fd2222a8d2 100644 --- a/tests/ui/unpretty/unpretty-expr-fn-arg.stdout +++ b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout @@ -10,7 +10,7 @@ #![allow(dead_code)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] +#[attr = MacroUse {arguments: UseAll}] extern crate std; fn main() ({ } as ()) From 11153451845ff40624a3887d6312e563951932b0 Mon Sep 17 00:00:00 2001 From: The rustc-josh-sync Cronjob Bot Date: Thu, 24 Jul 2025 04:15:31 +0000 Subject: [PATCH 183/183] Prepare for merging from rust-lang/rust This updates the rust-version file to efd420c770bb179537c01063e98cb6990c439654. --- src/doc/rustc-dev-guide/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/rustc-dev-guide/rust-version b/src/doc/rustc-dev-guide/rust-version index f6b7efe51a12..ce9f984e637b 100644 --- a/src/doc/rustc-dev-guide/rust-version +++ b/src/doc/rustc-dev-guide/rust-version @@ -1 +1 @@ -460259d14de0274b97b8801e08cb2fe5f16fdac5 +efd420c770bb179537c01063e98cb6990c439654