forked from serde-rs/serde
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fest(serde-rs#1587): implement serde(strict_or_some_other_name) attri…
…bute
- Loading branch information
Showing
13 changed files
with
140 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use serde_derive::Deserialize; | ||
|
||
#[derive(Deserialize)] | ||
#[serde(strict_or_some_other_name)] | ||
enum E { | ||
S { a: u8 }, | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: #[serde(strict_or_some_other_name)] can only be used on structs with named fields | ||
--> tests/ui/strict-or-some-other-name/enum.rs:4:9 | ||
| | ||
4 | #[serde(strict_or_some_other_name)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ |
7 changes: 7 additions & 0 deletions
7
test_suite/tests/ui/strict-or-some-other-name/newtype-struct.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use serde_derive::Deserialize; | ||
|
||
#[derive(Deserialize)] | ||
#[serde(strict_or_some_other_name)] | ||
struct S(u8); | ||
|
||
fn main() {} |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/strict-or-some-other-name/newtype-struct.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: #[serde(strict_or_some_other_name)] can only be used on structs with named fields | ||
--> tests/ui/strict-or-some-other-name/newtype-struct.rs:4:9 | ||
| | ||
4 | #[serde(strict_or_some_other_name)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ |
7 changes: 7 additions & 0 deletions
7
test_suite/tests/ui/strict-or-some-other-name/tuple-struct.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use serde_derive::Deserialize; | ||
|
||
#[derive(Deserialize)] | ||
#[serde(strict_or_some_other_name)] | ||
struct S(u8, u8); | ||
|
||
fn main() {} |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/strict-or-some-other-name/tuple-struct.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: #[serde(strict_or_some_other_name)] can only be used on structs with named fields | ||
--> tests/ui/strict-or-some-other-name/tuple-struct.rs:4:9 | ||
| | ||
4 | #[serde(strict_or_some_other_name)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use serde_derive::Deserialize; | ||
|
||
#[derive(Deserialize)] | ||
#[serde(strict_or_some_other_name)] | ||
struct S; | ||
|
||
fn main() {} |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/strict-or-some-other-name/unit-struct.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: #[serde(strict_or_some_other_name)] can only be used on structs with named fields | ||
--> tests/ui/strict-or-some-other-name/unit-struct.rs:4:9 | ||
| | ||
4 | #[serde(strict_or_some_other_name)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ |