Skip to content

Rust: Canonical paths for blanket implementations - #22405

Merged
hvitved merged 2 commits into
github:mainfrom
hvitved:rust/canonical-path-blanket
Aug 24, 2026
Merged

Rust: Canonical paths for blanket implementations#22405
hvitved merged 2 commits into
github:mainfrom
hvitved:rust/canonical-path-blanket

Conversation

@hvitved

@hvitvedhvitved commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Implements getCanonicalPath also for blanket implementations:

impl<T>FooforT{// canonical path: `<_ as Foo>::bar`fnbar(...){ ...}}

@github-actionsgithub-actionsBot added the Rust Pull requests that update Rust code label Aug 21, 2026
@hvitved
hvitvedforce-pushed the rust/canonical-path-blanket branch 2 times, most recently from a2744e1 to 15eda88CompareAugust 24, 2026 08:04
@hvitved
hvitvedforce-pushed the rust/canonical-path-blanket branch from 15eda88 to b12b1d0CompareAugust 24, 2026 08:05
@hvitvedhvitved added the no-change-note-required This PR does not need a change note label Aug 24, 2026
@hvitved
hvitved marked this pull request as ready for review August 24, 2026 11:15
@hvitved
hvitved requested a review from a team as a code ownerAugust 24, 2026 11:16
CopilotAI balanced review requested due to automatic review settings August 24, 2026 11:16

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds canonical Rust paths for blanket trait implementations, enabling models-as-data matching.

Changes:

  • Generates <_ as Trait> canonical paths.
  • Adds extractor and data-flow coverage.
  • Updates expected test outputs.
Show a summary per file
FileDescription
rust/ql/lib/codeql/rust/internal/PathResolution.qllImplements blanket-implementation paths.
rust/ql/test/extractor-tests/canonical_path/canonical_paths.expectedRecords expected canonical paths.
rust/ql/test/library-tests/dataflow/models/main.rsAdds blanket-model test cases.
rust/ql/test/library-tests/dataflow/models/external_file.rsAdds an inherited trait-model fixture.
rust/ql/test/library-tests/dataflow/models/models.ext.ymlDefines explicit model paths.
rust/ql/test/library-tests/dataflow/models/models.expectedRecords expected data-flow results.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@hvitved
hvitved requested a review from redsun82August 24, 2026 13:12

@redsun82redsun82 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@hvitved
hvitved merged commit ec63c66 into github:mainAug 24, 2026
21 checks passed
@hvitved
hvitved deleted the rust/canonical-path-blanket branch August 24, 2026 13:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-requiredThis PR does not need a change noteRustPull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@hvitved@redsun82