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
Provenance
- Commit
00460b8- Tree
944e306- Author
David Tolnay <dtolnay@gmail.com>- Committer
David Tolnay <dtolnay@gmail.com>- Parent
d4486be
15 files changed+108 added−101 removed
modified:serde_derive/src/ser.rs+1 added-1 removed
1225 unmodified lines1226 // ^^^^^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 linesmodified: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 attribute2+3 use serde_derive::Deserialize;4 5 #[derive(Deserialize)]6 #[serde(tag = "tag", content = "content")]7 enum 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 linesmodified:test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.stderr+15 added-15 removed
1 error[E0308]: `match` arms have incompatible types2- --> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:9:333- |4-4 | #[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+ |4+5 | #[derive(Deserialize)]5+ | -----------6+ | |7+ | this is found to be of type `i8`8+ | `match` arms have incompatible types9 ...10-9 | Tuple(u8, #[serde(default = "main")] i8),11- | ^^^^^^ expected `i8`, found `()`10+10 | Tuple(u8, #[serde(default = "main")] i8),11+ | ^^^^^^ expected `i8`, found `()`12 13 error[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 |16-4 | #[derive(Deserialize)]16+5 | #[derive(Deserialize)]17 | -----------18 | |19 | this is found to be of type `u8`20 | `match` arms have incompatible types21 ...22-11 | #[serde(default = "main")]22+12 | #[serde(default = "main")]23 | ^^^^^^ expected `u8`, found `()`24 25 error[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 |28-4 | #[derive(Deserialize)]28+5 | #[derive(Deserialize)]29 | -----------30 | |31 | this is found to be of type `i8`32 | `match` arms have incompatible types33 ...34-14 | #[serde(default = "main")]34+15 | #[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 attribute2+3 use serde_derive::Deserialize;4 5 #[derive(Deserialize)]6 enum 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 linesmodified:test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.stderr+9 added-9 removed
1 error[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 |4-4 | #[derive(Deserialize)]4+5 | #[derive(Deserialize)]5 | -----------6 | |7 | this is found to be of type `i8`8 | `match` arms have incompatible types9 ...10-8 | Tuple(u8, #[serde(default = "main")] i8),10+9 | Tuple(u8, #[serde(default = "main")] i8),11 | ^^^^^^ expected `i8`, found `()`12 13 error[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 |16-4 | #[derive(Deserialize)]16+5 | #[derive(Deserialize)]17 | -----------18 | |19 | this is found to be of type `u8`20 | `match` arms have incompatible types21 ...22-10 | #[serde(default = "main")]22+11 | #[serde(default = "main")]23 | ^^^^^^ expected `u8`, found `()`24 25 error[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 |28-4 | #[derive(Deserialize)]28+5 | #[derive(Deserialize)]29 | -----------30 | |31 | this is found to be of type `i8`32 | `match` arms have incompatible types33 ...34-13 | #[serde(default = "main")]34+14 | #[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 attribute2+3 use serde_derive::Deserialize;4 5 #[derive(Deserialize)]6 #[serde(tag = "tag")]7 enum 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 linesmodified:test_suite/tests/ui/default-attribute/incorrect_type_enum_internally_tagged.stderr+6 added-6 removed
1 error[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 |4-4 | #[derive(Deserialize)]4+5 | #[derive(Deserialize)]5 | -----------6 | |7 | this is found to be of type `u8`8 | `match` arms have incompatible types9 ...10-11 | #[serde(default = "main")]10+12 | #[serde(default = "main")]11 | ^^^^^^ expected `u8`, found `()`12 13 error[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 |16-4 | #[derive(Deserialize)]16+5 | #[derive(Deserialize)]17 | -----------18 | |19 | this is found to be of type `i8`20 | `match` arms have incompatible types21 ...22-14 | #[serde(default = "main")]22+15 | #[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 attribute2+3 use serde_derive::Deserialize;4 5 #[derive(Deserialize)]6 #[serde(untagged)]7 enum 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 linesmodified:test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.stderr+15 added-15 removed
1 error[E0308]: `match` arms have incompatible types2- --> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:9:333- |4-4 | #[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+ |4+5 | #[derive(Deserialize)]5+ | -----------6+ | |7+ | this is found to be of type `i8`8+ | `match` arms have incompatible types9 ...10-9 | Tuple(u8, #[serde(default = "main")] i8),11- | ^^^^^^ expected `i8`, found `()`10+10 | Tuple(u8, #[serde(default = "main")] i8),11+ | ^^^^^^ expected `i8`, found `()`12 13 error[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 |16-4 | #[derive(Deserialize)]16+5 | #[derive(Deserialize)]17 | -----------18 | |19 | this is found to be of type `u8`20 | `match` arms have incompatible types21 ...22-11 | #[serde(default = "main")]22+12 | #[serde(default = "main")]23 | ^^^^^^ expected `u8`, found `()`24 25 error[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 |28-4 | #[derive(Deserialize)]28+5 | #[derive(Deserialize)]29 | -----------30 | |31 | this is found to be of type `i8`32 | `match` arms have incompatible types33 ...34-14 | #[serde(default = "main")]34+15 | #[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 attribute2+3 use serde_derive::Deserialize;4 5 #[derive(Deserialize)]6 #[serde(default = "main")]3 unmodified linesmodified:test_suite/tests/ui/default-attribute/incorrect_type_newtype.stderr+13 added-13 removed
1 error[E0308]: mismatched types2- --> tests/ui/default-attribute/incorrect_type_newtype.rs:5:192+ --> tests/ui/default-attribute/incorrect_type_newtype.rs:6:193 |4-5 | #[serde(default = "main")]4+6 | #[serde(default = "main")]5 | ^^^^^^6 | |7 | expected `Newtype`, found `()`8 | expected due to this9 10 error[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 |13-4 | #[derive(Deserialize)]13+5 | #[derive(Deserialize)]14 | -----------15 | |16 | this is found to be of type `u8`17 | `match` arms have incompatible types18-5 | #[serde(default = "main")]19-6 | struct Newtype(#[serde(default = "main")] u8);18+6 | #[serde(default = "main")]19+7 | struct Newtype(#[serde(default = "main")] u8);20 | ^^^^^^ expected `u8`, found `()`21 22 error[E0308]: mismatched types23- --> tests/ui/default-attribute/incorrect_type_newtype.rs:5:1923+ --> tests/ui/default-attribute/incorrect_type_newtype.rs:6:1924 |25-5 | #[serde(default = "main")]25+6 | #[serde(default = "main")]26 | ^^^^^^ expected `Newtype`, found `()`27-6 | struct Newtype(#[serde(default = "main")] u8);27+7 | struct Newtype(#[serde(default = "main")] u8);28 | ------- expected due to this29 30 error[E0308]: mismatched types31- --> tests/ui/default-attribute/incorrect_type_newtype.rs:6:3431+ --> tests/ui/default-attribute/incorrect_type_newtype.rs:7:3432 |33-4 | #[derive(Deserialize)]33+5 | #[derive(Deserialize)]34 | ----------- expected due to the type of this binding35-5 | #[serde(default = "main")]36-6 | struct Newtype(#[serde(default = "main")] u8);35+6 | #[serde(default = "main")]36+7 | 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 attribute2+3 use serde_derive::Deserialize;4 5 #[derive(Deserialize)]6 #[serde(default = "main")]9 unmodified linesmodified:test_suite/tests/ui/default-attribute/incorrect_type_struct.stderr+17 added-17 removed
1 error[E0308]: mismatched types2- --> tests/ui/default-attribute/incorrect_type_struct.rs:5:192+ --> tests/ui/default-attribute/incorrect_type_struct.rs:6:193 |4-5 | #[serde(default = "main")]4+6 | #[serde(default = "main")]5 | ^^^^^^6 | |7 | expected `Struct`, found `()`8 | expected due to this9 10 error[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 |13-4 | #[derive(Deserialize)]13+5 | #[derive(Deserialize)]14 | -----------15 | |16 | this is found to be of type `u8`17 | `match` arms have incompatible types18 ...19-7 | #[serde(default = "main")]19+8 | #[serde(default = "main")]20 | ^^^^^^ expected `u8`, found `()`21 22 error[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 |25-4 | #[derive(Deserialize)]25+5 | #[derive(Deserialize)]26 | -----------27 | |28 | this is found to be of type `i8`29 | `match` arms have incompatible types30 ...31-10 | #[serde(default = "main")]31+11 | #[serde(default = "main")]32 | ^^^^^^ expected `i8`, found `()`33 34 error[E0308]: mismatched types35- --> tests/ui/default-attribute/incorrect_type_struct.rs:5:1935+ --> tests/ui/default-attribute/incorrect_type_struct.rs:6:1936 |37-5 | #[serde(default = "main")]37+6 | #[serde(default = "main")]38 | ^^^^^^ expected `Struct`, found `()`39-6 | struct Struct {39+7 | struct Struct {40 | ------ expected due to this41 42 error[E0308]: mismatched types43- --> tests/ui/default-attribute/incorrect_type_struct.rs:7:2343+ --> tests/ui/default-attribute/incorrect_type_struct.rs:8:2344 |45-4 | #[derive(Deserialize)]45+5 | #[derive(Deserialize)]46 | ----------- expected due to the type of this binding47 ...48-7 | #[serde(default = "main")]48+8 | #[serde(default = "main")]49 | ^^^^^^ expected `u8`, found `()`50 51 error[E0308]: mismatched types52- --> tests/ui/default-attribute/incorrect_type_struct.rs:10:2352+ --> tests/ui/default-attribute/incorrect_type_struct.rs:11:2353 |54-4 | #[derive(Deserialize)]54+5 | #[derive(Deserialize)]55 | ----------- expected due to the type of this binding56 ...57-10 | #[serde(default = "main")]57+11 | #[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 attribute2+3 use serde_derive::Deserialize;4 5 #[derive(Deserialize)]6 #[serde(default = "main")]3 unmodified linesmodified:test_suite/tests/ui/default-attribute/incorrect_type_tuple.stderr+13 added-13 removed
1 error[E0308]: mismatched types2- --> tests/ui/default-attribute/incorrect_type_tuple.rs:5:192+ --> tests/ui/default-attribute/incorrect_type_tuple.rs:6:193 |4-5 | #[serde(default = "main")]4+6 | #[serde(default = "main")]5 | ^^^^^^6 | |7 | expected `Tuple`, found `()`8 | expected due to this9 10 error[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 |13-4 | #[derive(Deserialize)]13+5 | #[derive(Deserialize)]14 | -----------15 | |16 | this is found to be of type `i8`17 | `match` arms have incompatible types18-5 | #[serde(default = "main")]19-6 | struct Tuple(u8, #[serde(default = "main")] i8);18+6 | #[serde(default = "main")]19+7 | struct Tuple(u8, #[serde(default = "main")] i8);20 | ^^^^^^ expected `i8`, found `()`21 22 error[E0308]: mismatched types23- --> tests/ui/default-attribute/incorrect_type_tuple.rs:5:1923+ --> tests/ui/default-attribute/incorrect_type_tuple.rs:6:1924 |25-5 | #[serde(default = "main")]25+6 | #[serde(default = "main")]26 | ^^^^^^ expected `Tuple`, found `()`27-6 | struct Tuple(u8, #[serde(default = "main")] i8);27+7 | struct Tuple(u8, #[serde(default = "main")] i8);28 | ----- expected due to this29 30 error[E0308]: mismatched types31- --> tests/ui/default-attribute/incorrect_type_tuple.rs:6:3631+ --> tests/ui/default-attribute/incorrect_type_tuple.rs:7:3632 |33-4 | #[derive(Deserialize)]33+5 | #[derive(Deserialize)]34 | ----------- expected due to the type of this binding35-5 | #[serde(default = "main")]36-6 | struct Tuple(u8, #[serde(default = "main")] i8);35+6 | #[serde(default = "main")]36+7 | struct Tuple(u8, #[serde(default = "main")] i8);37 | ^^^^^^ expected `i8`, found `()`