Skip to content
Myr

Fix wording in comments from PR 2558

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent d4486be · Browse files · 15 files+108 added−101 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

15 files+108 added−101 removed

  • tests:+107 added−100 removed
  • other:+1 added−1 removed

15 files+108 added−101 removed

modified:serde_derive/src/ser.rs+1 added-1 removed
1225 unmodified lines
1226 // ^^^^^1227 quote_spanned!(serialize_with.span()=> {1228 #[doc(hidden)]1229 struct __SerializeWith #wrapper_impl_generics #where_clause {1230 // If #field_tys is empty, `values` does not used1230 // If #field_tys is empty, this field is unused1231 #[allow(dead_code)]1232 values: (#(&'__a #field_tys, )*),1233 phantom: _serde::__private::PhantomData<#this_type #ty_generics>,1234 }
122 unmodified lines
modified:test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs+3 added-2 removed
1//! Ensures that error message points to the path in attribute1// Tests that type error points to the path in attribute23use serde_derive::Deserialize;45#[derive(Deserialize)]6#[serde(tag = "tag", content = "content")]7enum Enum {7 // Newtype variants does not use the provided path, so it is forbidden here8 // Newtype variants do not use the provided path, so it is forbidden here9 // Newtype(#[serde(default = "main")] u8),10 Tuple(u8, #[serde(default = "main")] i8),11 Struct {12 #[serde(default = "main")]
8 unmodified lines
modified:test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.stderr+15 added-15 removed
1error[E0308]: `match` arms have incompatible types2 --> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:9:333 |44 | #[derive(Deserialize)]5 | -----------6 | |7 | this is found to be of type `i8`8 | `match` arms have incompatible types2 --> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:10:333 |45 | #[derive(Deserialize)]5 | -----------6 | |7 | this is found to be of type `i8`8 | `match` arms have incompatible types9...109 | Tuple(u8, #[serde(default = "main")] i8),11 | ^^^^^^ expected `i8`, found `()`1010 | Tuple(u8, #[serde(default = "main")] i8),11 | ^^^^^^ expected `i8`, found `()`1213error[E0308]: `match` arms have incompatible types14 --> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:11:2714 --> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:12:2715 |164 | #[derive(Deserialize)]165 | #[derive(Deserialize)]17 | -----------18 | |19 | this is found to be of type `u8`20 | `match` arms have incompatible types21...2211 | #[serde(default = "main")]2212 | #[serde(default = "main")]23 | ^^^^^^ expected `u8`, found `()`2425error[E0308]: `match` arms have incompatible types26 --> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:14:2726 --> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:15:2727 |284 | #[derive(Deserialize)]285 | #[derive(Deserialize)]29 | -----------30 | |31 | this is found to be of type `i8`32 | `match` arms have incompatible types33...3414 | #[serde(default = "main")]3415 | #[serde(default = "main")]35 | ^^^^^^ expected `i8`, found `()`
modified:test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs+3 added-2 removed
1//! Ensures that error message points to the path in attribute1// Tests that type error points to the path in attribute23use serde_derive::Deserialize;45#[derive(Deserialize)]6enum Enum {6 // Newtype variants does not use the provided path, so it is forbidden here7 // Newtype variants do not use the provided path, so it is forbidden here8 // Newtype(#[serde(default = "main")] u8),9 Tuple(u8, #[serde(default = "main")] i8),10 Struct {11 #[serde(default = "main")]
8 unmodified lines
modified:test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.stderr+9 added-9 removed
1error[E0308]: `match` arms have incompatible types2 --> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:8:332 --> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:9:333 |44 | #[derive(Deserialize)]45 | #[derive(Deserialize)]5 | -----------6 | |7 | this is found to be of type `i8`8 | `match` arms have incompatible types9...108 | Tuple(u8, #[serde(default = "main")] i8),109 | Tuple(u8, #[serde(default = "main")] i8),11 | ^^^^^^ expected `i8`, found `()`1213error[E0308]: `match` arms have incompatible types14 --> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:10:2714 --> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:11:2715 |164 | #[derive(Deserialize)]165 | #[derive(Deserialize)]17 | -----------18 | |19 | this is found to be of type `u8`20 | `match` arms have incompatible types21...2210 | #[serde(default = "main")]2211 | #[serde(default = "main")]23 | ^^^^^^ expected `u8`, found `()`2425error[E0308]: `match` arms have incompatible types26 --> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:13:2726 --> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:14:2727 |284 | #[derive(Deserialize)]285 | #[derive(Deserialize)]29 | -----------30 | |31 | this is found to be of type `i8`32 | `match` arms have incompatible types33...3413 | #[serde(default = "main")]3414 | #[serde(default = "main")]35 | ^^^^^^ expected `i8`, found `()`
modified:test_suite/tests/ui/default-attribute/incorrect_type_enum_internally_tagged.rs+4 added-3 removed
1//! Ensures that error message points to the path in attribute1// Tests that type error points to the path in attribute23use serde_derive::Deserialize;45#[derive(Deserialize)]6#[serde(tag = "tag")]7enum Enum {7 // Newtype variants does not use the provided path, so it is forbidden here8 // Newtype variants do not use the provided path, so it is forbidden here9 // Newtype(#[serde(default = "main")] u8),9 // Tuple variants does not supported in internally tagged enums10 // Tuple variants are not supported in internally tagged enums11 Struct {12 #[serde(default = "main")]13 f1: u8,14 f2: u8,
6 unmodified lines
modified:test_suite/tests/ui/default-attribute/incorrect_type_enum_internally_tagged.stderr+6 added-6 removed
1error[E0308]: `match` arms have incompatible types2 --> tests/ui/default-attribute/incorrect_type_enum_internally_tagged.rs:11:272 --> tests/ui/default-attribute/incorrect_type_enum_internally_tagged.rs:12:273 |44 | #[derive(Deserialize)]45 | #[derive(Deserialize)]5 | -----------6 | |7 | this is found to be of type `u8`8 | `match` arms have incompatible types9...1011 | #[serde(default = "main")]1012 | #[serde(default = "main")]11 | ^^^^^^ expected `u8`, found `()`1213error[E0308]: `match` arms have incompatible types14 --> tests/ui/default-attribute/incorrect_type_enum_internally_tagged.rs:14:2714 --> tests/ui/default-attribute/incorrect_type_enum_internally_tagged.rs:15:2715 |164 | #[derive(Deserialize)]165 | #[derive(Deserialize)]17 | -----------18 | |19 | this is found to be of type `i8`20 | `match` arms have incompatible types21...2214 | #[serde(default = "main")]2215 | #[serde(default = "main")]23 | ^^^^^^ expected `i8`, found `()`
modified:test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.rs+3 added-2 removed
1//! Ensures that error message points to the path in attribute1// Tests that type error points to the path in attribute23use serde_derive::Deserialize;45#[derive(Deserialize)]6#[serde(untagged)]7enum Enum {7 // Newtype variants does not use the provided path, so it is forbidden here8 // Newtype variants do not use the provided path, so it is forbidden here9 // Newtype(#[serde(default = "main")] u8),10 Tuple(u8, #[serde(default = "main")] i8),11 Struct {12 #[serde(default = "main")]
8 unmodified lines
modified:test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.stderr+15 added-15 removed
1error[E0308]: `match` arms have incompatible types2 --> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:9:333 |44 | #[derive(Deserialize)]5 | -----------6 | |7 | this is found to be of type `i8`8 | `match` arms have incompatible types2 --> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:10:333 |45 | #[derive(Deserialize)]5 | -----------6 | |7 | this is found to be of type `i8`8 | `match` arms have incompatible types9...109 | Tuple(u8, #[serde(default = "main")] i8),11 | ^^^^^^ expected `i8`, found `()`1010 | Tuple(u8, #[serde(default = "main")] i8),11 | ^^^^^^ expected `i8`, found `()`1213error[E0308]: `match` arms have incompatible types14 --> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:11:2714 --> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:12:2715 |164 | #[derive(Deserialize)]165 | #[derive(Deserialize)]17 | -----------18 | |19 | this is found to be of type `u8`20 | `match` arms have incompatible types21...2211 | #[serde(default = "main")]2212 | #[serde(default = "main")]23 | ^^^^^^ expected `u8`, found `()`2425error[E0308]: `match` arms have incompatible types26 --> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:14:2726 --> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:15:2727 |284 | #[derive(Deserialize)]285 | #[derive(Deserialize)]29 | -----------30 | |31 | this is found to be of type `i8`32 | `match` arms have incompatible types33...3414 | #[serde(default = "main")]3415 | #[serde(default = "main")]35 | ^^^^^^ expected `i8`, found `()`
modified:test_suite/tests/ui/default-attribute/incorrect_type_newtype.rs+2 added-1 removed
1//! Ensures that error message points to the path in attribute1// Tests that type error points to the path in attribute23use serde_derive::Deserialize;45#[derive(Deserialize)]6#[serde(default = "main")]
3 unmodified lines
modified:test_suite/tests/ui/default-attribute/incorrect_type_newtype.stderr+13 added-13 removed
1error[E0308]: mismatched types2 --> tests/ui/default-attribute/incorrect_type_newtype.rs:5:192 --> tests/ui/default-attribute/incorrect_type_newtype.rs:6:193 |45 | #[serde(default = "main")]46 | #[serde(default = "main")]5 | ^^^^^^6 | |7 | expected `Newtype`, found `()`8 | expected due to this910error[E0308]: `match` arms have incompatible types11 --> tests/ui/default-attribute/incorrect_type_newtype.rs:6:3411 --> tests/ui/default-attribute/incorrect_type_newtype.rs:7:3412 |134 | #[derive(Deserialize)]135 | #[derive(Deserialize)]14 | -----------15 | |16 | this is found to be of type `u8`17 | `match` arms have incompatible types185 | #[serde(default = "main")]196 | struct Newtype(#[serde(default = "main")] u8);186 | #[serde(default = "main")]197 | struct Newtype(#[serde(default = "main")] u8);20 | ^^^^^^ expected `u8`, found `()`2122error[E0308]: mismatched types23 --> tests/ui/default-attribute/incorrect_type_newtype.rs:5:1923 --> tests/ui/default-attribute/incorrect_type_newtype.rs:6:1924 |255 | #[serde(default = "main")]256 | #[serde(default = "main")]26 | ^^^^^^ expected `Newtype`, found `()`276 | struct Newtype(#[serde(default = "main")] u8);277 | struct Newtype(#[serde(default = "main")] u8);28 | ------- expected due to this2930error[E0308]: mismatched types31 --> tests/ui/default-attribute/incorrect_type_newtype.rs:6:3431 --> tests/ui/default-attribute/incorrect_type_newtype.rs:7:3432 |334 | #[derive(Deserialize)]335 | #[derive(Deserialize)]34 | ----------- expected due to the type of this binding355 | #[serde(default = "main")]366 | struct Newtype(#[serde(default = "main")] u8);356 | #[serde(default = "main")]367 | struct Newtype(#[serde(default = "main")] u8);37 | ^^^^^^ expected `u8`, found `()`
modified:test_suite/tests/ui/default-attribute/incorrect_type_struct.rs+2 added-1 removed
1//! Ensures that error message points to the path in attribute1// Tests that type error points to the path in attribute23use serde_derive::Deserialize;45#[derive(Deserialize)]6#[serde(default = "main")]
9 unmodified lines
modified:test_suite/tests/ui/default-attribute/incorrect_type_struct.stderr+17 added-17 removed
1error[E0308]: mismatched types2 --> tests/ui/default-attribute/incorrect_type_struct.rs:5:192 --> tests/ui/default-attribute/incorrect_type_struct.rs:6:193 |45 | #[serde(default = "main")]46 | #[serde(default = "main")]5 | ^^^^^^6 | |7 | expected `Struct`, found `()`8 | expected due to this910error[E0308]: `match` arms have incompatible types11 --> tests/ui/default-attribute/incorrect_type_struct.rs:7:2311 --> tests/ui/default-attribute/incorrect_type_struct.rs:8:2312 |134 | #[derive(Deserialize)]135 | #[derive(Deserialize)]14 | -----------15 | |16 | this is found to be of type `u8`17 | `match` arms have incompatible types18...197 | #[serde(default = "main")]198 | #[serde(default = "main")]20 | ^^^^^^ expected `u8`, found `()`2122error[E0308]: `match` arms have incompatible types23 --> tests/ui/default-attribute/incorrect_type_struct.rs:10:2323 --> tests/ui/default-attribute/incorrect_type_struct.rs:11:2324 |254 | #[derive(Deserialize)]255 | #[derive(Deserialize)]26 | -----------27 | |28 | this is found to be of type `i8`29 | `match` arms have incompatible types30...3110 | #[serde(default = "main")]3111 | #[serde(default = "main")]32 | ^^^^^^ expected `i8`, found `()`3334error[E0308]: mismatched types35 --> tests/ui/default-attribute/incorrect_type_struct.rs:5:1935 --> tests/ui/default-attribute/incorrect_type_struct.rs:6:1936 |375 | #[serde(default = "main")]376 | #[serde(default = "main")]38 | ^^^^^^ expected `Struct`, found `()`396 | struct Struct {397 | struct Struct {40 | ------ expected due to this4142error[E0308]: mismatched types43 --> tests/ui/default-attribute/incorrect_type_struct.rs:7:2343 --> tests/ui/default-attribute/incorrect_type_struct.rs:8:2344 |454 | #[derive(Deserialize)]455 | #[derive(Deserialize)]46 | ----------- expected due to the type of this binding47...487 | #[serde(default = "main")]488 | #[serde(default = "main")]49 | ^^^^^^ expected `u8`, found `()`5051error[E0308]: mismatched types52 --> tests/ui/default-attribute/incorrect_type_struct.rs:10:2352 --> tests/ui/default-attribute/incorrect_type_struct.rs:11:2353 |544 | #[derive(Deserialize)]545 | #[derive(Deserialize)]55 | ----------- expected due to the type of this binding56...5710 | #[serde(default = "main")]5711 | #[serde(default = "main")]58 | ^^^^^^ expected `i8`, found `()`
modified:test_suite/tests/ui/default-attribute/incorrect_type_tuple.rs+2 added-1 removed
1//! Ensures that error message points to the path in attribute1// Tests that type error points to the path in attribute23use serde_derive::Deserialize;45#[derive(Deserialize)]6#[serde(default = "main")]
3 unmodified lines
modified:test_suite/tests/ui/default-attribute/incorrect_type_tuple.stderr+13 added-13 removed
1error[E0308]: mismatched types2 --> tests/ui/default-attribute/incorrect_type_tuple.rs:5:192 --> tests/ui/default-attribute/incorrect_type_tuple.rs:6:193 |45 | #[serde(default = "main")]46 | #[serde(default = "main")]5 | ^^^^^^6 | |7 | expected `Tuple`, found `()`8 | expected due to this910error[E0308]: `match` arms have incompatible types11 --> tests/ui/default-attribute/incorrect_type_tuple.rs:6:3611 --> tests/ui/default-attribute/incorrect_type_tuple.rs:7:3612 |134 | #[derive(Deserialize)]135 | #[derive(Deserialize)]14 | -----------15 | |16 | this is found to be of type `i8`17 | `match` arms have incompatible types185 | #[serde(default = "main")]196 | struct Tuple(u8, #[serde(default = "main")] i8);186 | #[serde(default = "main")]197 | struct Tuple(u8, #[serde(default = "main")] i8);20 | ^^^^^^ expected `i8`, found `()`2122error[E0308]: mismatched types23 --> tests/ui/default-attribute/incorrect_type_tuple.rs:5:1923 --> tests/ui/default-attribute/incorrect_type_tuple.rs:6:1924 |255 | #[serde(default = "main")]256 | #[serde(default = "main")]26 | ^^^^^^ expected `Tuple`, found `()`276 | struct Tuple(u8, #[serde(default = "main")] i8);277 | struct Tuple(u8, #[serde(default = "main")] i8);28 | ----- expected due to this2930error[E0308]: mismatched types31 --> tests/ui/default-attribute/incorrect_type_tuple.rs:6:3631 --> tests/ui/default-attribute/incorrect_type_tuple.rs:7:3632 |334 | #[derive(Deserialize)]335 | #[derive(Deserialize)]34 | ----------- expected due to the type of this binding355 | #[serde(default = "main")]366 | struct Tuple(u8, #[serde(default = "main")] i8);356 | #[serde(default = "main")]367 | struct Tuple(u8, #[serde(default = "main")] i8);37 | ^^^^^^ expected `i8`, found `()`