Skip to content

Rust: Use angle brackets for trait item canonical paths - #22457

Open
hvitved wants to merge 3 commits into
mainfrom
hvitved-angle-bracket-trait-paths
Open

Rust: Use angle brackets for trait item canonical paths#22457
hvitved wants to merge 3 commits into
mainfrom
hvitved-angle-bracket-trait-paths

Conversation

@hvitved

@hvitved hvitved commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This follows up on #22376 by making canonical paths for trait items consistent with inherent implementation paths. Trait items now use <crate::Trait>::item instead of crate::Trait::item.

DCA is uneventful.

hvitved and others added 2 commits August 28, 2026 10:38
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4e7f3f7f-82b3-403c-93fa-984f56c89a70
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added documentation Rust Pull requests that update Rust code labels Aug 28, 2026
@hvitved
hvitved marked this pull request as ready for review August 31, 2026 07:40
@hvitved
hvitved requested review from a team as code owners August 31, 2026 07:40
@hvitved
hvitved requested review from redsun82 and a balanced review from Copilot August 31, 2026 07:40

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.

Copilot review overview

🟡 Changes recommended

The new migration note conflicts with the existing August 19 note, and the public PR description links an inaccessible internal repository.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity rust/​ql/​lib/​change-notes/​2026-08-28-angle-bracket-trait-canonical-paths.md — The existing rust/ql/lib/change-notes/2026-08-19-trait-canonical-paths.md:4-6 still tells users…
What changed in this PR

Updates Rust trait-item canonical paths to align with inherent implementation syntax and exact Models-as-Data matching.

Changes:

  • Produces <crate::Trait>::item canonical paths.
  • Migrates framework models and documentation.
  • Refreshes generated extractor, dataflow, and query expectations.
File Description
docs/​codeql/​codeql-language-guides/​customizing-library-models-for-rust.rst Documents the new syntax.
rust/​ql/​lib/​change-notes/​2026-08-28-angle-bracket-trait-canonical-paths.md Adds migration guidance.
rust/​ql/​lib/​codeql/​rust/​internal/​PathResolution.qll Wraps trait prefixes in angle brackets.
rust/​ql/​lib/​codeql/​rust/​dataflow/​internal/​DataFlowImpl.qll Updates the canonical-path reference.
rust/​ql/​lib/​codeql/​rust/​frameworks/​asyncstd/​io.model.yml Migrates async-std trait models.
rust/​ql/​lib/​codeql/​rust/​frameworks/​futures.model.yml Migrates futures trait models.
rust/​ql/​lib/​codeql/​rust/​frameworks/​mysql-async.model.yml Migrates async MySQL models.
rust/​ql/​lib/​codeql/​rust/​frameworks/​mysql.model.yml Migrates MySQL models.
rust/​ql/​lib/​codeql/​rust/​frameworks/​rustcrypto/​rustcrypto.model.yml Migrates cryptographic trait models.
rust/​ql/​lib/​codeql/​rust/​frameworks/​sqlx.model.yml Migrates the SQLx executor model.
rust/​ql/​lib/​codeql/​rust/​frameworks/​stdlib/​alloc.model.yml Migrates allocation-library models.
rust/​ql/​lib/​codeql/​rust/​frameworks/​stdlib/​core.model.yml Migrates core trait models.
rust/​ql/​lib/​codeql/​rust/​frameworks/​stdlib/​io.model.yml Migrates standard I/O models.
rust/​ql/​lib/​codeql/​rust/​frameworks/​tokio/​io.model.yml Migrates Tokio I/O models.
rust/​ql/​lib/​codeql/​rust/​frameworks/​warp.model.yml Migrates Warp filter models.
rust/​ql/​test/​extractor-tests/​canonical_path/​canonical_paths.expected Updates canonical-path expectations.
rust/​ql/​test/​library-tests/​dataflow/​collections/​inline-flow.expected Refreshes collection-flow expectations.
rust/​ql/​test/​library-tests/​dataflow/​global/​inline-flow.expected Refreshes global-flow expectations.
rust/​ql/​test/​library-tests/​dataflow/​local/​inline-flow.expected Refreshes local-flow expectations.
rust/​ql/​test/​library-tests/​dataflow/​modeled/​inline-flow.expected Refreshes modeled-flow expectations.
rust/​ql/​test/​library-tests/​dataflow/​models/​models.ext.yml Migrates test extension models.
rust/​ql/​test/​library-tests/​dataflow/​models/​models.expected Refreshes model expectations.
rust/​ql/​test/​library-tests/​dataflow/​sources/​database/​InlineFlow.expected Refreshes database-source expectations.
rust/​ql/​test/​library-tests/​dataflow/​sources/​env/​InlineFlow.expected Refreshes environment-source expectations.
rust/​ql/​test/​library-tests/​dataflow/​sources/​web_frameworks/​InlineFlow.expected Refreshes web-source expectations.
rust/​ql/​test/​library-tests/​dataflow/​strings/​inline-taint-flow.expected Refreshes string-flow expectations.
rust/​ql/​test/​library-tests/​dataflow/​taint/​inline-taint-flow.expected Refreshes taint-flow expectations.
rust/​ql/​test/​query-tests/​security/​CWE-022/​TaintedPath.expected Refreshes path-query expectations.
rust/​ql/​test/​query-tests/​security/​CWE-078/​CommandInjection.expected Refreshes command-query expectations.
rust/​ql/​test/​query-tests/​security/​CWE-079/​warp/​XSS.expected Updates the Warp source path.
rust/​ql/​test/​query-tests/​security/​CWE-089/​SqlInjection.expected Refreshes SQL-query expectations.
rust/​ql/​test/​query-tests/​security/​CWE-117/​LogInjection.expected Refreshes log-query expectations.
rust/​ql/​test/​query-tests/​security/​CWE-312/​CleartextLogging.expected Refreshes logging expectations.
rust/​ql/​test/​query-tests/​security/​CWE-614/​InsecureCookie.expected Refreshes cookie-query expectations.
rust/​ql/​test/​query-tests/​security/​CWE-798/​HardcodedCryptographicValue.expected Updates the cryptographic model path.
rust/​ql/​test/​query-tests/​security/​CWE-918/​RequestForgery.expected Updates the Warp source path.

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

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