-
Notifications
You must be signed in to change notification settings - Fork 0
Optimizations and bug fixes for v0.2.1 #41
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
Conversation
Co-authored-by: LuisFerLCC <[email protected]>
Fix attribute ordering to prevent macro from overriding user lint attributes
…Rust team to fix it
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.
Pull request overview
This PR implements three optimizations and bug fixes for version 0.2.1, focusing on attribute ordering, handling never-type structs, and macro path qualification.
Key changes:
- Repositioned
#[allow(single_use_lifetimes)]above user attributes to prevent overriding user-provided attributes - Added support for structs with never (
!) type fields to be treated as empty types, not requiring adisplayattribute - Fully qualified the
unreachable!macro path and renamedEmptyEnumtoEmptyTypefor consistency
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/src/structs.rs | Updated comment from FIXME to TODO regarding redundant_lifetimes expectation placement |
| tests/src/enums.rs | Corrected comment to reference Tuple variant instead of TupleVariant for consistency |
| tests/src/enum_variants.rs | Renamed enum variants for consistency (UnitVariant → Unit, NamedFieldVariant → NamedFields, TupleVariant → Tuple) and removed completed TODO |
| impl/src/types/mod.rs | Moved #[allow(single_use_lifetimes)] above user attributes in both Display and Error impl blocks, updated test expectations |
| impl/src/types/fmt/mod.rs | Added never type detection for structs, renamed EmptyEnum to EmptyType, fully qualified unreachable macro, added test for never-type struct |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implement the following optimizations and bug fixes for 0.2.1:
#[allow(single_use_lifetimes)]in bothimpl Display for Tandimpl Error for Tabove user-provided attributes to avoid overriding them!) to ignore thedisplayattribute, as such a struct is itself not constructibleunreachablemacro