Skip to content

Rust: upgrade to rust-analyzer 0.0.300 #20055

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

redsun82
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jul 15, 2025
@@ -4,6 +4,20 @@

query predicate instances(AsmExpr x) { toBeTested(x) and not x.isUnknown() }

query predicate getExtendedCanonicalPath(AsmExpr x, string getExtendedCanonicalPath) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.
toBeTested(x) and not x.isUnknown() and getExtendedCanonicalPath = x.getExtendedCanonicalPath()
}

query predicate getCrateOrigin(AsmExpr x, string getCrateOrigin) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.
toBeTested(x) and not x.isUnknown() and getCrateOrigin = x.getCrateOrigin()
}

query predicate getAttributeMacroExpansion(AsmExpr x, MacroItems getAttributeMacroExpansion) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.
@redsun82 redsun82 added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Aug 5, 2025
@redsun82 redsun82 changed the title Rust: upgrade to rust 1.88 and rust-analyzer 0.0.294 Rust: upgrade to rust-analyzer 0.0.294 Aug 12, 2025
@github-actions github-actions bot added the Ruby label Aug 12, 2025
@redsun82 redsun82 changed the title Rust: upgrade to rust-analyzer 0.0.294 Rust: upgrade to rust-analyzer 0.0.300 Aug 12, 2025
import codeql.rust.elements.FieldExpr
import codeql.rust.elements.FieldList
import codeql.rust.elements.FnPtrTypeRepr
import codeql.rust.elements.ForBinder

Check warning

Code scanning / CodeQL

Redundant import Warning

Redundant import, the module is already imported inside
codeql.rust.elements.ClosureExpr
.
Redundant import, the module is already imported inside
codeql.rust.elements.ForTypeRepr
.
Redundant import, the module is already imported inside
codeql.rust.elements.TypeBound
.
Redundant import, the module is already imported inside
codeql.rust.elements.WherePred
.
@@ -4,6 +4,20 @@

query predicate instances(AsmExpr x) { toBeTested(x) and not x.isUnknown() }

query predicate getExtendedCanonicalPath(AsmExpr x, string getExtendedCanonicalPath) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.
toBeTested(x) and not x.isUnknown() and getExtendedCanonicalPath = x.getExtendedCanonicalPath()
}

query predicate getCrateOrigin(AsmExpr x, string getCrateOrigin) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.
toBeTested(x) and not x.isUnknown() and getCrateOrigin = x.getCrateOrigin()
}

query predicate getAttributeMacroExpansion(AsmExpr x, MacroItems getAttributeMacroExpansion) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.
@@ -37,8 +37,8 @@
toBeTested(x) and not x.isUnknown() and getBody = x.getBody()
}

query predicate getClosureBinder(ClosureExpr x, ClosureBinder getClosureBinder) {
toBeTested(x) and not x.isUnknown() and getClosureBinder = x.getClosureBinder()
query predicate getForBinder(ClosureExpr x, ForBinder getForBinder) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.

query predicate instances(ForBinder x) { toBeTested(x) and not x.isUnknown() }

query predicate getGenericParamList(ForBinder x, GenericParamList getGenericParamList) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.
@@ -4,8 +4,8 @@

query predicate instances(ForTypeRepr x) { toBeTested(x) and not x.isUnknown() }

query predicate getGenericParamList(ForTypeRepr x, GenericParamList getGenericParamList) {
toBeTested(x) and not x.isUnknown() and getGenericParamList = x.getGenericParamList()
query predicate getForBinder(ForTypeRepr x, ForBinder getForBinder) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.
@@ -13,6 +13,10 @@
if x.isConst() then isConst = "yes" else isConst = "no"
}

query predicate getForBinder(TypeBound x, ForBinder getForBinder) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.
@@ -4,8 +4,8 @@

query predicate instances(WherePred x) { toBeTested(x) and not x.isUnknown() }

query predicate getGenericParamList(WherePred x, GenericParamList getGenericParamList) {
toBeTested(x) and not x.isUnknown() and getGenericParamList = x.getGenericParamList()
query predicate getForBinder(WherePred x, ForBinder getForBinder) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning generated test

This predicate starts with 'get' but does not return a value.
@redsun82 redsun82 removed the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Aug 15, 2025
@redsun82 redsun82 marked this pull request as ready for review August 15, 2025 08:20
@redsun82 redsun82 requested review from a team as code owners August 15, 2025 08:20
@Copilot Copilot AI review requested due to automatic review settings August 15, 2025 08:20
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 upgrades the rust-analyzer version from 0.0.299 to 0.0.300 as indicated by the title. The upgrade brings updates to the Rust AST schema and affects test expectations across various CodeQL test suites due to improved location precision and renamed AST nodes.

  • Updates the Rust AST schema with structural changes including renaming ClosureBinder to ForBinder
  • Introduces the ForBinder as a more general construct for closure and type parameter bindings
  • Updates dependency versions and test expectations to match the improved rust-analyzer output

Reviewed Changes

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

File Description
shared/tree-sitter-extractor/Cargo.toml Updates the rand dependency from version 0.9.1 to 0.9.2
rust/schema/ast.py Major AST schema changes: renames ClosureBinder to ForBinder, adds Item inheritance to AsmExpr, and updates field references
rust/schema/annotations.py Updates documentation and annotations to reflect the renaming from ClosureBinder to ForBinder
Multiple .expected files Updates test expectations to reflect improved location precision from the rust-analyzer upgrade

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ruby Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant