Skip to content

Conversation

@paldepind
Copy link
Contributor

@paldepind paldepind commented Jan 22, 2026

Changes the signature of getATypeParameterConstraint in the shared type inference library:

-  TypeMention getATypeParameterConstraint(TypeParameter tp);
+  Type getATypeParameterConstraint(TypeParameter tp, TypePath path);

The library does in fact not need a distinct value (instance of TypeMention) to represent the parameter constraint and the updated signature offers more flexibility to clients.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jan 22, 2026
@paldepind paldepind marked this pull request as ready for review January 22, 2026 14:39
@paldepind paldepind requested review from a team as code owners January 22, 2026 14:39
Copilot AI review requested due to automatic review settings January 22, 2026 14:39
@paldepind paldepind added the no-change-note-required This PR does not need a change note label Jan 22, 2026
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 refactors the getATypeParameterConstraint function in the shared type inference library to provide more flexibility to clients by changing its return type from TypeMention to Type and adding a TypePath parameter.

Changes:

  • Updated the signature of getATypeParameterConstraint to return Type instead of TypeMention and accept a TypePath parameter
  • Adapted the Rust-specific implementation to use the new signature by resolving types at the specified path
  • Simplified the usage in typeParameterConstraintHasTypeParameter by directly calling the updated function instead of using intermediate TypeMention variables

Reviewed changes

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

File Description
shared/typeinference/codeql/typeinference/internal/TypeInference.qll Updated function signature and simplified its usage in type parameter constraint checking
rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll Adapted implementation to resolve types at the specified path using exists clause

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

Assuming DCA is fine.

@paldepind
Copy link
Contributor Author

DCA is uneventful.

@paldepind paldepind merged commit e40f896 into github:main Jan 22, 2026
57 of 61 checks passed
@paldepind paldepind deleted the shared/ti-boound-tm branch January 22, 2026 18:09
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