Skip to content

Rust: upgrade rust-analyzer to 0.0.288 - #19524

Merged
redsun82 merged 19 commits into
mainfrom
redsun82/cargo-upgrade-3
Jun 23, 2025
Merged

Rust: upgrade rust-analyzer to 0.0.288#19524
redsun82 merged 19 commits into
mainfrom
redsun82/cargo-upgrade-3

Conversation

@redsun82

@redsun82redsun82 commented May 19, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@github-actionsgithub-actionsBot added the Rust Pull requests that update Rust code label May 19, 2025
@redsun82
redsun82force-pushed the redsun82/cargo-upgrade-3 branch from cc2e8ab to 28b504aCompareMay 26, 2025 14:21
@redsun82redsun82 changed the title Rust: upgrade rust-analyzer to 0.0.279Rust: upgrade rust-analyzer to 0.0.281May 26, 2025

@geoffw0geoffw0 left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadrust/ql/test/library-tests/type-inference/type-inference.expected Outdated
@redsun82redsun82 changed the title Rust: upgrade rust-analyzer to 0.0.281Rust: upgrade rust-analyzer to 0.0.285Jun 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 ownersJune 4, 2025 12:12
@aibaars

Copy link
Copy Markdown
Contributor

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

@geoffw0

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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

@redsun82

Copy link
Copy Markdown
ContributorAuthor

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
@redsun82redsun82 changed the title Rust: upgrade rust-analyzer to 0.0.285Rust: upgrade rust-analyzer to 0.0.287Jun 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
Copy Markdown
ContributorAuthor

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

@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 ownerJune 17, 2025 11:51
@redsun82
redsun82 marked this pull request as draft June 17, 2025 11:51
@redsun82redsun82 added the no-change-note-required This PR does not need a change note label Jun 17, 2025
@redsun82redsun82 changed the title Rust: upgrade rust-analyzer to 0.0.287Rust: upgrade rust-analyzer to 0.0.288Jun 20, 2025

@aibaarsaibaars left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

{{#final}}
or
result = getImmediateChildOf{{name}}(e, index, partialAccessor)
index = min(int i | result = getImmediateChildOf{{name}}(e, i, partialAccessor) | i)

Copy link
Copy Markdown
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.

Comment threadrust/ast-generator/src/main.rs
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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... 🤷

.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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

Comment threadrust/extractor/src/translate/base.rs Outdated
Comment threadrust/extractor/src/translate/base.rs
Comment threadrust/ql/test/library-tests/dataflow/sources/InlineFlow.expected Outdated
@aibaars

Copy link
Copy Markdown
Contributor

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
aibaarsforce-pushed the redsun82/cargo-upgrade-3 branch from 1823a22 to 13b28e2CompareJune 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 mainJun 23, 2025
@redsun82
redsun82 deleted the redsun82/cargo-upgrade-3 branch June 23, 2025 15:43
| macro_expansion.rs:63:9:63:32 | include_str!... |
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
Copy Markdown
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
Copy Markdown
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.

@hvitved

Copy link
Copy Markdown
Contributor

Database build time, average 8 % speedup 🎉

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-requiredThis PR does not need a change noteRustPull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@redsun82@aibaars@geoffw0@hvitved