Optimizations and bug fixes for v0.2.1#41
Merged
luisfi-dev merged 8 commits intomasterfrom Jan 8, 2026
Merged
Conversation
Co-authored-by: LuisFerLCC <81205298+LuisFerLCC@users.noreply.github.com>
Fix attribute ordering to prevent macro from overriding user lint attributes
…Rust team to fix it
There was a problem hiding this comment.
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.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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