Skip to content

Commit 945049c

Browse files
committed
Revert formatting changes to tests
Trying to reduce noise produced by rustfmt in PR due to autoformat. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
1 parent 545899b commit 945049c

31 files changed

+225
-269
lines changed

src/test/ui/abi/abi-sysv64-arg-passing.rs

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,31 @@
3434

3535
#[allow(dead_code)]
3636
#[allow(improper_ctypes)]
37+
3738
#[cfg(target_arch = "x86_64")]
3839
mod tests {
3940
#[repr(C)]
4041
#[derive(Copy, Clone, PartialEq, Debug)]
4142
pub struct TwoU8s {
42-
one: u8,
43-
two: u8,
43+
one: u8, two: u8
4444
}
4545

4646
#[repr(C)]
4747
#[derive(Copy, Clone, PartialEq, Debug)]
4848
pub struct TwoU16s {
49-
one: u16,
50-
two: u16,
49+
one: u16, two: u16
5150
}
5251

5352
#[repr(C)]
5453
#[derive(Copy, Clone, PartialEq, Debug)]
5554
pub struct TwoU32s {
56-
one: u32,
57-
two: u32,
55+
one: u32, two: u32
5856
}
5957

6058
#[repr(C)]
6159
#[derive(Copy, Clone, PartialEq, Debug)]
6260
pub struct TwoU64s {
63-
one: u64,
64-
two: u64,
61+
one: u64, two: u64
6562
}
6663

6764
#[repr(C)]
@@ -87,33 +84,19 @@ mod tests {
8784

8885
#[repr(C)]
8986
#[derive(Copy, Clone)]
90-
pub struct Quad {
91-
a: u64,
92-
b: u64,
93-
c: u64,
94-
d: u64,
95-
}
87+
pub struct Quad { a: u64, b: u64, c: u64, d: u64 }
9688

9789
#[derive(Copy, Clone)]
98-
pub struct QuadFloats {
99-
a: f32,
100-
b: f32,
101-
c: f32,
102-
d: f32,
103-
}
90+
pub struct QuadFloats { a: f32, b: f32, c: f32, d: f32 }
10491

10592
#[repr(C)]
10693
#[derive(Copy, Clone)]
107-
pub struct Floats {
108-
a: f64,
109-
b: u8,
110-
c: f64,
111-
}
94+
pub struct Floats { a: f64, b: u8, c: f64 }
11295

11396
#[repr(C, u8)]
11497
pub enum U8TaggedEnumOptionU64U64 {
11598
None,
116-
Some(u64, u64),
99+
Some(u64,u64),
117100
}
118101

119102
#[repr(C, u8)]
@@ -141,13 +124,8 @@ mod tests {
141124
pub fn get_x(x: S) -> u64;
142125
pub fn get_y(x: S) -> u64;
143126
pub fn get_z(x: S) -> u64;
144-
pub fn get_c_many_params(
145-
_: *const (),
146-
_: *const (),
147-
_: *const (),
148-
_: *const (),
149-
f: Quad,
150-
) -> u64;
127+
pub fn get_c_many_params(_: *const (), _: *const (),
128+
_: *const (), _: *const (), f: Quad) -> u64;
151129
pub fn get_c_exhaust_sysv64_ints(
152130
_: *const (),
153131
_: *const (),
@@ -173,7 +151,9 @@ mod tests {
173151
}
174152

175153
pub fn cabi_int_widening() {
176-
let x = unsafe { rust_int8_to_int32(-1) };
154+
let x = unsafe {
155+
rust_int8_to_int32(-1)
156+
};
177157

178158
assert!(x == -1);
179159
}
@@ -210,15 +190,15 @@ mod tests {
210190
arg3: 4,
211191
arg4: 5,
212192
arg5: 6,
213-
arg6: TwoU8s { one: 7, two: 8 },
193+
arg6: TwoU8s { one: 7, two: 8, }
214194
};
215195
let y = ManyInts {
216196
arg1: 1,
217197
arg2: 2,
218198
arg3: 3,
219199
arg4: 4,
220200
arg5: 5,
221-
arg6: TwoU8s { one: 6, two: 7 },
201+
arg6: TwoU8s { one: 6, two: 7, }
222202
};
223203
let empty = Empty;
224204
rust_dbg_extern_empty_struct(x, empty, y);
@@ -227,31 +207,31 @@ mod tests {
227207

228208
pub fn extern_pass_twou8s() {
229209
unsafe {
230-
let x = TwoU8s { one: 22, two: 23 };
210+
let x = TwoU8s {one: 22, two: 23};
231211
let y = rust_dbg_extern_identity_TwoU8s(x);
232212
assert_eq!(x, y);
233213
}
234214
}
235215

236216
pub fn extern_pass_twou16s() {
237217
unsafe {
238-
let x = TwoU16s { one: 22, two: 23 };
218+
let x = TwoU16s {one: 22, two: 23};
239219
let y = rust_dbg_extern_identity_TwoU16s(x);
240220
assert_eq!(x, y);
241221
}
242222
}
243223

244224
pub fn extern_pass_twou32s() {
245225
unsafe {
246-
let x = TwoU32s { one: 22, two: 23 };
226+
let x = TwoU32s {one: 22, two: 23};
247227
let y = rust_dbg_extern_identity_TwoU32s(x);
248228
assert_eq!(x, y);
249229
}
250230
}
251231

252232
pub fn extern_pass_twou64s() {
253233
unsafe {
254-
let x = TwoU64s { one: 22, two: 23 };
234+
let x = TwoU64s {one: 22, two: 23};
255235
let y = rust_dbg_extern_identity_TwoU64s(x);
256236
assert_eq!(x, y);
257237
}
@@ -291,7 +271,9 @@ mod tests {
291271

292272
#[inline(never)]
293273
fn indirect_call(func: unsafe extern "sysv64" fn(s: S) -> u64, s: S) -> u64 {
294-
unsafe { func(s) }
274+
unsafe {
275+
func(s)
276+
}
295277
}
296278

297279
pub fn foreign_fn_with_byval() {
@@ -305,7 +287,12 @@ mod tests {
305287
use std::ptr;
306288
unsafe {
307289
let null = ptr::null();
308-
let q = Quad { a: 1, b: 2, c: 3, d: 4 };
290+
let q = Quad {
291+
a: 1,
292+
b: 2,
293+
c: 3,
294+
d: 4
295+
};
309296
assert_eq!(get_c_many_params(null, null, null, null, q), q.c);
310297
}
311298
}
@@ -318,8 +305,16 @@ mod tests {
318305
use std::ptr;
319306
unsafe {
320307
let null = ptr::null();
321-
let q = QuadFloats { a: 10.2, b: 20.3, c: 30.4, d: 40.5 };
322-
assert_eq!(get_c_exhaust_sysv64_ints(null, null, null, null, null, null, null, q), q.c);
308+
let q = QuadFloats {
309+
a: 10.2,
310+
b: 20.3,
311+
c: 30.4,
312+
d: 40.5
313+
};
314+
assert_eq!(
315+
get_c_exhaust_sysv64_ints(null, null, null, null, null, null, null, q),
316+
q.c,
317+
);
323318
}
324319
}
325320

@@ -329,12 +324,10 @@ mod tests {
329324

330325
fn test1() {
331326
unsafe {
332-
let q = Quad {
333-
a: 0xaaaa_aaaa_aaaa_aaaa,
334-
b: 0xbbbb_bbbb_bbbb_bbbb,
335-
c: 0xcccc_cccc_cccc_cccc,
336-
d: 0xdddd_dddd_dddd_dddd,
337-
};
327+
let q = Quad { a: 0xaaaa_aaaa_aaaa_aaaa,
328+
b: 0xbbbb_bbbb_bbbb_bbbb,
329+
c: 0xcccc_cccc_cccc_cccc,
330+
d: 0xdddd_dddd_dddd_dddd };
338331
let qq = rust_dbg_abi_1(q);
339332
println!("a: {:x}", qq.a as usize);
340333
println!("b: {:x}", qq.b as usize);
@@ -349,7 +342,9 @@ mod tests {
349342

350343
fn test2() {
351344
unsafe {
352-
let f = Floats { a: 1.234567890e-15_f64, b: 0b_1010_1010, c: 1.0987654321e-15_f64 };
345+
let f = Floats { a: 1.234567890e-15_f64,
346+
b: 0b_1010_1010,
347+
c: 1.0987654321e-15_f64 };
353348
let ff = rust_dbg_abi_2(f);
354349
println!("a: {}", ff.a as f64);
355350
println!("b: {}", ff.b as usize);
@@ -375,7 +370,7 @@ mod tests {
375370
}
376371

377372
let none_u64u64 = unsafe { rust_dbg_new_none_u64u64() };
378-
if let U8TaggedEnumOptionU64U64::Some(_, _) = none_u64u64 {
373+
if let U8TaggedEnumOptionU64U64::Some(_,_) = none_u64u64 {
379374
panic!("unexpected some");
380375
}
381376

@@ -449,4 +444,6 @@ fn main() {
449444
}
450445

451446
#[cfg(not(target_arch = "x86_64"))]
452-
fn main() {}
447+
fn main() {
448+
449+
}

src/test/ui/abi/cabi-int-widening.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ extern "C" {
88
}
99

1010
fn main() {
11-
let x = unsafe { rust_int8_to_int32(-1) };
11+
let x = unsafe {
12+
rust_int8_to_int32(-1)
13+
};
1214

1315
assert!(x == -1);
1416
}

src/test/ui/abi/union/union-c-interop.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ struct LARGE_INTEGER_U {
1414
#[derive(Clone, Copy)]
1515
#[repr(C)]
1616
union LARGE_INTEGER {
17-
__unnamed__: LARGE_INTEGER_U,
18-
u: LARGE_INTEGER_U,
19-
QuadPart: u64,
17+
__unnamed__: LARGE_INTEGER_U,
18+
u: LARGE_INTEGER_U,
19+
QuadPart: u64,
2020
}
2121

2222
#[link(name = "rust_test_helpers", kind = "static")]

src/test/ui/abi/x86stdcall.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ pub fn main() {
2020
assert_eq!(expected, actual);
2121
}
2222
}
23-

src/test/ui/array-slice-vec/box-of-array-of-drop-1.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// ignore-emscripten no threads support
99
// ignore-uefi no threads support
1010

11-
use std::sync::atomic::{AtomicUsize, Ordering};
1211
use std::thread;
12+
use std::sync::atomic::{AtomicUsize, Ordering};
1313

1414
static LOG: AtomicUsize = AtomicUsize::new(0);
1515

@@ -23,19 +23,17 @@ impl Drop for D {
2323
old,
2424
old << 4 | self.0 as usize,
2525
Ordering::SeqCst,
26-
Ordering::SeqCst,
26+
Ordering::SeqCst
2727
);
2828
}
2929
}
3030

3131
fn main() {
32-
fn die() -> D {
33-
panic!("Oh no");
34-
}
32+
fn die() -> D { panic!("Oh no"); }
3533
let g = thread::spawn(|| {
36-
let _b1: Box<[D; 4]> = Box::new([D(1), D(2), D(3), D(4)]);
37-
let _b2: Box<[D; 4]> = Box::new([D(5), D(6), D(7), D(8)]);
38-
let _b3: Box<[D; 4]> = Box::new([D(9), D(10), die(), D(12)]);
34+
let _b1: Box<[D; 4]> = Box::new([D( 1), D( 2), D( 3), D( 4)]);
35+
let _b2: Box<[D; 4]> = Box::new([D( 5), D( 6), D( 7), D( 8)]);
36+
let _b3: Box<[D; 4]> = Box::new([D( 9), D(10), die(), D(12)]);
3937
let _b4: Box<[D; 4]> = Box::new([D(13), D(14), D(15), D(16)]);
4038
});
4139
assert!(g.join().is_err());

src/test/ui/array-slice-vec/box-of-array-of-drop-2.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// ignore-emscripten no threads support
99
// ignore-uefi no threads support
1010

11-
use std::sync::atomic::{AtomicUsize, Ordering};
1211
use std::thread;
12+
use std::sync::atomic::{AtomicUsize, Ordering};
1313

1414
static LOG: AtomicUsize = AtomicUsize::new(0);
1515

@@ -23,19 +23,17 @@ impl Drop for D {
2323
old,
2424
old << 4 | self.0 as usize,
2525
Ordering::SeqCst,
26-
Ordering::SeqCst,
26+
Ordering::SeqCst
2727
);
2828
}
2929
}
3030

3131
fn main() {
32-
fn die() -> D {
33-
panic!("Oh no");
34-
}
32+
fn die() -> D { panic!("Oh no"); }
3533
let g = thread::spawn(|| {
36-
let _b1: Box<[D; 4]> = Box::new([D(1), D(2), D(3), D(4)]);
37-
let _b2: Box<[D; 4]> = Box::new([D(5), D(6), D(7), D(8)]);
38-
let _b3: Box<[D; 4]> = Box::new([D(9), D(10), die(), D(12)]);
34+
let _b1: Box<[D; 4]> = Box::new([D( 1), D( 2), D( 3), D( 4)]);
35+
let _b2: Box<[D; 4]> = Box::new([D( 5), D( 6), D( 7), D( 8)]);
36+
let _b3: Box<[D; 4]> = Box::new([D( 9), D(10), die(), D(12)]);
3937
let _b4: Box<[D; 4]> = Box::new([D(13), D(14), D(15), D(16)]);
4038
});
4139
assert!(g.join().is_err());

src/test/ui/array-slice-vec/nested-vec-3.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// the contents implement Drop and we hit a panic in the middle of
1010
// construction.
1111

12-
use std::sync::atomic::{AtomicUsize, Ordering};
1312
use std::thread;
13+
use std::sync::atomic::{AtomicUsize, Ordering};
1414

1515
static LOG: AtomicUsize = AtomicUsize::new(0);
1616

@@ -30,16 +30,12 @@ impl Drop for D {
3030
}
3131

3232
fn main() {
33-
fn die() -> D {
34-
panic!("Oh no");
35-
}
33+
fn die() -> D { panic!("Oh no"); }
3634
let g = thread::spawn(|| {
37-
let _nested = vec![
38-
vec![D(1), D(2), D(3), D(4)],
39-
vec![D(5), D(6), D(7), D(8)],
40-
vec![D(9), D(10), die(), D(12)],
41-
vec![D(13), D(14), D(15), D(16)],
42-
];
35+
let _nested = vec![vec![D( 1), D( 2), D( 3), D( 4)],
36+
vec![D( 5), D( 6), D( 7), D( 8)],
37+
vec![D( 9), D(10), die(), D(12)],
38+
vec![D(13), D(14), D(15), D(16)]];
4339
});
4440
assert!(g.join().is_err());
4541

0 commit comments

Comments
 (0)