Skip to content

Conversation

@paldepind
Copy link
Contributor

With this PR the new/recent TypeItem class is used in path resolution. It turned out that UnionItemNode and EnumItemNode can be expressed only using the shared predicates in TypeItem. StructItemNode is a bit special, so it's still there and overrides a few things from TypeItemItemNode.

The name TypeItemTypeItemNode is a bit clunky as Rust's notion of an "item" classes with path resolution's notion of an "item".

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jan 9, 2026
@paldepind paldepind marked this pull request as ready for review January 9, 2026 10:55
Copilot AI review requested due to automatic review settings January 9, 2026 10:55
@paldepind paldepind requested a review from a team as a code owner January 9, 2026 10:55
Copy link
Contributor

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 refactors path resolution in Rust to use the recently introduced TypeItem class, consolidating code and reducing duplication. The TypeItem class represents items that define types (Struct, Enum, or Union) and provides common predicates for these types.

  • Introduces TypeItemTypeItemNode as a generalized node type for all type items
  • Removes duplicate EnumItemNode and UnionItemNode classes that can be expressed using shared predicates
  • Refactors StructItemNode to extend TypeItemTypeItemNode while maintaining its special behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@paldepind paldepind added the no-change-note-required This PR does not need a change note label Jan 9, 2026
@paldepind paldepind merged commit ac62a9f into github:main Jan 9, 2026
26 of 27 checks passed
@paldepind paldepind deleted the rust/type-item-path-resolution branch January 9, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants