-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cfg features for enum variants #4509
Changes from 7 commits
9008c07
f3a0819
9fd0c58
ca1760a
4a6b90b
2de25e0
c2dfa77
ca4cf35
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix compile failure when using `#[cfg]` attributes for simple enum variants. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -66,6 +66,14 @@ error: The `ord` option requires the `eq` option. | |||||
83 | #[pyclass(ord)] | ||||||
| ^^^ | ||||||
|
||||||
error: All variants of enum `AllEnumVariantsDisabled` have been disabled by cfg attributes | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably mention why it's not allowed:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, good. I see we don't put #[pyclass] in backticks elsewhere in this module's compiler errors, too, so I haven't added them. |
||||||
--> tests/ui/invalid_pyclass_enum.rs:96:1 | ||||||
| | ||||||
96 | #[pyclass(eq)] | ||||||
| ^^^^^^^^^^^^^^ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to have a better span for this error, |
||||||
| | ||||||
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info) | ||||||
|
||||||
error[E0369]: binary operation `==` cannot be applied to type `&SimpleEqOptRequiresPartialEq` | ||||||
--> tests/ui/invalid_pyclass_enum.rs:31:11 | ||||||
| | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.