Skip to content

Conversation

@LuisFerLCC
Copy link
Owner

Implement the following optimizations and bug fixes for 0.2.1:

  • Move #[allow(single_use_lifetimes)] in both impl Display for T and impl Error for T above user-provided attributes to avoid overriding them
  • Allow structs with at least one field with type never (!) to ignore the display attribute, as such a struct is itself not constructible
  • Fully qualify the path for the unreachable macro

@LuisFerLCC LuisFerLCC added this to the v0.2.1 milestone Jan 8, 2026
@LuisFerLCC LuisFerLCC requested a review from Copilot January 8, 2026 02:08
@LuisFerLCC LuisFerLCC self-assigned this Jan 8, 2026
@LuisFerLCC LuisFerLCC added 💣 Breaking change Change that modifies existing behavior 🐞 Bug Not working as intended labels Jan 8, 2026
@LuisFerLCC LuisFerLCC added ✨ Enhancement New feature or request 🟢 Minor bug Only affects a very specific use case 🧪 Tests Improvements or additions to unit tests 🚀 Performance Improvements to performance labels Jan 8, 2026
Copy link

Copilot AI left a 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 a display attribute
  • Fully qualified the unreachable! macro path and renamed EmptyEnum to EmptyType for 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.

@LuisFerLCC LuisFerLCC added the ✅ Ready to merge This PR is ready to be merged label Jan 8, 2026
@LuisFerLCC LuisFerLCC merged commit e151848 into master Jan 8, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💣 Breaking change Change that modifies existing behavior 🐞 Bug Not working as intended ✨ Enhancement New feature or request 🟢 Minor bug Only affects a very specific use case 🚀 Performance Improvements to performance ✅ Ready to merge This PR is ready to be merged 🧪 Tests Improvements or additions to unit tests

Projects

Development

Successfully merging this pull request may close these issues.

2 participants