-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Export): add #[export(...)] attribute
- Loading branch information
Showing
9 changed files
with
110 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
error: #[derive(Export)] only supports fieldless enums | ||
--> tests/ui/export_fail_01.rs:5:5 | ||
--> tests/ui/export_fail_01.rs:6:5 | ||
| | ||
5 | Bar(String), | ||
6 | Bar(String), | ||
| ^^^ | ||
|
||
error: #[derive(Export)] only supports fieldless enums | ||
--> tests/ui/export_fail_01.rs:6:5 | ||
--> tests/ui/export_fail_01.rs:7:5 | ||
| | ||
6 | Baz { a: i32, b: u32 }, | ||
7 | Baz { a: i32, b: u32 }, | ||
| ^^^ |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
use gdnative::prelude::*; | ||
|
||
#[derive(Export, ToVariant)] | ||
#[export(kind = "enum")] | ||
pub struct Foo { | ||
bar: i32, | ||
} | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: #[derive(Export)] only supports fieldless enums | ||
--> tests/ui/export_fail_02.rs:4:5 | ||
--> tests/ui/export_fail_02.rs:5:5 | ||
| | ||
4 | pub struct Foo { | ||
5 | pub struct Foo { | ||
| ^^^^^^ |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
use gdnative::prelude::*; | ||
|
||
#[derive(Export, ToVariant)] | ||
#[export(kind = "enum")] | ||
pub union Foo { | ||
bar: i32, | ||
} | ||
|
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
error: #[derive(Export)] only supports fieldless enums | ||
--> tests/ui/export_fail_03.rs:4:5 | ||
--> tests/ui/export_fail_03.rs:5:5 | ||
| | ||
4 | pub union Foo { | ||
5 | pub union Foo { | ||
| ^^^^^ | ||
|
||
error: Variant conversion derive macro does not work on unions. | ||
--> tests/ui/export_fail_03.rs:4:1 | ||
| | ||
4 | pub union Foo { | ||
| ^^^ | ||
4 | #[export(kind = "enum")] | ||
| ^ |
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