-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trybuild test of compile fail from README
This has the same error in it twice, and I'm not sure why. Unsatisfying, but better to test the status quo and hopefully iterate than do nothing.
- Loading branch information
Showing
5 changed files
with
144 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -19,3 +19,6 @@ syn = "1.0" | |
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dev-dependencies] | ||
trybuild = "1.0.71" |
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 @@ | ||
#[test] | ||
fn test() { | ||
let t = trybuild::TestCases::new(); | ||
t.compile_fail("tests/ui/field-not-parsetext.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,10 @@ | ||
use static_xml_derive::Deserialize; | ||
|
||
struct Foo; | ||
|
||
#[derive(Deserialize)] | ||
struct Outer { | ||
foo: Foo, | ||
} | ||
|
||
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,40 @@ | ||
error[E0277]: the trait bound `Foo: ParseText` is not satisfied | ||
--> tests/ui/field-not-parsetext.rs:7:5 | ||
| | ||
5 | #[derive(Deserialize)] | ||
| ----------- this tail expression is of type `&mut Foo` | ||
6 | struct Outer { | ||
7 | foo: Foo, | ||
| ^^^^^^^^ the trait `ParseText` is not implemented for `Foo` | ||
| | ||
= help: the following other types implement trait `ParseText`: | ||
String | ||
bool | ||
f32 | ||
f64 | ||
i128 | ||
i16 | ||
i32 | ||
i64 | ||
and $N others | ||
= note: required for `Foo` to implement `Deserialize` | ||
= note: required for `Foo` to implement `DeserializeElementField` | ||
|
||
error[E0277]: the trait bound `Foo: ParseText` is not satisfied | ||
--> tests/ui/field-not-parsetext.rs:7:5 | ||
| | ||
7 | foo: Foo, | ||
| ^^^^^^^^ the trait `ParseText` is not implemented for `Foo` | ||
| | ||
= help: the following other types implement trait `ParseText`: | ||
String | ||
bool | ||
f32 | ||
f64 | ||
i128 | ||
i16 | ||
i32 | ||
i64 | ||
and $N others | ||
= note: required for `Foo` to implement `Deserialize` | ||
= note: required for `Foo` to implement `DeserializeElementField` |