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

@hvitved hvitved commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Implements getCanonicalPath also for blanket implementations:

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

@github-actions github-actions Bot added the Rust Pull requests that update Rust code label Aug 21, 2026
@hvitved
hvitved force-pushed the rust/canonical-path-blanket branch 2 times, most recently from a2744e1 to 15eda88 Compare August 24, 2026 08:04
@hvitved
hvitved force-pushed the rust/canonical-path-blanket branch from 15eda88 to b12b1d0 Compare August 24, 2026 08:05
@hvitved hvitved 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 owner August 24, 2026 11:16
Copilot AI balanced review requested due to automatic review settings August 24, 2026 11:16

Copilot AI 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
File Description
rust/ql/lib/codeql/rust/internal/PathResolution.qll Implements blanket-implementation paths.
rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected Records expected canonical paths.
rust/ql/test/library-tests/dataflow/models/main.rs Adds blanket-model test cases.
rust/ql/test/library-tests/dataflow/models/external_file.rs Adds an inherited trait-model fixture.
rust/ql/test/library-tests/dataflow/models/models.ext.yml Defines explicit model paths.
rust/ql/test/library-tests/dataflow/models/models.expected Records 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 redsun82 August 24, 2026 13:12

@redsun82 redsun82 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:main Aug 24, 2026
21 checks passed
@hvitved
hvitved deleted the rust/canonical-path-blanket branch August 24, 2026 13:32
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.

3 participants