diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /third_party/rust/packed_simd/src/api/fmt/debug.rs | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/packed_simd/src/api/fmt/debug.rs')
-rw-r--r-- | third_party/rust/packed_simd/src/api/fmt/debug.rs | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/third_party/rust/packed_simd/src/api/fmt/debug.rs b/third_party/rust/packed_simd/src/api/fmt/debug.rs deleted file mode 100644 index 1e209b3bff..0000000000 --- a/third_party/rust/packed_simd/src/api/fmt/debug.rs +++ /dev/null @@ -1,60 +0,0 @@ -//! Implement debug formatting - -macro_rules! impl_fmt_debug_tests { - ([$elem_ty:ty; $elem_count:expr]: $id:ident | $test_tt:tt) => { - test_if! { - $test_tt: - paste::item! { - pub mod [<$id _fmt_debug>] { - use super::*; - #[cfg_attr(not(target_arch = "wasm32"), test)] - #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] - fn debug() { - use arrayvec::{ArrayString,ArrayVec}; - type TinyString = ArrayString<[u8; 512]>; - - use crate::fmt::Write; - let v = $id::default(); - let mut s = TinyString::new(); - write!(&mut s, "{:?}", v).unwrap(); - - let mut beg = TinyString::new(); - write!(&mut beg, "{}(", stringify!($id)).unwrap(); - assert!(s.starts_with(beg.as_str())); - assert!(s.ends_with(")")); - let s: ArrayVec<[TinyString; 64]> - = s.replace(beg.as_str(), "") - .replace(")", "").split(",") - .map(|v| TinyString::from(v.trim()).unwrap()) - .collect(); - assert_eq!(s.len(), $id::lanes()); - for (index, ss) in s.into_iter().enumerate() { - let mut e = TinyString::new(); - write!(&mut e, "{:?}", v.extract(index)).unwrap(); - assert_eq!(ss, e); - } - } - } - } - } - }; -} - -macro_rules! impl_fmt_debug { - ([$elem_ty:ty; $elem_count:expr]: $id:ident | $test_tt:tt) => { - impl crate::fmt::Debug for $id { - #[allow(clippy::missing_inline_in_public_items)] - fn fmt(&self, f: &mut crate::fmt::Formatter<'_>) -> crate::fmt::Result { - write!(f, "{}(", stringify!($id))?; - for i in 0..$elem_count { - if i > 0 { - write!(f, ", ")?; - } - self.extract(i).fmt(f)?; - } - write!(f, ")") - } - } - impl_fmt_debug_tests!([$elem_ty; $elem_count]: $id | $test_tt); - }; -} |