Skip to content

Rust: upgrade rust-analyzer to 0.0.288 #19524

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
merged 19 commits into from
Jun 23, 2025
Merged

Rust: upgrade rust-analyzer to 0.0.288 #19524

merged 19 commits into from
Jun 23, 2025

Conversation

redsun82
Copy link
Contributor

@redsun82 redsun82 commented May 19, 2025

No description provided.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label May 19, 2025
@redsun82 redsun82 force-pushed the redsun82/cargo-upgrade-3 branch from cc2e8ab to 28b504a Compare May 26, 2025 14:21
@redsun82 redsun82 changed the title Rust: upgrade rust-analyzer to 0.0.279 Rust: upgrade rust-analyzer to 0.0.281 May 26, 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.

QL changes LGTM.

I've raised some questions on the DCA run, it looks like a net gain but there are some regressions in there that deserve discussing.

Extractor changes not reviewed.

@redsun82 redsun82 changed the title Rust: upgrade rust-analyzer to 0.0.281 Rust: upgrade rust-analyzer to 0.0.285 Jun 4, 2025
@redsun82 redsun82 marked this pull request as ready for review June 4, 2025 12:12
@redsun82 redsun82 requested review from a team as code owners June 4, 2025 12:12
@aibaars
Copy link
Contributor

aibaars commented Jun 5, 2025

Looks good to me. The additional path resolution inconsistencies are a bit annoying though. Any idea where they come from?

@geoffw0
Copy link
Contributor

geoffw0 commented Jun 5, 2025

Judging by the second DCA run it looks like we're extracting significantly fewer files successfully as well - though the run did fail so I don't want to read too much into that.

@redsun82
Copy link
Contributor Author

redsun82 commented Jun 5, 2025

Don't know, there are still loads of unexpanded macros around :sigh:

@redsun82
Copy link
Contributor Author

redsun82 commented Jun 5, 2025

I've opened rust-lang/rust-analyzer#19931 (as I couldn't reopen rust-lang/rust-analyzer#19873).

@redsun82 redsun82 marked this pull request as draft June 12, 2025 15:37
@redsun82 redsun82 changed the title Rust: upgrade rust-analyzer to 0.0.285 Rust: upgrade rust-analyzer to 0.0.287 Jun 13, 2025
@redsun82 redsun82 marked this pull request as ready for review June 13, 2025 15:58
@redsun82 redsun82 marked this pull request as draft June 13, 2025 16:26
@redsun82
Copy link
Contributor Author

oh well, there's a weird path resolution test error I'll need to look into on Monday :sigh:

@github-actions github-actions bot added the Swift label Jun 17, 2025
@redsun82 redsun82 marked this pull request as ready for review June 17, 2025 11:51
@redsun82 redsun82 requested a review from a team as a code owner June 17, 2025 11:51
@redsun82 redsun82 marked this pull request as draft June 17, 2025 11:51
@redsun82 redsun82 added the no-change-note-required This PR does not need a change note label Jun 17, 2025
@redsun82 redsun82 changed the title Rust: upgrade rust-analyzer to 0.0.287 Rust: upgrade rust-analyzer to 0.0.288 Jun 20, 2025
Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@@ -63,7 +63,7 @@ none()
{{#classes}}
{{#final}}
or
result = getImmediateChildOf{{name}}(e, index, partialAccessor)
index = min(int i | result = getImmediateChildOf{{name}}(e, i, partialAccessor) | i)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's revert this change.

if err.span().anchor.file_id == semantics.hir_file_for(node.syntax()) {
let hir_file_id = semantics.hir_file_for(node.syntax());
if Some(err.span().anchor.file_id.file_id())
== hir_file_id.file_id().map(|f| f.file_id(semantics.db))
Copy link
Contributor

Choose a reason for hiding this comment

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

how did you figure out that you needed the file_id of the file_id of the file_id of file_id ? ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

turtles all the way down... 🤷

@@ -363,10 +361,10 @@ impl<'a> Translator<'a> {
.as_ref()
.and_then(|s| s.expand_macro_call(mcall))
{
self.emit_macro_expansion_parse_errors(mcall, &expanded);
self.emit_macro_expansion_parse_errors(mcall, &expanded.value);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does expanded also have an err field? If so, let log it, hopefully it'll provide some useful information of why an expansion failed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the latest version of the PR does that

@aibaars
Copy link
Contributor

aibaars commented Jun 23, 2025

Don't forgot to commit empty expected files for

  FAILED: /home/runner/work/semmle-code/semmle-code/ql/rust/ql/test/extractor-tests/generated/Const/Const_getGenericParamList.ql
  FAILED: /home/runner/work/semmle-code/semmle-code/ql/rust/ql/test/extractor-tests/generated/Const/Const_getWhereClause.ql

@aibaars aibaars force-pushed the redsun82/cargo-upgrade-3 branch from 1823a22 to 13b28e2 Compare June 23, 2025 12:36
@redsun82 redsun82 marked this pull request as ready for review June 23, 2025 13:00
@redsun82 redsun82 merged commit 29b37a4 into main Jun 23, 2025
59 checks passed
@redsun82 redsun82 deleted the redsun82/cargo-upgrade-3 branch June 23, 2025 15:43
warnings
| included/included.rs:1:1:1:1 | semantic analyzer unavailable (not loaded as its own module, probably included by `!include`) |
| macro_expansion.rs:56:9:56:31 | macro expansion failed: could not resolve macro 'concat' |
Copy link
Contributor

Choose a reason for hiding this comment

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

Does these changes mean we expand fewer macros?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it does unfortunately. It is likely that the cause is the same as for rust-lang/rust-analyzer#20037 . See also the DCA report for more insight in the impact.

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.

4 participants