Rollup of 14 pull requests - #160507
Closed
JonathanBrouwer wants to merge 147 commits into
Closed
Conversation
But only if the source is code passed to the macro, not code inside the macro.
With `#[allow(rust_analyzer::inactive_code)]`.
See added comment for rationale. Also note that `rand` has defaulted to LE for many years, apparently without any objections.
Currently JsonLinesParser::from_line is called for both stdout and stderr, so trait implementers cannot distinguish stdout and stderr. Define a separate JsonLinesParser::from_stderr_line to make the stdout/stderr distinction explicit, and update use sites. This is not a behaviour change. AI disclosure: Partially written by Codex and GPT-5.5.
…lens fix: Respect `references.exclude[Tests/Imports]` in references lens
feat: Support inactive-code diagnostic in macros
When encountering a for loop that requires a mutable iterator item, we previously suggested changing the method on the iterated expression, but ignored bindings. We now go to the binding's definition and suggest changing the method there too.
```
error[E0594]: cannot assign to `v.v`, which is behind a `&` reference
--> $DIR/suggest-mut-method-for-loop-hashmap.rs:31:9
|
LL | for (_k, v) in x {
| - this iterator yields `&` references
...
LL | v.v += 1;
| ^^^^^^^^ `v` is a `&` reference, so it cannot be written to
|
help: use mutable method
|
LL | let mut x = map.iter_mut();
| ++++
```
Previously we read both stdout and stderr in the discover protocol. Depending on the tool generating rust-project JSON, this meant that a single stderr log message could break discovery. Instead, only look for JSON from the discover command's stdout, and forward stderr to the rust-analyzer logs. Update both the implementation and the discover protocol docs to reflect this behaviour. AI disclosure: Code partly written by GPT-5.5.
fix: Discover protocol should only parse stdout
fix: resolve path on all namespace on resolve_path
I noticed a few "its" versus "it's" grammatical issues, so I've done a pass at fixing obvious grammar issues. AI disclosure: I fixed the first few manually, then asked GPT-5.5 to look for additional cases and kept all the obviously reasonable fixes.
internal: Spelling and grammar fixes
…4-unicode-progress-report fix: make analysis-stats progress bar Unicode-safe
…_a_discriminant_type_larger_than_typeck_s fix: don't pick a discriminant type larger than typeck's
…c_on_a_qualified_path_whose_trait_is_not_a_trait fix: don't panic on a qualified path whose trait is not a trait
SemanticsImpl::find_file assumes that its caches always contain the file that
has the current SyntaxNode.
For macros `foo!()` we only have two files to worry about: the macro
call site and the macro definition site. Hoewver, for
include!("foo.rs") we also need to consider the included file.
Ensure that the file cache is consistently populated for include!()
invocations macro expansion, and add a test.
AI disclosure: GPT-5.5 used to minimise a repro from a real project
and write the initial implementation. Comments and commit message are
entirely mine.
…uded-file fix: Failed to lookup MACRO_CALL@... in this Semantics due to include!
Contributor
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 4, 2026
Rollup of 14 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-*
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
PR #159014, which is a member of this rollup, was unapproved. This rollup was thus unapproved. |
Contributor
|
💔 Test for 45047bc failed: CI. Failed job:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
rust-analyzersubtree update #160426 (rust-analyzersubtree update)doc(cfg())into account when filtering doctests #159014 ([rustdoc] Do not takedoc(cfg())into account when filtering doctests)E-needs-test#160407 (Add regression tests for a number of ICEs and diagnostics issues labelledE-needs-test)FreeRegionsVisitor#160486 (Remove unusedFreeRegionsVisitor)Failed merges:
r? @ghost
Create a similar rollup