-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support #[deprecated] on enum variants
While the #[deprecated] attribute was already read on structs, fns and enums, it was not implemented for enum variants. The information about enum variants is already available via `variant.body.annotations`, so the support for the #[deprecated] attribute on enum-variant level is more or less only another pair of entries within the `EnumConfig`. This commit adds two new options within the `[enum]` settings: - deprecated_variant, and - deprecated_variant_with_notes Both get active only on #[deprecated] variants, e.g., #[repr(u8)] enum ApiLevel { #[deprecated(note = "Legacy Support until 2025")] L1 = 1, #[deprecated] L2 = 2, L3 = 3, L4 = 4, } For enums with struct variants, the current struct deprecation methods are already working good enough (see tests/expecations/deprecated*).
- Loading branch information
Showing
15 changed files
with
474 additions
and
20 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
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
Oops, something went wrong.