From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/run-make-fulldeps/emit/test-26235.rs | 46 --------------------------- 1 file changed, 46 deletions(-) delete mode 100644 src/test/run-make-fulldeps/emit/test-26235.rs (limited to 'src/test/run-make-fulldeps/emit/test-26235.rs') diff --git a/src/test/run-make-fulldeps/emit/test-26235.rs b/src/test/run-make-fulldeps/emit/test-26235.rs deleted file mode 100644 index 07d975f33..000000000 --- a/src/test/run-make-fulldeps/emit/test-26235.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Checks for issue #26235 - -fn main() { - use std::thread; - - type Key = u32; - const NUM_THREADS: usize = 2; - - #[derive(Clone,Copy)] - struct Stats { - upsert: S, - delete: S, - insert: S, - update: S - }; - - impl Stats where S: Copy { - fn dot(self, s: Stats, f: F) -> Stats where F: Fn(S, T) -> B { - let Stats { upsert: u1, delete: d1, insert: i1, update: p1 } = self; - let Stats { upsert: u2, delete: d2, insert: i2, update: p2 } = s; - Stats { upsert: f(u1, u2), delete: f(d1, d2), insert: f(i1, i2), update: f(p1, p2) } - } - - fn new(init: S) -> Self { - Stats { upsert: init, delete: init, insert: init, update: init } - } - } - - fn make_threads() -> Vec> { - let mut t = Vec::with_capacity(NUM_THREADS); - for _ in 0..NUM_THREADS { - t.push(thread::spawn(move || {})); - } - t - } - - let stats = [Stats::new(0); NUM_THREADS]; - make_threads(); - - { - let Stats { ref upsert, ref delete, ref insert, ref update } = stats.iter().fold( - Stats::new(0), |res, &s| res.dot(s, |x: Key, y: Key| x.wrapping_add(y))); - println!("upserts: {}, deletes: {}, inserts: {}, updates: {}", - upsert, delete, insert, update); - } -} -- cgit v1.2.3