Format all ui tests from PR 2558 using rustfmt

This commit is contained in:
David Tolnay
2024-10-21 19:43:27 -07:00
parent 991e344804
commit d4486be2b9
8 changed files with 52 additions and 64 deletions
@@ -6,10 +6,7 @@ use serde_derive::Deserialize;
enum Enum {
// Newtype variants does not use the provided path, so it is forbidden here
// Newtype(#[serde(default = "main")] u8),
Tuple(
u8,
#[serde(default = "main")] i8,
),
Tuple(u8, #[serde(default = "main")] i8),
Struct {
#[serde(default = "main")]
f1: u8,
@@ -1,17 +1,17 @@
error[E0308]: `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:11:27
|
4 | #[derive(Deserialize)]
| -----------
| |
| this is found to be of type `i8`
| `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:9:33
|
4 | #[derive(Deserialize)]
| -----------
| |
| this is found to be of type `i8`
| `match` arms have incompatible types
...
11 | #[serde(default = "main")] i8,
| ^^^^^^ expected `i8`, found `()`
9 | Tuple(u8, #[serde(default = "main")] i8),
| ^^^^^^ expected `i8`, found `()`
error[E0308]: `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:14:27
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:11:27
|
4 | #[derive(Deserialize)]
| -----------
@@ -19,11 +19,11 @@ error[E0308]: `match` arms have incompatible types
| this is found to be of type `u8`
| `match` arms have incompatible types
...
14 | #[serde(default = "main")]
11 | #[serde(default = "main")]
| ^^^^^^ expected `u8`, found `()`
error[E0308]: `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:17:27
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:14:27
|
4 | #[derive(Deserialize)]
| -----------
@@ -31,5 +31,5 @@ error[E0308]: `match` arms have incompatible types
| this is found to be of type `i8`
| `match` arms have incompatible types
...
17 | #[serde(default = "main")]
14 | #[serde(default = "main")]
| ^^^^^^ expected `i8`, found `()`
@@ -5,10 +5,7 @@ use serde_derive::Deserialize;
enum Enum {
// Newtype variants does not use the provided path, so it is forbidden here
// Newtype(#[serde(default = "main")] u8),
Tuple(
u8,
#[serde(default = "main")] i8,
),
Tuple(u8, #[serde(default = "main")] i8),
Struct {
#[serde(default = "main")]
f1: u8,
@@ -1,17 +1,17 @@
error[E0308]: `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:10:27
|
4 | #[derive(Deserialize)]
| -----------
| |
| this is found to be of type `i8`
| `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:8:33
|
4 | #[derive(Deserialize)]
| -----------
| |
| this is found to be of type `i8`
| `match` arms have incompatible types
...
10 | #[serde(default = "main")] i8,
| ^^^^^^ expected `i8`, found `()`
8 | Tuple(u8, #[serde(default = "main")] i8),
| ^^^^^^ expected `i8`, found `()`
error[E0308]: `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:13:27
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:10:27
|
4 | #[derive(Deserialize)]
| -----------
@@ -19,11 +19,11 @@ error[E0308]: `match` arms have incompatible types
| this is found to be of type `u8`
| `match` arms have incompatible types
...
13 | #[serde(default = "main")]
10 | #[serde(default = "main")]
| ^^^^^^ expected `u8`, found `()`
error[E0308]: `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:16:27
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:13:27
|
4 | #[derive(Deserialize)]
| -----------
@@ -31,5 +31,5 @@ error[E0308]: `match` arms have incompatible types
| this is found to be of type `i8`
| `match` arms have incompatible types
...
16 | #[serde(default = "main")]
13 | #[serde(default = "main")]
| ^^^^^^ expected `i8`, found `()`
@@ -6,10 +6,7 @@ use serde_derive::Deserialize;
enum Enum {
// Newtype variants does not use the provided path, so it is forbidden here
// Newtype(#[serde(default = "main")] u8),
Tuple(
u8,
#[serde(default = "main")] i8,
),
Tuple(u8, #[serde(default = "main")] i8),
Struct {
#[serde(default = "main")]
f1: u8,
@@ -1,17 +1,17 @@
error[E0308]: `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:11:27
|
4 | #[derive(Deserialize)]
| -----------
| |
| this is found to be of type `i8`
| `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:9:33
|
4 | #[derive(Deserialize)]
| -----------
| |
| this is found to be of type `i8`
| `match` arms have incompatible types
...
11 | #[serde(default = "main")] i8,
| ^^^^^^ expected `i8`, found `()`
9 | Tuple(u8, #[serde(default = "main")] i8),
| ^^^^^^ expected `i8`, found `()`
error[E0308]: `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:14:27
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:11:27
|
4 | #[derive(Deserialize)]
| -----------
@@ -19,11 +19,11 @@ error[E0308]: `match` arms have incompatible types
| this is found to be of type `u8`
| `match` arms have incompatible types
...
14 | #[serde(default = "main")]
11 | #[serde(default = "main")]
| ^^^^^^ expected `u8`, found `()`
error[E0308]: `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:17:27
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:14:27
|
4 | #[derive(Deserialize)]
| -----------
@@ -31,5 +31,5 @@ error[E0308]: `match` arms have incompatible types
| this is found to be of type `i8`
| `match` arms have incompatible types
...
17 | #[serde(default = "main")]
14 | #[serde(default = "main")]
| ^^^^^^ expected `i8`, found `()`
@@ -3,9 +3,6 @@ use serde_derive::Deserialize;
#[derive(Deserialize)]
#[serde(default = "main")]
struct Tuple(
u8,
#[serde(default = "main")] i8,
);
struct Tuple(u8, #[serde(default = "main")] i8);
fn main() {}
@@ -8,30 +8,30 @@ error[E0308]: mismatched types
| expected due to this
error[E0308]: `match` arms have incompatible types
--> tests/ui/default-attribute/incorrect_type_tuple.rs:8:23
--> tests/ui/default-attribute/incorrect_type_tuple.rs:6:36
|
4 | #[derive(Deserialize)]
| -----------
| |
| this is found to be of type `i8`
| `match` arms have incompatible types
...
8 | #[serde(default = "main")] i8,
| ^^^^^^ expected `i8`, found `()`
5 | #[serde(default = "main")]
6 | struct Tuple(u8, #[serde(default = "main")] i8);
| ^^^^^^ expected `i8`, found `()`
error[E0308]: mismatched types
--> tests/ui/default-attribute/incorrect_type_tuple.rs:5:19
|
5 | #[serde(default = "main")]
| ^^^^^^ expected `Tuple`, found `()`
6 | struct Tuple(
6 | struct Tuple(u8, #[serde(default = "main")] i8);
| ----- expected due to this
error[E0308]: mismatched types
--> tests/ui/default-attribute/incorrect_type_tuple.rs:8:23
--> tests/ui/default-attribute/incorrect_type_tuple.rs:6:36
|
4 | #[derive(Deserialize)]
| ----------- expected due to the type of this binding
...
8 | #[serde(default = "main")] i8,
| ^^^^^^ expected `i8`, found `()`
5 | #[serde(default = "main")]
6 | struct Tuple(u8, #[serde(default = "main")] i8);
| ^^^^^^ expected `i8`, found `()`