Rust: Change canonical paths for trait items - #22376
Draft
hvitved wants to merge 4 commits into
Draft
Conversation
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
Contributor
There was a problem hiding this comment.
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
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Summary
crate::Trait::itemcanonical paths for Rust trait items instead of<_ as crate::Trait>::itemTesting
codeql test run --learn