Skip to content

Commit

Permalink
Format all ui tests from PR 2558 using rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 22, 2024
1 parent 991e344 commit d4486be
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
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)]
| -----------
| |
| 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)]
| -----------
| |
| this is found to be of type `i8`
| `match` arms have incompatible types
...
17 | #[serde(default = "main")]
14 | #[serde(default = "main")]
| ^^^^^^ expected `i8`, found `()`
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
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)]
| -----------
| |
| 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)]
| -----------
| |
| this is found to be of type `i8`
| `match` arms have incompatible types
...
16 | #[serde(default = "main")]
13 | #[serde(default = "main")]
| ^^^^^^ expected `i8`, found `()`
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
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)]
| -----------
| |
| 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)]
| -----------
| |
| this is found to be of type `i8`
| `match` arms have incompatible types
...
17 | #[serde(default = "main")]
14 | #[serde(default = "main")]
| ^^^^^^ expected `i8`, found `()`
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Original file line number Diff line number Diff line change
Expand Up @@ -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 `()`

0 comments on commit d4486be

Please sign in to comment.