From d4486be2b9f7050d5007887f9e0cdc03759b3e77 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 21 Oct 2024 19:43:27 -0700 Subject: [PATCH] Format all ui tests from PR 2558 using rustfmt --- .../incorrect_type_enum_adjacently_tagged.rs | 5 +--- ...correct_type_enum_adjacently_tagged.stderr | 26 +++++++++---------- .../incorrect_type_enum_externally_tagged.rs | 5 +--- ...correct_type_enum_externally_tagged.stderr | 26 +++++++++---------- .../incorrect_type_enum_untagged.rs | 5 +--- .../incorrect_type_enum_untagged.stderr | 26 +++++++++---------- .../default-attribute/incorrect_type_tuple.rs | 5 +--- .../incorrect_type_tuple.stderr | 18 ++++++------- 8 files changed, 52 insertions(+), 64 deletions(-) diff --git a/test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs b/test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs index 63a88fed..339af63d 100644 --- a/test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs +++ b/test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs @@ -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, diff --git a/test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.stderr b/test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.stderr index eefe5850..984f2425 100644 --- a/test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.stderr +++ b/test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.stderr @@ -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 `()` diff --git a/test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs b/test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs index ae6144d8..02dc6446 100644 --- a/test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs +++ b/test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs @@ -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, diff --git a/test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.stderr b/test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.stderr index dd6f8b0d..01672cfa 100644 --- a/test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.stderr +++ b/test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.stderr @@ -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 `()` diff --git a/test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.rs b/test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.rs index 8fa6c04e..530f4a9d 100644 --- a/test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.rs +++ b/test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.rs @@ -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, diff --git a/test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.stderr b/test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.stderr index 9ffa6bb4..d782fe30 100644 --- a/test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.stderr +++ b/test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.stderr @@ -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 `()` diff --git a/test_suite/tests/ui/default-attribute/incorrect_type_tuple.rs b/test_suite/tests/ui/default-attribute/incorrect_type_tuple.rs index b5f0c5c9..895ce652 100644 --- a/test_suite/tests/ui/default-attribute/incorrect_type_tuple.rs +++ b/test_suite/tests/ui/default-attribute/incorrect_type_tuple.rs @@ -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() {} diff --git a/test_suite/tests/ui/default-attribute/incorrect_type_tuple.stderr b/test_suite/tests/ui/default-attribute/incorrect_type_tuple.stderr index e473e6ff..a767c8c5 100644 --- a/test_suite/tests/ui/default-attribute/incorrect_type_tuple.stderr +++ b/test_suite/tests/ui/default-attribute/incorrect_type_tuple.stderr @@ -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 `()`