PKGBUILDs/extra/js78/0003-Fixes-for-Rust-1.56.patch

448 lines
56 KiB
Diff
Raw Normal View History

2022-01-12 00:20:00 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Henri Sivonen <hsivonen@hsivonen.fi>
Date: Thu, 15 Jul 2021 08:42:08 +0000
Subject: [PATCH] Fixes for Rust 1.56
packed_simd updates cherry-picked from Firefox Nightly.
---
.cargo/config.in | 2 +-
Cargo.lock | 2 +-
Cargo.toml | 2 +-
.../rust/packed_simd/.cargo-checksum.json | 2 +-
third_party/rust/packed_simd/Cargo.toml | 6 +-
third_party/rust/packed_simd/build.rs | 28 ++++-
.../rust/packed_simd/src/api/shuffle.rs | 116 ------------------
.../rust/packed_simd/src/codegen/llvm.rs | 62 ----------
third_party/rust/packed_simd/src/lib.rs | 6 +-
9 files changed, 35 insertions(+), 191 deletions(-)
diff --git a/.cargo/config.in b/.cargo/config.in
index 37fac6a1008a..1597f123c65c 100644
--- a/.cargo/config.in
+++ b/.cargo/config.in
@@ -50,7 +50,7 @@ tag = "v0.3.0"
[source."https://github.com/hsivonen/packed_simd"]
git = "https://github.com/hsivonen/packed_simd"
replace-with = "vendored-sources"
-rev = "07d285ba65d9a4e3b9d76eacbf4c6489e125127d"
+rev = "8b4bd7d8229660a749dbe419a57ea01df9de5453"
[source."https://github.com/djg/cubeb-pulse-rs"]
git = "https://github.com/djg/cubeb-pulse-rs"
diff --git a/Cargo.lock b/Cargo.lock
index 990d6a4a582b..fae4794d9478 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3426,7 +3426,7 @@ dependencies = [
[[package]]
name = "packed_simd"
version = "0.3.4"
-source = "git+https://github.com/hsivonen/packed_simd?rev=07d285ba65d9a4e3b9d76eacbf4c6489e125127d#07d285ba65d9a4e3b9d76eacbf4c6489e125127d"
+source = "git+https://github.com/hsivonen/packed_simd?rev=8b4bd7d8229660a749dbe419a57ea01df9de5453#8b4bd7d8229660a749dbe419a57ea01df9de5453"
dependencies = [
"cfg-if",
"rustc_version",
diff --git a/Cargo.toml b/Cargo.toml
index 897daad41bed..171de100291a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -66,7 +66,7 @@ panic = "abort"
[patch.crates-io]
libudev-sys = { path = "dom/webauthn/libudev-sys" }
-packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="07d285ba65d9a4e3b9d76eacbf4c6489e125127d" }
+packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="8b4bd7d8229660a749dbe419a57ea01df9de5453" }
rlbox_lucet_sandbox = { git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/", rev="d510da5999a744c563b0acd18056069d1698273f" }
nix = { git = "https://github.com/shravanrn/nix/", rev="4af6c367603869a30fddb5ffb0aba2b9477ba92e" }
spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu3" }
diff --git a/third_party/rust/packed_simd/.cargo-checksum.json b/third_party/rust/packed_simd/.cargo-checksum.json
index 5d5b8e066ecb..51a1cee537e3 100644
--- a/third_party/rust/packed_simd/.cargo-checksum.json
+++ b/third_party/rust/packed_simd/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{".appveyor.yml":"f1ed01850e0d725f9498f52a1a63ddf40702ad6e0bf5b2d7c4c04d76e96794a3",".travis.yml":"d56de6531d3c4880e3aada85ac8e6d7388e5d781871e181cb8ade2a746d5d5f5","Cargo.toml":"c7124d80c769e792e6a39f523e72b845ed43d6e3a68dd37af4579fbf58b50828","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"49d01e49a33393af64fa6c813b6a724f68a4d1abfbedcb96413651ed105aa820","bors.toml":"dee881dc69b9b7834e4eba5d95c3ed5a416d4628815a167d6a22d4cb4fb064b8","build.rs":"d344fca66796a5ec1ee681edb1aec7ae3c999262a2f215c26f87e9b1ba00ac94","ci/all.sh":"2ae6b2445b4db83833e40b37efd0016c6b9879ee988b9b3ef94db5439a3e1606","ci/android-install-ndk.sh":"0f1746108cc30bf9b9ba45bcde7b19fc1a8bdf5b0258035b4eb8dc69b75efac4","ci/android-install-sdk.sh":"3490432022c5c8f5a115c084f7a9aca1626f96c0c87ffb62019228c4346b47e4","ci/android-sysimage.sh":"ebf4e5daa1f0fe1b2092b79f0f3f161c4c4275cb744e52352c4d81ab451e4c5a","ci/benchmark.sh":"b61d19ef6b90deba8fb79dee74c8b062d94844676293da346da87bb78a9a49a4","ci/deploy_and_run_on_ios_simulator.rs":"ec8ecf82d92072676aa47f0d1a3d021b60a7ae3531153ef12d2ff4541fc294dc","ci/docker/aarch64-linux-android/Dockerfile":"ace2e7d33c87bc0f6d3962a4a3408c04557646f7f51ab99cfbf574906796b016","ci/docker/aarch64-unknown-linux-gnu/Dockerfile":"da88c0d50f16dc08448c7fdf1fa5ed2cbe576acf9e7dd85b5b818621b2a8c702","ci/docker/arm-linux-androideabi/Dockerfile":"370e55d3330a413a3ccf677b3afb3e0ef9018a5fab263faa97ae8ac017fc2286","ci/docker/arm-unknown-linux-gnueabi/Dockerfile":"bb5f8ae890707c128652290ffc544447643bf12037ddd73c6ad6989f848cb380","ci/docker/arm-unknown-linux-gnueabihf/Dockerfile":"1afaefcbc05b740859acd4e067bc92439be6bcbe8f2e9678474fb434bcd398d9","ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile":"8282ea707a94109beed47a57574755e2d58401735904a03f85fb64c578c53b4f","ci/docker/i586-unknown-linux-gnu/Dockerfile":"49792922269f371bd29da4727e9085101b27be67a6b97755d0196c63317f7abb","ci/docker/i686-unknown-linux-gnu/Dockerfile":"49792922269f371bd29da4727e9085101b27be67a6b97755d0196c63317f7abb","ci/docker/mips-unknown-linux-gnu/Dockerfile":"b2ebc25797612c4f8395fe9d407725156044955bfbcf442036b7f55b43a5f9da","ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile":"b0c1692ac65bc56dd30494b1993d8e929c48cc9c4b92029b7c7592af6d4f9220","ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile":"4e9249c179300138141d0b2b7401b11897f64aed69f541f078c1db4594df2827","ci/docker/mipsel-unknown-linux-musl/Dockerfile":"3164c52b0dcbb01afa78292b15b5c43503ccf0491cf6eb801ec2bf22ae274e52","ci/docker/powerpc-unknown-linux-gnu/Dockerfile":"786f799d0b56eb54d7b6c4b00e1aed4ce81776e14e44767e083c89d014b72004","ci/docker/powerpc64-unknown-linux-gnu/Dockerfile":"e8bc363837cd9c2d8b22402acb8c1c329efc11ba5d12170603d2fe2eae9da059","ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile":"47998d45b781d797b9e6085ebe898d90de0c952b54537a8db4e8d7503eb032d9","ci/docker/s390x-unknown-linux-gnu/Dockerfile":"93fb44df3d7fd31ead158570667c97b5076a05c3d968af4a84bc13819a8f2db8","ci/docker/sparc64-unknown-linux-gnu/Dockerfile":"da1c39a3ff1fe22e41395fa7c8934e90b4c1788e551b9aec6e38bfd94effc437","ci/docker/thumbv7neon-linux-androideabi/Dockerfile":"c2decd5591bd7a09378901bef629cd944acf052eb55e4f35b79eb9cb4d62246a","ci/docker/thumbv7neon-unknown-linux-gnueabihf/Dockerfile":"51955a8bf3c4d440f47382af6f5426ebff94ab01a04da36175babda9a057740f","ci/docker/wasm32-unknown-unknown/Dockerfile":"3e5f294bc1e004aa599086c2af49d6f3e7459fa250f5fbdd60cf67d53db78758","ci/docker/x86_64-linux-android/Dockerfile":"685040273cf350d5509e580ac451555efa19790c8723ca2af066adadc6880ad2","ci/docker/x86_64-unknown-linux-gnu-emulated/Dockerfile":"44b6203d9290bfdc53d81219f0937e1110847a23dd982ec8c4de388354f01536","ci/docker/x86_64-unknown-linux-gnu/Dockerfile":"7f4e3ca5fa288ea70edb4d1f75309708cd30b192e2e4444e61c4d5b3b58f89cf","ci/dox.sh":"434e9611c52e389312d2b03564adf09429f10cc76fe66a8644adb104903b87b7","ci/linux-s390x.sh":"d6b732d7795b4ba131326aff893bca6228a7d2eb0e9402f135705413dbbe0dce","ci/linux-sparc64.sh":"c92966838b1ab
\ No newline at end of file
+{"files":{".appveyor.yml":"f1ed01850e0d725f9498f52a1a63ddf40702ad6e0bf5b2d7c4c04d76e96794a3",".travis.yml":"d56de6531d3c4880e3aada85ac8e6d7388e5d781871e181cb8ade2a746d5d5f5","Cargo.toml":"b6f063e65c1f8d71c51204444d4e93cd514cb310dedfd1e85b731c1acc63ab4a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"49d01e49a33393af64fa6c813b6a724f68a4d1abfbedcb96413651ed105aa820","bors.toml":"dee881dc69b9b7834e4eba5d95c3ed5a416d4628815a167d6a22d4cb4fb064b8","build.rs":"9d7f69238f5dfefa3c49744159c2f484feb4c32c9aefe79696ebe97a89b2957f","ci/all.sh":"2ae6b2445b4db83833e40b37efd0016c6b9879ee988b9b3ef94db5439a3e1606","ci/android-install-ndk.sh":"0f1746108cc30bf9b9ba45bcde7b19fc1a8bdf5b0258035b4eb8dc69b75efac4","ci/android-install-sdk.sh":"3490432022c5c8f5a115c084f7a9aca1626f96c0c87ffb62019228c4346b47e4","ci/android-sysimage.sh":"ebf4e5daa1f0fe1b2092b79f0f3f161c4c4275cb744e52352c4d81ab451e4c5a","ci/benchmark.sh":"b61d19ef6b90deba8fb79dee74c8b062d94844676293da346da87bb78a9a49a4","ci/deploy_and_run_on_ios_simulator.rs":"ec8ecf82d92072676aa47f0d1a3d021b60a7ae3531153ef12d2ff4541fc294dc","ci/docker/aarch64-linux-android/Dockerfile":"ace2e7d33c87bc0f6d3962a4a3408c04557646f7f51ab99cfbf574906796b016","ci/docker/aarch64-unknown-linux-gnu/Dockerfile":"da88c0d50f16dc08448c7fdf1fa5ed2cbe576acf9e7dd85b5b818621b2a8c702","ci/docker/arm-linux-androideabi/Dockerfile":"370e55d3330a413a3ccf677b3afb3e0ef9018a5fab263faa97ae8ac017fc2286","ci/docker/arm-unknown-linux-gnueabi/Dockerfile":"bb5f8ae890707c128652290ffc544447643bf12037ddd73c6ad6989f848cb380","ci/docker/arm-unknown-linux-gnueabihf/Dockerfile":"1afaefcbc05b740859acd4e067bc92439be6bcbe8f2e9678474fb434bcd398d9","ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile":"8282ea707a94109beed47a57574755e2d58401735904a03f85fb64c578c53b4f","ci/docker/i586-unknown-linux-gnu/Dockerfile":"49792922269f371bd29da4727e9085101b27be67a6b97755d0196c63317f7abb","ci/docker/i686-unknown-linux-gnu/Dockerfile":"49792922269f371bd29da4727e9085101b27be67a6b97755d0196c63317f7abb","ci/docker/mips-unknown-linux-gnu/Dockerfile":"b2ebc25797612c4f8395fe9d407725156044955bfbcf442036b7f55b43a5f9da","ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile":"b0c1692ac65bc56dd30494b1993d8e929c48cc9c4b92029b7c7592af6d4f9220","ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile":"4e9249c179300138141d0b2b7401b11897f64aed69f541f078c1db4594df2827","ci/docker/mipsel-unknown-linux-musl/Dockerfile":"3164c52b0dcbb01afa78292b15b5c43503ccf0491cf6eb801ec2bf22ae274e52","ci/docker/powerpc-unknown-linux-gnu/Dockerfile":"786f799d0b56eb54d7b6c4b00e1aed4ce81776e14e44767e083c89d014b72004","ci/docker/powerpc64-unknown-linux-gnu/Dockerfile":"e8bc363837cd9c2d8b22402acb8c1c329efc11ba5d12170603d2fe2eae9da059","ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile":"47998d45b781d797b9e6085ebe898d90de0c952b54537a8db4e8d7503eb032d9","ci/docker/s390x-unknown-linux-gnu/Dockerfile":"93fb44df3d7fd31ead158570667c97b5076a05c3d968af4a84bc13819a8f2db8","ci/docker/sparc64-unknown-linux-gnu/Dockerfile":"da1c39a3ff1fe22e41395fa7c8934e90b4c1788e551b9aec6e38bfd94effc437","ci/docker/thumbv7neon-linux-androideabi/Dockerfile":"c2decd5591bd7a09378901bef629cd944acf052eb55e4f35b79eb9cb4d62246a","ci/docker/thumbv7neon-unknown-linux-gnueabihf/Dockerfile":"51955a8bf3c4d440f47382af6f5426ebff94ab01a04da36175babda9a057740f","ci/docker/wasm32-unknown-unknown/Dockerfile":"3e5f294bc1e004aa599086c2af49d6f3e7459fa250f5fbdd60cf67d53db78758","ci/docker/x86_64-linux-android/Dockerfile":"685040273cf350d5509e580ac451555efa19790c8723ca2af066adadc6880ad2","ci/docker/x86_64-unknown-linux-gnu-emulated/Dockerfile":"44b6203d9290bfdc53d81219f0937e1110847a23dd982ec8c4de388354f01536","ci/docker/x86_64-unknown-linux-gnu/Dockerfile":"7f4e3ca5fa288ea70edb4d1f75309708cd30b192e2e4444e61c4d5b3b58f89cf","ci/dox.sh":"434e9611c52e389312d2b03564adf09429f10cc76fe66a8644adb104903b87b7","ci/linux-s390x.sh":"d6b732d7795b4ba131326aff893bca6228a7d2eb0e9402f135705413dbbe0dce","ci/linux-sparc64.sh":"c92966838b1ab
\ No newline at end of file
diff --git a/third_party/rust/packed_simd/Cargo.toml b/third_party/rust/packed_simd/Cargo.toml
index 08b11881d413..1e52297b7ec8 100644
--- a/third_party/rust/packed_simd/Cargo.toml
+++ b/third_party/rust/packed_simd/Cargo.toml
@@ -29,13 +29,13 @@ default = []
into_bits = []
libcore_neon = []
+[build-dependencies]
+rustc_version = "0.2"
+
[dev-dependencies]
paste = "^0.1.3"
arrayvec = { version = "^0.5", default-features = false }
-[build-dependencies]
-rustc_version = "0.2"
-
[target.'cfg(target_arch = "x86_64")'.dependencies.sleef-sys]
version = "0.1.2"
optional = true
diff --git a/third_party/rust/packed_simd/build.rs b/third_party/rust/packed_simd/build.rs
index 4a1b33620085..571139204e8f 100644
--- a/third_party/rust/packed_simd/build.rs
+++ b/third_party/rust/packed_simd/build.rs
@@ -1,14 +1,34 @@
-use rustc_version::{version, Version};
+use rustc_version::{version_meta, Channel, Version};
fn main() {
println!("cargo:rustc-env=RUSTC_BOOTSTRAP=1");
let target = std::env::var("TARGET")
.expect("TARGET environment variable not defined");
if target.contains("neon") {
println!("cargo:rustc-cfg=libcore_neon");
}
- let ver = version().unwrap();
- if ver >= Version::parse("1.54.0-alpha").unwrap() {
- println!("cargo:rustc-cfg=use_const_generics");
+ let ver_meta = version_meta().unwrap();
+ let old_const_generics =
+ if ver_meta.semver < Version::parse("1.56.0-alpha").unwrap() {
+ true
+ } else if ver_meta.semver >= Version::parse("1.57.0-alpha").unwrap() {
+ false
+ } else {
+ match ver_meta.channel {
+ Channel::Stable | Channel::Beta => false,
+ Channel::Nightly | Channel::Dev
+ if ver_meta
+ .commit_date
+ .as_deref()
+ .map(|d| d < "2021-08-31")
+ .unwrap_or(false) =>
+ {
+ true
+ }
+ _ => false,
+ }
+ };
+ if old_const_generics {
+ println!("cargo:rustc-cfg=const_generics");
}
}
diff --git a/third_party/rust/packed_simd/src/api/shuffle.rs b/third_party/rust/packed_simd/src/api/shuffle.rs
index e8de49923c58..3fe1ad5f2701 100644
--- a/third_party/rust/packed_simd/src/api/shuffle.rs
+++ b/third_party/rust/packed_simd/src/api/shuffle.rs
@@ -74,7 +74,6 @@
/// // At most 2 * the number of lanes in the input vector.
/// # }
/// ```
-#[cfg(use_const_generics)]
#[macro_export]
macro_rules! shuffle {
($vec0:expr, $vec1:expr, [$l0:expr, $l1:expr]) => {{
@@ -187,118 +186,3 @@ macro_rules! shuffle {
}
};
}
-#[cfg(not(use_const_generics))]
-#[macro_export]
-macro_rules! shuffle {
- ($vec0:expr, $vec1:expr, [$l0:expr, $l1:expr]) => {{
- #[allow(unused_unsafe)]
- unsafe {
- $crate::Simd($crate::__shuffle_vector2(
- $vec0.0,
- $vec1.0,
- [$l0, $l1],
- ))
- }
- }};
- ($vec0:expr, $vec1:expr, [$l0:expr, $l1:expr, $l2:expr, $l3:expr]) => {{
- #[allow(unused_unsafe)]
- unsafe {
- $crate::Simd($crate::__shuffle_vector4(
- $vec0.0,
- $vec1.0,
- [$l0, $l1, $l2, $l3],
- ))
- }
- }};
- ($vec0:expr, $vec1:expr,
- [$l0:expr, $l1:expr, $l2:expr, $l3:expr,
- $l4:expr, $l5:expr, $l6:expr, $l7:expr]) => {{
- #[allow(unused_unsafe)]
- unsafe {
- $crate::Simd($crate::__shuffle_vector8(
- $vec0.0,
- $vec1.0,
- [$l0, $l1, $l2, $l3, $l4, $l5, $l6, $l7],
- ))
- }
- }};
- ($vec0:expr, $vec1:expr,
- [$l0:expr, $l1:expr, $l2:expr, $l3:expr,
- $l4:expr, $l5:expr, $l6:expr, $l7:expr,
- $l8:expr, $l9:expr, $l10:expr, $l11:expr,
- $l12:expr, $l13:expr, $l14:expr, $l15:expr]) => {{
- #[allow(unused_unsafe)]
- unsafe {
- $crate::Simd($crate::__shuffle_vector16(
- $vec0.0,
- $vec1.0,
- [
- $l0, $l1, $l2, $l3, $l4, $l5, $l6, $l7, $l8, $l9, $l10,
- $l11, $l12, $l13, $l14, $l15,
- ],
- ))
- }
- }};
- ($vec0:expr, $vec1:expr,
- [$l0:expr, $l1:expr, $l2:expr, $l3:expr,
- $l4:expr, $l5:expr, $l6:expr, $l7:expr,
- $l8:expr, $l9:expr, $l10:expr, $l11:expr,
- $l12:expr, $l13:expr, $l14:expr, $l15:expr,
- $l16:expr, $l17:expr, $l18:expr, $l19:expr,
- $l20:expr, $l21:expr, $l22:expr, $l23:expr,
- $l24:expr, $l25:expr, $l26:expr, $l27:expr,
- $l28:expr, $l29:expr, $l30:expr, $l31:expr]) => {{
- #[allow(unused_unsafe)]
- unsafe {
- $crate::Simd($crate::__shuffle_vector32(
- $vec0.0,
- $vec1.0,
- [
- $l0, $l1, $l2, $l3, $l4, $l5, $l6, $l7, $l8, $l9, $l10,
- $l11, $l12, $l13, $l14, $l15, $l16, $l17, $l18, $l19,
- $l20, $l21, $l22, $l23, $l24, $l25, $l26, $l27, $l28,
- $l29, $l30, $l31,
- ],
- ))
- }
- }};
- ($vec0:expr, $vec1:expr,
- [$l0:expr, $l1:expr, $l2:expr, $l3:expr,
- $l4:expr, $l5:expr, $l6:expr, $l7:expr,
- $l8:expr, $l9:expr, $l10:expr, $l11:expr,
- $l12:expr, $l13:expr, $l14:expr, $l15:expr,
- $l16:expr, $l17:expr, $l18:expr, $l19:expr,
- $l20:expr, $l21:expr, $l22:expr, $l23:expr,
- $l24:expr, $l25:expr, $l26:expr, $l27:expr,
- $l28:expr, $l29:expr, $l30:expr, $l31:expr,
- $l32:expr, $l33:expr, $l34:expr, $l35:expr,
- $l36:expr, $l37:expr, $l38:expr, $l39:expr,
- $l40:expr, $l41:expr, $l42:expr, $l43:expr,
- $l44:expr, $l45:expr, $l46:expr, $l47:expr,
- $l48:expr, $l49:expr, $l50:expr, $l51:expr,
- $l52:expr, $l53:expr, $l54:expr, $l55:expr,
- $l56:expr, $l57:expr, $l58:expr, $l59:expr,
- $l60:expr, $l61:expr, $l62:expr, $l63:expr]) => {{
- #[allow(unused_unsafe)]
- unsafe {
- $crate::Simd($crate::__shuffle_vector64(
- $vec0.0,
- $vec1.0,
- [
- $l0, $l1, $l2, $l3, $l4, $l5, $l6, $l7, $l8, $l9, $l10,
- $l11, $l12, $l13, $l14, $l15, $l16, $l17, $l18, $l19,
- $l20, $l21, $l22, $l23, $l24, $l25, $l26, $l27, $l28,
- $l29, $l30, $l31, $l32, $l33, $l34, $l35, $l36, $l37,
- $l38, $l39, $l40, $l41, $l42, $l43, $l44, $l45, $l46,
- $l47, $l48, $l49, $l50, $l51, $l52, $l53, $l54, $l55,
- $l56, $l57, $l58, $l59, $l60, $l61, $l62, $l63,
- ],
- ))
- }
- }};
- ($vec:expr, [$($l:expr),*]) => {
- match $vec {
- v => shuffle!(v, v, [$($l),*])
- }
- };
-}
diff --git a/third_party/rust/packed_simd/src/codegen/llvm.rs b/third_party/rust/packed_simd/src/codegen/llvm.rs
index 141cf0d2bc01..52b11a95b917 100644
--- a/third_party/rust/packed_simd/src/codegen/llvm.rs
+++ b/third_party/rust/packed_simd/src/codegen/llvm.rs
@@ -6,137 +6,75 @@ use crate::sealed::Shuffle;
use crate::sealed::Simd;
// Shuffle intrinsics: expanded in users' crates, therefore public.
-#[cfg(use_const_generics)]
extern "platform-intrinsic" {
pub fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
pub fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
pub fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
pub fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U;
pub fn simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U;
pub fn simd_shuffle64<T, U>(x: T, y: T, idx: [u32; 64]) -> U;
}
-#[cfg(use_const_generics)]
#[allow(clippy::missing_safety_doc)]
#[inline]
pub unsafe fn __shuffle_vector2<const IDX: [u32; 2], T, U>(x: T, y: T) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 2], Output = U>,
{
simd_shuffle2(x, y, IDX)
}
-#[cfg(use_const_generics)]
#[allow(clippy::missing_safety_doc)]
#[inline]
pub unsafe fn __shuffle_vector4<const IDX: [u32; 4], T, U>(x: T, y: T) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 4], Output = U>,
{
simd_shuffle4(x, y, IDX)
}
-#[cfg(use_const_generics)]
#[allow(clippy::missing_safety_doc)]
#[inline]
pub unsafe fn __shuffle_vector8<const IDX: [u32; 8], T, U>(x: T, y: T) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 8], Output = U>,
{
simd_shuffle8(x, y, IDX)
}
-#[cfg(use_const_generics)]
#[allow(clippy::missing_safety_doc)]
#[inline]
pub unsafe fn __shuffle_vector16<const IDX: [u32; 16], T, U>(x: T, y: T) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 16], Output = U>,
{
simd_shuffle16(x, y, IDX)
}
-#[cfg(use_const_generics)]
#[allow(clippy::missing_safety_doc)]
#[inline]
pub unsafe fn __shuffle_vector32<const IDX: [u32; 32], T, U>(x: T, y: T) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 32], Output = U>,
{
simd_shuffle32(x, y, IDX)
}
-#[cfg(use_const_generics)]
#[allow(clippy::missing_safety_doc)]
#[inline]
pub unsafe fn __shuffle_vector64<const IDX: [u32; 64], T, U>(x: T, y: T) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 64], Output = U>,
{
simd_shuffle64(x, y, IDX)
}
-#[cfg(not(use_const_generics))]
-extern "platform-intrinsic" {
- // FIXME: Passing this intrinsics an `idx` array with an index that is
- // out-of-bounds will produce a monomorphization-time error.
- // https://github.com/rust-lang-nursery/packed_simd/issues/21
- #[rustc_args_required_const(2)]
- pub fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U
- where
- T: Simd,
- <T as Simd>::Element: Shuffle<[u32; 2], Output = U>;
-
- #[rustc_args_required_const(2)]
- pub fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U
- where
- T: Simd,
- <T as Simd>::Element: Shuffle<[u32; 4], Output = U>;
-
- #[rustc_args_required_const(2)]
- pub fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U
- where
- T: Simd,
- <T as Simd>::Element: Shuffle<[u32; 8], Output = U>;
-
- #[rustc_args_required_const(2)]
- pub fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U
- where
- T: Simd,
- <T as Simd>::Element: Shuffle<[u32; 16], Output = U>;
-
- #[rustc_args_required_const(2)]
- pub fn simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U
- where
- T: Simd,
- <T as Simd>::Element: Shuffle<[u32; 32], Output = U>;
-
- #[rustc_args_required_const(2)]
- pub fn simd_shuffle64<T, U>(x: T, y: T, idx: [u32; 64]) -> U
- where
- T: Simd,
- <T as Simd>::Element: Shuffle<[u32; 64], Output = U>;
-}
-
-#[cfg(not(use_const_generics))]
-pub use self::simd_shuffle16 as __shuffle_vector16;
-#[cfg(not(use_const_generics))]
-pub use self::simd_shuffle2 as __shuffle_vector2;
-#[cfg(not(use_const_generics))]
-pub use self::simd_shuffle32 as __shuffle_vector32;
-#[cfg(not(use_const_generics))]
-pub use self::simd_shuffle4 as __shuffle_vector4;
-#[cfg(not(use_const_generics))]
-pub use self::simd_shuffle64 as __shuffle_vector64;
-#[cfg(not(use_const_generics))]
-pub use self::simd_shuffle8 as __shuffle_vector8;
-
extern "platform-intrinsic" {
crate fn simd_eq<T, U>(x: T, y: T) -> U;
crate fn simd_ne<T, U>(x: T, y: T) -> U;
diff --git a/third_party/rust/packed_simd/src/lib.rs b/third_party/rust/packed_simd/src/lib.rs
index dd6b8a1e8e38..e3a747025f43 100644
--- a/third_party/rust/packed_simd/src/lib.rs
+++ b/third_party/rust/packed_simd/src/lib.rs
@@ -199,35 +199,37 @@
//! Numeric casts are not very "precise": sometimes lossy, sometimes value
//! preserving, etc.
-#![cfg_attr(use_const_generics, feature(const_generics))]
-#![cfg_attr(use_const_generics, allow(incomplete_features, clippy::from_over_into))]
+#![cfg_attr(const_generics, feature(const_generics))]
+#![cfg_attr(not(const_generics), feature(adt_const_params))]
#![feature(
repr_simd,
rustc_attrs,
platform_intrinsics,
stdsimd,
aarch64_target_feature,
arm_target_feature,
link_llvm_intrinsics,
core_intrinsics,
stmt_expr_attributes,
crate_visibility_modifier,
custom_inner_attributes
)]
#![allow(non_camel_case_types, non_snake_case,
// FIXME: these types are unsound in C FFI already
// See https://github.com/rust-lang/rust/issues/53346
improper_ctypes_definitions,
+ incomplete_features,
clippy::cast_possible_truncation,
clippy::cast_lossless,
clippy::cast_possible_wrap,
clippy::cast_precision_loss,
// TODO: manually add the `#[must_use]` attribute where appropriate
clippy::must_use_candidate,
// This lint is currently broken for generic code
// See https://github.com/rust-lang/rust-clippy/issues/3410
clippy::use_self,
clippy::wrong_self_convention,
+ clippy::from_over_into,
)]
#![cfg_attr(test, feature(hashmap_internals))]
#![deny(rust_2018_idioms, clippy::missing_inline_in_public_items)]