Skip to content

Rust: Rename type inference test inline expectation tag #20037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

paldepind
Copy link
Contributor

@paldepind paldepind commented Jul 14, 2025

#19993 changed the inline expectations in the type inference test such that all function calls (and not just method calls) are annotated by using getStaticTarget in the tests. This makes the tag name method a bit inaccurate.

This PR changes the tag name to target.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jul 14, 2025
@paldepind paldepind marked this pull request as ready for review July 14, 2025 09:26
@Copilot Copilot AI review requested due to automatic review settings July 14, 2025 09:26
@paldepind paldepind requested a review from a team as a code owner July 14, 2025 09:27
Copy link
Contributor

@Copilot 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 renames the inline expectation tag from "method" to "target" in the Rust type inference test to better reflect the change made in #19993, where getStaticTarget was introduced to annotate all function calls (not just method calls). The tag name "target" is more accurate since it now covers both method calls and function calls.

Reviewed Changes

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

Show a summary per file
File Description
rust/ql/test/library-tests/type-inference/type-inference.ql Updates the query to use "target" tag instead of "method" in relevant tag definitions
rust/ql/test/library-tests/type-inference/type-inference.expected Updates test expectations to reflect the tag name change
rust/ql/test/library-tests/type-inference/pattern_matching.rs Updates inline comments to use "target" tag instead of "method"
rust/ql/test/library-tests/type-inference/main.rs Updates inline comments to use "target" tag instead of "method"
rust/ql/test/library-tests/type-inference/loop/main.rs Updates inline comment to use "target" tag
rust/ql/test/library-tests/type-inference/dereference.rs Updates inline comments to use "target" tag instead of "method"
rust/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll Adds constructor check to ExpectationComment class

@paldepind paldepind added the no-change-note-required This PR does not need a change note label Jul 14, 2025
@@ -4,6 +4,8 @@ private import codeql.util.test.InlineExpectationsTest

module Impl implements InlineExpectationsTestSig {
class ExpectationComment extends R::Comment {
ExpectationComment() { this.fromSource() }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was a comment inside the standard library starting with $target, so I had to limit expectations comments to those inside the source, which seems right in any case.

geoffw0
geoffw0 previously approved these changes Jul 14, 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.

Yep this is better, LGTM.

@paldepind
Copy link
Contributor Author

I've merged main.

@paldepind paldepind merged commit 87a8dcc into github:main Jul 14, 2025
19 checks passed
@paldepind paldepind deleted the rust/type-inference-rename-expectations branch July 14, 2025 13:54
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