-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
squash! Untify #[pyenum] and #[pyclass]
- Loading branch information
1 parent
55c2a72
commit fd73d79
Showing
5 changed files
with
77 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use pyo3::prelude::*; | ||
|
||
#[pyclass(subclass)] | ||
enum NotBaseClass { | ||
x, | ||
y, | ||
} | ||
|
||
#[pyclass(extends = PyList)] | ||
enum NotDrivedClass { | ||
x, | ||
y, | ||
} | ||
|
||
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,11 @@ | ||
error: enums can't be inherited by other classes | ||
--> tests/ui/invalid_pyclass_enum.rs:3:11 | ||
| | ||
3 | #[pyclass(subclass)] | ||
| ^^^^^^^^ | ||
|
||
error: enums cannot extend from other classes | ||
--> tests/ui/invalid_pyclass_enum.rs:9:11 | ||
| | ||
9 | #[pyclass(extends = PyList)] | ||
| ^^^^^^^ |