Skip to content

Commit 00460b8

Browse files
committed
Fix wording in comments from PR 2558
1 parent d4486be commit 00460b8

15 files changed

+108
-101
lines changed

serde_derive/src/ser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ fn wrap_serialize_with(
12271227
quote_spanned!(serialize_with.span()=> {
12281228
#[doc(hidden)]
12291229
struct __SerializeWith #wrapper_impl_generics #where_clause {
1230-
// If #field_tys is empty, `values` does not used
1230+
// If #field_tys is empty, this field is unused
12311231
#[allow(dead_code)]
12321232
values: (#(&'__a #field_tys, )*),
12331233
phantom: _serde::__private::PhantomData<#this_type #ty_generics>,

test_suite/tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
//! Ensures that error message points to the path in attribute
1+
// Tests that type error points to the path in attribute
2+
23
use serde_derive::Deserialize;
34

45
#[derive(Deserialize)]
56
#[serde(tag = "tag", content = "content")]
67
enum Enum {
7-
// Newtype variants does not use the provided path, so it is forbidden here
8+
// Newtype variants do not use the provided path, so it is forbidden here
89
// Newtype(#[serde(default = "main")] u8),
910
Tuple(u8, #[serde(default = "main")] i8),
1011
Struct {
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
error[E0308]: `match` arms have incompatible types
2-
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:9:33
3-
|
4-
4 | #[derive(Deserialize)]
5-
| -----------
6-
| |
7-
| this is found to be of type `i8`
8-
| `match` arms have incompatible types
2+
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:10:33
3+
|
4+
5 | #[derive(Deserialize)]
5+
| -----------
6+
| |
7+
| this is found to be of type `i8`
8+
| `match` arms have incompatible types
99
...
10-
9 | Tuple(u8, #[serde(default = "main")] i8),
11-
| ^^^^^^ expected `i8`, found `()`
10+
10 | Tuple(u8, #[serde(default = "main")] i8),
11+
| ^^^^^^ expected `i8`, found `()`
1212

1313
error[E0308]: `match` arms have incompatible types
14-
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:11:27
14+
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:12:27
1515
|
16-
4 | #[derive(Deserialize)]
16+
5 | #[derive(Deserialize)]
1717
| -----------
1818
| |
1919
| this is found to be of type `u8`
2020
| `match` arms have incompatible types
2121
...
22-
11 | #[serde(default = "main")]
22+
12 | #[serde(default = "main")]
2323
| ^^^^^^ expected `u8`, found `()`
2424

2525
error[E0308]: `match` arms have incompatible types
26-
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:14:27
26+
--> tests/ui/default-attribute/incorrect_type_enum_adjacently_tagged.rs:15:27
2727
|
28-
4 | #[derive(Deserialize)]
28+
5 | #[derive(Deserialize)]
2929
| -----------
3030
| |
3131
| this is found to be of type `i8`
3232
| `match` arms have incompatible types
3333
...
34-
14 | #[serde(default = "main")]
34+
15 | #[serde(default = "main")]
3535
| ^^^^^^ expected `i8`, found `()`

test_suite/tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
//! Ensures that error message points to the path in attribute
1+
// Tests that type error points to the path in attribute
2+
23
use serde_derive::Deserialize;
34

45
#[derive(Deserialize)]
56
enum Enum {
6-
// Newtype variants does not use the provided path, so it is forbidden here
7+
// Newtype variants do not use the provided path, so it is forbidden here
78
// Newtype(#[serde(default = "main")] u8),
89
Tuple(u8, #[serde(default = "main")] i8),
910
Struct {
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
error[E0308]: `match` arms have incompatible types
2-
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:8:33
2+
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:9:33
33
|
4-
4 | #[derive(Deserialize)]
4+
5 | #[derive(Deserialize)]
55
| -----------
66
| |
77
| this is found to be of type `i8`
88
| `match` arms have incompatible types
99
...
10-
8 | Tuple(u8, #[serde(default = "main")] i8),
10+
9 | Tuple(u8, #[serde(default = "main")] i8),
1111
| ^^^^^^ expected `i8`, found `()`
1212

1313
error[E0308]: `match` arms have incompatible types
14-
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:10:27
14+
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:11:27
1515
|
16-
4 | #[derive(Deserialize)]
16+
5 | #[derive(Deserialize)]
1717
| -----------
1818
| |
1919
| this is found to be of type `u8`
2020
| `match` arms have incompatible types
2121
...
22-
10 | #[serde(default = "main")]
22+
11 | #[serde(default = "main")]
2323
| ^^^^^^ expected `u8`, found `()`
2424

2525
error[E0308]: `match` arms have incompatible types
26-
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:13:27
26+
--> tests/ui/default-attribute/incorrect_type_enum_externally_tagged.rs:14:27
2727
|
28-
4 | #[derive(Deserialize)]
28+
5 | #[derive(Deserialize)]
2929
| -----------
3030
| |
3131
| this is found to be of type `i8`
3232
| `match` arms have incompatible types
3333
...
34-
13 | #[serde(default = "main")]
34+
14 | #[serde(default = "main")]
3535
| ^^^^^^ expected `i8`, found `()`

test_suite/tests/ui/default-attribute/incorrect_type_enum_internally_tagged.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
//! Ensures that error message points to the path in attribute
1+
// Tests that type error points to the path in attribute
2+
23
use serde_derive::Deserialize;
34

45
#[derive(Deserialize)]
56
#[serde(tag = "tag")]
67
enum Enum {
7-
// Newtype variants does not use the provided path, so it is forbidden here
8+
// Newtype variants do not use the provided path, so it is forbidden here
89
// Newtype(#[serde(default = "main")] u8),
9-
// Tuple variants does not supported in internally tagged enums
10+
// Tuple variants are not supported in internally tagged enums
1011
Struct {
1112
#[serde(default = "main")]
1213
f1: u8,
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error[E0308]: `match` arms have incompatible types
2-
--> tests/ui/default-attribute/incorrect_type_enum_internally_tagged.rs:11:27
2+
--> tests/ui/default-attribute/incorrect_type_enum_internally_tagged.rs:12:27
33
|
4-
4 | #[derive(Deserialize)]
4+
5 | #[derive(Deserialize)]
55
| -----------
66
| |
77
| this is found to be of type `u8`
88
| `match` arms have incompatible types
99
...
10-
11 | #[serde(default = "main")]
10+
12 | #[serde(default = "main")]
1111
| ^^^^^^ expected `u8`, found `()`
1212

1313
error[E0308]: `match` arms have incompatible types
14-
--> tests/ui/default-attribute/incorrect_type_enum_internally_tagged.rs:14:27
14+
--> tests/ui/default-attribute/incorrect_type_enum_internally_tagged.rs:15:27
1515
|
16-
4 | #[derive(Deserialize)]
16+
5 | #[derive(Deserialize)]
1717
| -----------
1818
| |
1919
| this is found to be of type `i8`
2020
| `match` arms have incompatible types
2121
...
22-
14 | #[serde(default = "main")]
22+
15 | #[serde(default = "main")]
2323
| ^^^^^^ expected `i8`, found `()`

test_suite/tests/ui/default-attribute/incorrect_type_enum_untagged.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
//! Ensures that error message points to the path in attribute
1+
// Tests that type error points to the path in attribute
2+
23
use serde_derive::Deserialize;
34

45
#[derive(Deserialize)]
56
#[serde(untagged)]
67
enum Enum {
7-
// Newtype variants does not use the provided path, so it is forbidden here
8+
// Newtype variants do not use the provided path, so it is forbidden here
89
// Newtype(#[serde(default = "main")] u8),
910
Tuple(u8, #[serde(default = "main")] i8),
1011
Struct {
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
error[E0308]: `match` arms have incompatible types
2-
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:9:33
3-
|
4-
4 | #[derive(Deserialize)]
5-
| -----------
6-
| |
7-
| this is found to be of type `i8`
8-
| `match` arms have incompatible types
2+
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:10:33
3+
|
4+
5 | #[derive(Deserialize)]
5+
| -----------
6+
| |
7+
| this is found to be of type `i8`
8+
| `match` arms have incompatible types
99
...
10-
9 | Tuple(u8, #[serde(default = "main")] i8),
11-
| ^^^^^^ expected `i8`, found `()`
10+
10 | Tuple(u8, #[serde(default = "main")] i8),
11+
| ^^^^^^ expected `i8`, found `()`
1212

1313
error[E0308]: `match` arms have incompatible types
14-
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:11:27
14+
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:12:27
1515
|
16-
4 | #[derive(Deserialize)]
16+
5 | #[derive(Deserialize)]
1717
| -----------
1818
| |
1919
| this is found to be of type `u8`
2020
| `match` arms have incompatible types
2121
...
22-
11 | #[serde(default = "main")]
22+
12 | #[serde(default = "main")]
2323
| ^^^^^^ expected `u8`, found `()`
2424

2525
error[E0308]: `match` arms have incompatible types
26-
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:14:27
26+
--> tests/ui/default-attribute/incorrect_type_enum_untagged.rs:15:27
2727
|
28-
4 | #[derive(Deserialize)]
28+
5 | #[derive(Deserialize)]
2929
| -----------
3030
| |
3131
| this is found to be of type `i8`
3232
| `match` arms have incompatible types
3333
...
34-
14 | #[serde(default = "main")]
34+
15 | #[serde(default = "main")]
3535
| ^^^^^^ expected `i8`, found `()`

test_suite/tests/ui/default-attribute/incorrect_type_newtype.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//! Ensures that error message points to the path in attribute
1+
// Tests that type error points to the path in attribute
2+
23
use serde_derive::Deserialize;
34

45
#[derive(Deserialize)]

0 commit comments

Comments
 (0)