Rollup of 14 pull requests#153507
Conversation
both operands of binary operators (including compound assignments like `+=`) were inferred with `ExprIsRead::No`, which prevented divergence detection for place expressions of type `!`. this caused false type mismatches when a function's return type depended on the block diverging after something like `x += *never_ptr` or `let _ = *never_ptr + 1`. both operands of any binary operator are always consumed (read), so this uses `ExprIsRead::Yes` to be consistent with the ordinary assignment and let binding paths.
Signed-off-by: arferreira <arfs.antonio@gmail.com>
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
Example
---
```rust
fn main() {
match 2 {
bar => &bar.l$0
}
}
```
**Before this PR**
```text
sn deref *expr
sn match match expr {}
```
**After this PR**
```text
sn deref *expr
sn let let
sn letm let mut
sn match match expr {}
```
Example
---
```rust
struct Foo { bar: i32, baz: i32 }
impl Foo {
fn foo(&mut $0self) {
self.bar = 5;
}
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
struct Foo { bar: i32, baz: i32 }
impl Foo {
fn foo(&mut self) {
let Foo { bar, baz } = self;
*bar = 5;
}
}
```
- Remove unused `ast::make::match_arm_with_guard`
Example
---
```rust
fn main() {
if true {
$0if true
&& false
{
foo()
}
}
}
```
**Before this PR**
```rust
fn main() {
if true {
match true
&& false {
true => foo(),
false => (),
}
}
}
```
**After this PR**
```rust
fn main() {
if true {
match true
&& false
{
true => foo(),
false => (),
}
}
}
```
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v3.1.2...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
fix: Fix wrong confiditon in `Visibility::min`
…er-coercion fix: use `ExprIsRead::Yes` for rhs of binary operators
…is_rust()` with rustc
…yarn/editors/code/minimatch-3.1.5 build(deps-dev): bump minimatch from 3.1.2 to 3.1.5 in /editors/code
Example
---
```rust
macro_rules! m { ($expr:expr) => {$expr}}
enum Test {
A,
B,
C,
}
fn foo(t: Test) {
m!(match t {
Test::A => (),
$0});
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
macro_rules! m { ($expr:expr) => {$expr}}
enum Test {
A,
B,
C,
}
fn foo(t: Test) {
m!(match t {
Test::A=>(),
Test::B => ${1:todo!()},
Test::C => ${2:todo!()},$0
});
}
```
This updates the rust-version file to e7d90c6.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@e7d90c6 Filtered ref: rust-lang/rust-analyzer@bf9b8b9 Upstream diff: rust-lang/rust@c78a294...e7d90c6 This merge was created using https://github.com/rust-lang/josh-sync.
Rustc pull update
rust-analyzer allows AI usage (see rust-lang#21314), but requires contributors to declare usage. This adds a rule file that improves LLM output quality and instructs the LLM to declare usage in commit messages. I've written the rules in CLAUDE.md, but also symlinked it to AGENTS.md so other LLM tools pick it up. ## Rules file contents (1) Instructions for both humans and AIs to declare AI usage. (2) Relevant commands for testing, linting and codegen. Note that I deliberately didn't include an overview of the project structure on a folder-by-folder basis. This can go stale, and there's some evidence that project structure can hurt LLM output quality overall. See the following paper: > Evaluating AGENTS.md: > Are Repository-Level Context Files Helpful for Coding Agents? > https://arxiv.org/pdf/2602.11988 ## Testing I exercised this change with the following contrived prompt. Note that in practice rust-analyzer is hitting review scaling limits for new code actions, but it was easy to test end-to-end. > Add a new code action that replaces the content of a string literal > with the text "banana". ... > commit it This produced a functional code action with both Codex and Claude, and in both cases the commit message mentioned that it was AI generated. Example commit message: Add "Replace string with banana" code action Add a new assist that replaces a string literal's content with "banana" when the cursor is on a STRING token. AI: Generated with Claude Code (claude-opus-4-6). I confirmed that the code action worked by testing a rust-analyzer build in Emacs, and also confirmed that the generated tests looked sensible. ## AI Usage Disclosures I wrote the first draft of the rules file with Opus 4.6, manually reviewed everything.
…nd-range fix: Fix wrong descend range for add_missing_match_arms
…s-rust Fix: align `is_rust()` with rustc by correcting constructor ABI in next solver
…fmease
Preserve parentheses around `Fn` trait bounds in pretty printer
The AST pretty printer was dropping parentheses around `Fn` trait bounds in `dyn`/`impl` types when additional `+` bounds were present. For example:
dyn (FnMut(&mut T) -> &mut dyn ResourceLimiter) + Send + Sync
was pretty-printed as:
dyn FnMut(&mut T) -> &mut dyn ResourceLimiter + Send + Sync
Without parens, `+ Send + Sync` binds to the inner `dyn ResourceLimiter` instead of the outer type, producing invalid Rust.
The parser already tracks parentheses via `PolyTraitRef.parens`, but `print_poly_trait_ref` never checked this field. This adds `popen()` and `pclose()` calls when `parens == Parens::Yes`.
|
@bors r+ rollup=never p=5 |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing a3ac2f2 (parent) -> 80282b1 (this PR) Test differencesShow 119 test diffsStage 0
Stage 1
Stage 2
Additionally, 87 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 80282b130679a654eaa22f028a908c51be53d436 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
📌 Perf builds for each rolled up PR:
previous master: a3ac2f21b3 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
Finished benchmarking commit (80282b1): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.1%, secondary 0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.8%, secondary -0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 481.299s -> 482.9s (0.33%) |
Successful merges:
rust-analyzersubtree update #153466 (rust-analyzersubtree update)ValTreeKind::Branch(Box<[I::Const]>)changed toList#152593 (Box inValTreeKind::Branch(Box<[I::Const]>)changed toList)offset_of!error recovery #153495 (Fix ICE inoffset_of!error recovery)check_aligntoparse_alignment#153189 (refactor: movecheck_aligntoparse_alignment)Fntrait bounds in pretty printer #153483 (Preserve parentheses aroundFntrait bounds in pretty printer)r? @ghost
Create a similar rollup