Skip to content

Rust: Change canonical paths for trait items - #22376

Draft
hvitved wants to merge 4 commits into
mainfrom
hvitved-rust-canonical-paths
Draft

Rust: Change canonical paths for trait items#22376
hvitved wants to merge 4 commits into
mainfrom
hvitved-rust-canonical-paths

Conversation

@hvitved

@hvitved hvitved commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • use crate::Trait::item canonical paths for Rust trait items instead of <_ as crate::Trait>::item
  • update Rust library models, tests, generated expectations, and documentation to the new format
  • add a change note for custom data extension model authors

Testing

  • regenerated affected Rust CodeQL test expectations with codeql test run --learn
  • all 38 affected tests passed

hvitved and others added 3 commits August 19, 2026 09:42
Use `crate::Trait::foo` instead of `<_ as crate::Trait>::foo` for trait items.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5a15104d-a9a3-4506-8325-203af6db47f8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5a15104d-a9a3-4506-8325-203af6db47f8
@github-actions github-actions Bot added documentation Rust Pull requests that update Rust code labels Aug 19, 2026
@hvitved
hvitved requested a balanced review from Copilot August 19, 2026 08:31

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

Changes Rust trait-item canonical paths to the simpler Trait::item format and migrates affected models, documentation, and generated expectations.

Changes:

  • Updates canonical-path generation for trait items.
  • Migrates Rust library and test models to the new format.
  • Updates documentation, change notes, and generated expectations.
Show a summary per file
File Description
rust/ql/test/query-tests/security/CWE-918/RequestForgery.expected Regenerates request-forgery expectations.
rust/ql/test/query-tests/security/CWE-798/HardcodedCryptographicValue.expected Regenerates cryptographic-value expectations.
rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected Regenerates allocation-size expectations.
rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected Regenerates logging expectations.
rust/ql/test/query-tests/security/CWE-117/LogInjection.expected Regenerates log-injection expectations.
rust/ql/test/query-tests/security/CWE-079/warp/XSS.expected Regenerates Warp XSS expectations.
rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected Regenerates tainted-path expectations.
rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected Updates string data-flow expectations.
rust/ql/test/library-tests/dataflow/sources/web_frameworks/InlineFlow.expected Updates web-framework model expectations.
rust/ql/test/library-tests/dataflow/sources/env/InlineFlow.expected Updates environment-source expectations.
rust/ql/test/library-tests/dataflow/sources/database/InlineFlow.expected Updates database-source expectations.
rust/ql/test/library-tests/dataflow/models/models.ext.yml Migrates test extension models.
rust/ql/test/library-tests/dataflow/models/models.expected Regenerates model expectations.
rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected Updates modeled-flow expectations.
rust/ql/test/library-tests/dataflow/local/inline-flow.expected Updates local-flow expectations.
rust/ql/test/library-tests/dataflow/global/inline-flow.expected Updates global-flow expectations.
rust/ql/test/library-tests/dataflow/collections/inline-flow.expected Updates collection-flow expectations.
rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected Verifies new extracted canonical paths.
rust/ql/lib/codeql/rust/internal/PathResolution.qll Implements the new trait-item path format.
rust/ql/lib/codeql/rust/frameworks/warp.model.yml Migrates Warp trait models.
rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml Migrates Tokio I/O trait models.
rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml Migrates standard I/O trait models.
rust/ql/lib/codeql/rust/frameworks/stdlib/core.model.yml Migrates core trait models.
rust/ql/lib/codeql/rust/frameworks/stdlib/alloc.model.yml Migrates allocation trait models.
rust/ql/lib/codeql/rust/frameworks/sqlx.model.yml Migrates SQLx trait models.
rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml Migrates RustCrypto trait models.
rust/ql/lib/codeql/rust/frameworks/mysql.model.yml Migrates MySQL trait models.
rust/ql/lib/codeql/rust/frameworks/mysql-async.model.yml Migrates asynchronous MySQL models.
rust/ql/lib/codeql/rust/frameworks/futures.model.yml Migrates Futures I/O models.
rust/ql/lib/codeql/rust/frameworks/asyncstd/io.model.yml Migrates async-std I/O models.
rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll Updates an internal path reference.
rust/ql/lib/change-notes/2026-08-19-trait-canonical-paths.md Documents the model migration.
docs/codeql/codeql-language-guides/customizing-library-models-for-rust.rst Documents the new canonical-path syntax.

Review details

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

  • Files reviewed: 39/39 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants