From b04bf8a51480c05fc9984476a78f07b927f2672f Mon Sep 17 00:00:00 2001 From: Vytautas Astrauskas Date: Mon, 6 Apr 2020 16:12:25 -0700 Subject: [PATCH] Rustfmt the test. --- tests/run-pass/concurrency/thread_locals.rs | 38 +++++++++------------ 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/tests/run-pass/concurrency/thread_locals.rs b/tests/run-pass/concurrency/thread_locals.rs index 1c268a4ff874..50aa6fee2f87 100644 --- a/tests/run-pass/concurrency/thread_locals.rs +++ b/tests/run-pass/concurrency/thread_locals.rs @@ -17,7 +17,6 @@ struct Sender(*mut u8); unsafe impl Send for Sender {} fn main() { - let ptr = unsafe { let x = get_a_ref(); *x = 5; @@ -26,24 +25,23 @@ fn main() { C = 25; Sender(&mut A) }; - - thread::spawn(move || { - unsafe { - assert_eq!(*ptr.0, 5); - assert_eq!(A, 0); - assert_eq!(B, 0); - assert_eq!(C, 25); - B = 14; - C = 24; - let y = get_a_ref(); - assert_eq!(*y, 0); - *y = 4; - assert_eq!(*ptr.0, 5); - assert_eq!(A, 4); - assert_eq!(*get_a_ref(), 4); - - } - }).join().unwrap(); + + thread::spawn(move || unsafe { + assert_eq!(*ptr.0, 5); + assert_eq!(A, 0); + assert_eq!(B, 0); + assert_eq!(C, 25); + B = 14; + C = 24; + let y = get_a_ref(); + assert_eq!(*y, 0); + *y = 4; + assert_eq!(*ptr.0, 5); + assert_eq!(A, 4); + assert_eq!(*get_a_ref(), 4); + }) + .join() + .unwrap(); unsafe { assert_eq!(*get_a_ref(), 5); @@ -51,6 +49,4 @@ fn main() { assert_eq!(B, 15); assert_eq!(C, 24); } - } -