Skip to content

Conversation

@paldepind
Copy link
Contributor

  • Fixes a type inference inconsistency where multiple certain types could be inferred for the same node due to match ergonomics/binding modes in pattern matching.
  • Makes inference of logical operators certain.
  • Makes inference of range expression certain and adds support for the .. range.

Copilot AI review requested due to automatic review settings August 27, 2025 12:01
@paldepind paldepind requested a review from a team as a code owner August 27, 2025 12:01
@github-actions github-actions bot added the Rust Pull requests that update Rust code label Aug 27, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refines Rust type inference by addressing inconsistencies in pattern matching, making logical operators have certain type inference, and adding support for range expressions including the .. (RangeFull) operator.

  • Fixes type inference inconsistency where multiple certain types could be inferred for the same node due to match ergonomics/binding modes in pattern matching
  • Makes inference of logical operators and range expressions certain
  • Adds support for the .. range expression (RangeFull)

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rust/ql/test/library-tests/type-inference/pattern_matching.rs Adds test cases for tuple pattern matching on references to verify binding mode fixes
rust/ql/test/library-tests/type-inference/main.rs Adds test for RangeFull range expression and minor struct formatting cleanup
rust/ql/lib/codeql/rust/internal/TypeInference.qll Core type inference logic updates: restricts certain type equality to IdentPat, moves logical/range operators to certain inference, and adds LetExpr type equality
rust/ql/lib/codeql/rust/frameworks/stdlib/Stdlib.qll Defines RangeFullStruct class for the core::ops::range::RangeFull type
rust/ql/lib/codeql/rust/elements/RangeExprExt.qll Adds RangeFullExpr class to represent .. range expressions

@paldepind paldepind added the no-change-note-required This PR does not need a change note label Aug 27, 2025
Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

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

Changes LGTM.

DCA

@paldepind paldepind merged commit 028f1cb into github:main Aug 27, 2025
20 of 21 checks passed
@paldepind paldepind deleted the rust/certain-extensions branch August 28, 2025 13:19
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.

2 participants