test reformatting: revert more questionable changes done by rustfmt and add #[rustfmt::skip]

This commit is contained in:
Matthias Krüger 2018-12-11 20:50:55 +01:00
parent 743e9e3561
commit 36266b3e6c
6 changed files with 39 additions and 39 deletions

View File

@ -9,9 +9,9 @@
#[warn(clippy::decimal_literal_representation)]
#[allow(unused_variables)]
#[rustfmt::skip]
fn main() {
let good = (
// Hex:
let good = ( // Hex:
127, // 0x7F
256, // 0x100
511, // 0x1FF
@ -21,8 +21,7 @@ fn main() {
61_683, // 0xF0F3
2_131_750_925, // 0x7F0F_F00D
);
let bad = (
// Hex:
let bad = ( // Hex:
32_773, // 0x8005
65_280, // 0xFF00
2_131_750_927, // 0x7F0F_F00F

View File

@ -1,33 +1,33 @@
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:26:9
--> $DIR/decimal_literal_representation.rs:25:9
|
26 | 32_773, // 0x8005
25 | 32_773, // 0x8005
| ^^^^^^ help: consider: `0x8005`
|
= note: `-D clippy::decimal-literal-representation` implied by `-D warnings`
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:26:9
|
26 | 65_280, // 0xFF00
| ^^^^^^ help: consider: `0xFF00`
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:27:9
|
27 | 65_280, // 0xFF00
| ^^^^^^ help: consider: `0xFF00`
27 | 2_131_750_927, // 0x7F0F_F00F
| ^^^^^^^^^^^^^ help: consider: `0x7F0F_F00F`
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:28:9
|
28 | 2_131_750_927, // 0x7F0F_F00F
| ^^^^^^^^^^^^^ help: consider: `0x7F0F_F00F`
28 | 2_147_483_647, // 0x7FFF_FFFF
| ^^^^^^^^^^^^^ help: consider: `0x7FFF_FFFF`
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:29:9
|
29 | 2_147_483_647, // 0x7FFF_FFFF
| ^^^^^^^^^^^^^ help: consider: `0x7FFF_FFFF`
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:30:9
|
30 | 4_042_322_160, // 0xF0F0_F0F0
29 | 4_042_322_160, // 0xF0F0_F0F0
| ^^^^^^^^^^^^^ help: consider: `0xF0F0_F0F0`
error: aborting due to 5 previous errors

View File

@ -85,8 +85,8 @@ fn make() -> (Self, Self) {
pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
};
}
gen!(impl );
#[rustfmt::skip]
gen!(impl);
gen!(fn bar);
// When the macro is in a different file, the suggestion spans can't be combined properly

View File

@ -96,8 +96,8 @@ error: impl for `HashMap` should be generalized over different hashers
77 | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
| ^^^^^^^^^^^^^
...
89 | gen!(impl );
| ------------ in this macro invocation
89 | gen!(impl);
| ----------- in this macro invocation
help: consider adding a type parameter
|
77 | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {

View File

@ -39,6 +39,7 @@ fn vec() {
foo.swap(0, 1);
}
#[rustfmt::skip]
fn main() {
array();
slice();
@ -50,7 +51,7 @@ fn main() {
a = b;
b = a;
; let t = a;
; let t = a;
a = b;
b = t;
@ -59,7 +60,7 @@ fn main() {
c.0 = a;
a = c.0;
; let t = c.0;
; let t = c.0;
c.0 = a;
a = t;
}

View File

@ -25,42 +25,42 @@ error: this looks like you are swapping elements of `foo` manually
| |_________________^ help: try: `foo.swap(0, 1)`
error: this looks like you are swapping `a` and `b` manually
--> $DIR/swap.rs:53:6
--> $DIR/swap.rs:54:7
|
53 | ; let t = a;
| ______^
54 | | a = b;
55 | | b = t;
54 | ; let t = a;
| _______^
55 | | a = b;
56 | | b = t;
| |_________^ help: try: `std::mem::swap(&mut a, &mut b)`
|
= note: or maybe you should use `std::mem::replace`?
error: this looks like you are swapping `c.0` and `a` manually
--> $DIR/swap.rs:62:6
--> $DIR/swap.rs:63:7
|
62 | ; let t = c.0;
| ______^
63 | | c.0 = a;
64 | | a = t;
63 | ; let t = c.0;
| _______^
64 | | c.0 = a;
65 | | a = t;
| |_________^ help: try: `std::mem::swap(&mut c.0, &mut a)`
|
= note: or maybe you should use `std::mem::replace`?
error: this looks like you are trying to swap `a` and `b`
--> $DIR/swap.rs:50:5
--> $DIR/swap.rs:51:5
|
50 | / a = b;
51 | | b = a;
51 | / a = b;
52 | | b = a;
| |_________^ help: try: `std::mem::swap(&mut a, &mut b)`
|
= note: `-D clippy::almost-swapped` implied by `-D warnings`
= note: or maybe you should use `std::mem::replace`?
error: this looks like you are trying to swap `c.0` and `a`
--> $DIR/swap.rs:59:5
--> $DIR/swap.rs:60:5
|
59 | / c.0 = a;
60 | | a = c.0;
60 | / c.0 = a;
61 | | a = c.0;
| |___________^ help: try: `std::mem::swap(&mut c.0, &mut a)`
|
= note: or maybe you should use `std::mem::replace`?