Skip to content

Commit 36266b3

Browse files
committed
test reformatting: revert more questionable changes done by rustfmt and add #[rustfmt::skip]
1 parent 743e9e3 commit 36266b3

6 files changed

+36
-36
lines changed

tests/ui/decimal_literal_representation.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
#[warn(clippy::decimal_literal_representation)]
1111
#[allow(unused_variables)]
12+
#[rustfmt::skip]
1213
fn main() {
13-
let good = (
14-
// Hex:
14+
let good = ( // Hex:
1515
127, // 0x7F
1616
256, // 0x100
1717
511, // 0x1FF
@@ -21,8 +21,7 @@ fn main() {
2121
61_683, // 0xF0F3
2222
2_131_750_925, // 0x7F0F_F00D
2323
);
24-
let bad = (
25-
// Hex:
24+
let bad = ( // Hex:
2625
32_773, // 0x8005
2726
65_280, // 0xFF00
2827
2_131_750_927, // 0x7F0F_F00F

tests/ui/decimal_literal_representation.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
error: integer literal has a better hexadecimal representation
2-
--> $DIR/decimal_literal_representation.rs:26:9
2+
--> $DIR/decimal_literal_representation.rs:25:9
33
|
4-
26 | 32_773, // 0x8005
4+
25 | 32_773, // 0x8005
55
| ^^^^^^ help: consider: `0x8005`
66
|
77
= note: `-D clippy::decimal-literal-representation` implied by `-D warnings`
88

99
error: integer literal has a better hexadecimal representation
10-
--> $DIR/decimal_literal_representation.rs:27:9
10+
--> $DIR/decimal_literal_representation.rs:26:9
1111
|
12-
27 | 65_280, // 0xFF00
12+
26 | 65_280, // 0xFF00
1313
| ^^^^^^ help: consider: `0xFF00`
1414

1515
error: integer literal has a better hexadecimal representation
16-
--> $DIR/decimal_literal_representation.rs:28:9
16+
--> $DIR/decimal_literal_representation.rs:27:9
1717
|
18-
28 | 2_131_750_927, // 0x7F0F_F00F
18+
27 | 2_131_750_927, // 0x7F0F_F00F
1919
| ^^^^^^^^^^^^^ help: consider: `0x7F0F_F00F`
2020

2121
error: integer literal has a better hexadecimal representation
22-
--> $DIR/decimal_literal_representation.rs:29:9
22+
--> $DIR/decimal_literal_representation.rs:28:9
2323
|
24-
29 | 2_147_483_647, // 0x7FFF_FFFF
24+
28 | 2_147_483_647, // 0x7FFF_FFFF
2525
| ^^^^^^^^^^^^^ help: consider: `0x7FFF_FFFF`
2626

2727
error: integer literal has a better hexadecimal representation
28-
--> $DIR/decimal_literal_representation.rs:30:9
28+
--> $DIR/decimal_literal_representation.rs:29:9
2929
|
30-
30 | 4_042_322_160, // 0xF0F0_F0F0
30+
29 | 4_042_322_160, // 0xF0F0_F0F0
3131
| ^^^^^^^^^^^^^ help: consider: `0xF0F0_F0F0`
3232

3333
error: aborting due to 5 previous errors

tests/ui/implicit_hasher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ macro_rules! gen {
8585
pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
8686
};
8787
}
88-
89-
gen!(impl );
88+
#[rustfmt::skip]
89+
gen!(impl);
9090
gen!(fn bar);
9191

9292
// When the macro is in a different file, the suggestion spans can't be combined properly

tests/ui/implicit_hasher.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ error: impl for `HashMap` should be generalized over different hashers
9696
77 | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
9797
| ^^^^^^^^^^^^^
9898
...
99-
89 | gen!(impl );
100-
| ------------ in this macro invocation
99+
89 | gen!(impl);
100+
| ----------- in this macro invocation
101101
help: consider adding a type parameter
102102
|
103103
77 | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {

tests/ui/swap.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ fn vec() {
3939
foo.swap(0, 1);
4040
}
4141

42+
#[rustfmt::skip]
4243
fn main() {
4344
array();
4445
slice();
@@ -50,7 +51,7 @@ fn main() {
5051
a = b;
5152
b = a;
5253

53-
; let t = a;
54+
; let t = a;
5455
a = b;
5556
b = t;
5657

@@ -59,7 +60,7 @@ fn main() {
5960
c.0 = a;
6061
a = c.0;
6162

62-
; let t = c.0;
63+
; let t = c.0;
6364
c.0 = a;
6465
a = t;
6566
}

tests/ui/swap.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,42 +25,42 @@ error: this looks like you are swapping elements of `foo` manually
2525
| |_________________^ help: try: `foo.swap(0, 1)`
2626

2727
error: this looks like you are swapping `a` and `b` manually
28-
--> $DIR/swap.rs:53:6
28+
--> $DIR/swap.rs:54:7
2929
|
30-
53 | ; let t = a;
31-
| ______^
32-
54 | | a = b;
33-
55 | | b = t;
30+
54 | ; let t = a;
31+
| _______^
32+
55 | | a = b;
33+
56 | | b = t;
3434
| |_________^ help: try: `std::mem::swap(&mut a, &mut b)`
3535
|
3636
= note: or maybe you should use `std::mem::replace`?
3737

3838
error: this looks like you are swapping `c.0` and `a` manually
39-
--> $DIR/swap.rs:62:6
39+
--> $DIR/swap.rs:63:7
4040
|
41-
62 | ; let t = c.0;
42-
| ______^
43-
63 | | c.0 = a;
44-
64 | | a = t;
41+
63 | ; let t = c.0;
42+
| _______^
43+
64 | | c.0 = a;
44+
65 | | a = t;
4545
| |_________^ help: try: `std::mem::swap(&mut c.0, &mut a)`
4646
|
4747
= note: or maybe you should use `std::mem::replace`?
4848

4949
error: this looks like you are trying to swap `a` and `b`
50-
--> $DIR/swap.rs:50:5
50+
--> $DIR/swap.rs:51:5
5151
|
52-
50 | / a = b;
53-
51 | | b = a;
52+
51 | / a = b;
53+
52 | | b = a;
5454
| |_________^ help: try: `std::mem::swap(&mut a, &mut b)`
5555
|
5656
= note: `-D clippy::almost-swapped` implied by `-D warnings`
5757
= note: or maybe you should use `std::mem::replace`?
5858

5959
error: this looks like you are trying to swap `c.0` and `a`
60-
--> $DIR/swap.rs:59:5
60+
--> $DIR/swap.rs:60:5
6161
|
62-
59 | / c.0 = a;
63-
60 | | a = c.0;
62+
60 | / c.0 = a;
63+
61 | | a = c.0;
6464
| |___________^ help: try: `std::mem::swap(&mut c.0, &mut a)`
6565
|
6666
= note: or maybe you should use `std::mem::replace`?

0 commit comments

Comments
 (0)