Repository navigation
Conversation
hvitved
force-pushed
the
hvitved-fix-issue-23146
branch
3 times, most recently
from
November 23, 2026 10:30
1849efc to
864f1a8
Compare
hvitved
marked this pull request as ready for review
November 23, 2026 13:30
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Derive-generated items still have incorrect parent scopes through expansion wrappers, and glob-shadowing checks can incorrectly resolve name collisions; both issues need fixes and regression coverage.
2 open issues
What changed in this PR
This PR corrects Rust path resolution so derive-generated items are treated as siblings of the originating type, addressing the canonical-path and name-resolution problem in #23146.
Changes:
- Adjusts immediate-parent lookup for derive-generated items.
- Adds a builder-generating derive fixture and checks canonical paths and reference resolution.
- Updates expected query results and AST output.
| File | Description |
|---|---|
rust/ql/test/extractor-tests/macro-expansion/test.ql |
Adds canonical-path and reference-resolution checks. |
rust/ql/test/extractor-tests/macro-expansion/test.expected |
Records expected builder paths and resolved references. |
rust/ql/test/extractor-tests/macro-expansion/proc_macro.rs |
Adds the GenerateBuilder derive macro. |
rust/ql/test/extractor-tests/macro-expansion/PrintAst.expected |
Updates AST expectations for the new fixture. |
rust/ql/test/extractor-tests/macro-expansion/macro_expansion.rs |
Adds Config and sibling uses of ConfigBuilder. |
rust/ql/lib/codeql/rust/internal/PathResolution.qll |
Reparents direct derive output to the originating type’s enclosing scope. |
Review effort: Balanced (adaptive)
hvitved
marked this pull request as draft
November 23, 2026 13:46
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
hvitved
force-pushed
the
hvitved-fix-issue-23146
branch
from
November 23, 2026 14:54
b4dc290 to
bdcc19b
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
hvitved
force-pushed
the
hvitved-fix-issue-23146
branch
from
November 23, 2026 18:52
bdcc19b to
ca1733f
Compare
hvitved
marked this pull request as ready for review
November 24, 2026 08:29
This branch has not been deployed
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.

Derive-generated items are siblings of the type they derive from, not nested inside it. Treating them as nested produced incorrect canonical paths and prevented references to generated types from resolving.
Fixes #23146
DCA is fine.