about summary refs log tree commit diff
path: root/library/stdarch/crates/intrinsic-test/src/common/argument.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-22 15:25:31 +0000
committerbors <bors@rust-lang.org>2025-07-22 15:25:31 +0000
commit2e5367566819ca7878baa9600ae7a93eb0e37bbf (patch)
tree6b65029625eb4b6e726b826197e617728788430e /library/stdarch/crates/intrinsic-test/src/common/argument.rs
parent35487a2e7c80012129c38f55c970109a1538c91f (diff)
parent9b7d31c851cabc2e6e541d3cf146787d597a9166 (diff)
downloadrust-2e5367566819ca7878baa9600ae7a93eb0e37bbf.tar.gz
rust-2e5367566819ca7878baa9600ae7a93eb0e37bbf.zip
Auto merge of #144222 - Kobzol:stdarch-push, r=folkertdev
stdarch subtree update

Subtree update of `stdarch` to https://github.com/rust-lang/stdarch/commit/5531955678494ee28ec02130a6d94082ad4532da.

Created using https://github.com/rust-lang/josh-sync.

I saw that there were non-trivial changes made to `std_detect` in `stdarch` recently. So I want to get them merged here before we move forward with https://github.com/rust-lang/rust/pull/143412.

r? `@folkertdev`
Diffstat (limited to 'library/stdarch/crates/intrinsic-test/src/common/argument.rs')
-rw-r--r--library/stdarch/crates/intrinsic-test/src/common/argument.rs32
1 files changed, 18 insertions, 14 deletions
diff --git a/library/stdarch/crates/intrinsic-test/src/common/argument.rs b/library/stdarch/crates/intrinsic-test/src/common/argument.rs
index 443ccb919f4..1df4f55995e 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,
         }
     }
@@ -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::<Vec<_>>()
-            .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