Skip to content

Rollup of 7 pull requests#155766

Merged
rust-bors[bot] merged 15 commits intorust-lang:mainfrom
jhpratt:rollup-EcXAaqS
Apr 25, 2026
Merged

Rollup of 7 pull requests#155766
rust-bors[bot] merged 15 commits intorust-lang:mainfrom
jhpratt:rollup-EcXAaqS

Conversation

@jhpratt
Copy link
Copy Markdown
Member

@jhpratt jhpratt commented Apr 25, 2026

Successful merges:

r? @ghost

Create a similar rollup

Amanieu and others added 15 commits April 23, 2026 11:17
Since call destinations are evaluated after call arguments, we can't
turn copy arguments into moves if the same local is later used as an
index projection in the call destination.
This made it very annoying to debug bootstrap itself, because every
`--dry-run` invocation would start out by cloning LLVM, which is almost
never necessary. Instead change a few Steps to properly support dry_run
when no submodule is checked out.
…t-dollar-suggestion, r=eholk

Improve suggestion for $-prefixed fragment specifiers

Fixes rust-lang#155505
… r=adwinwhite

Avoid redundant clone suggestions in borrowck diagnostics

Fixes rust-lang#153886

Removed redundant `.clone()` suggestions.

I found that there are two patterns to handle this issue while I was implementing:

- Should suggest only UFCS
- Should suggest only simple `.clone()`

For the target issue, we can just remove the UFCS (`<Option<String> as Clone>::clone(&selection.1)`) side.

However, for the `BorrowedContentSource::OverloadedDeref` pattern like `Rc<Vec<i32>>`, for instance the `borrowck-move-out-of-overloaded-auto-deref.rs` test case, I think we need to employ the UFCS way. The actual test case is:

```rust
//@ run-rustfix
use std::rc::Rc;

pub fn main() {
    let _x = Rc::new(vec![1, 2]).into_iter();
    //~^ ERROR [E0507]
}
```

And another error will be shown if we simply use the simple `.clone()` pattern. Like:

```rust
use std::rc::Rc;

pub fn main() {
    let _x = Rc::new(vec![1, 2]).clone().into_iter();
}
```

then we will get

```
error[E0507]: cannot move out of an `Rc`
   --> src/main.rs:5:14
    |
  5 |     let _x = Rc::new(vec![1, 2]).clone().into_iter();
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ----------- value moved due to this method call
    |              |
    |              move occurs because value has type `Vec<i32>`, which does not implement the `Copy` trait
    |
note: `into_iter` takes ownership of the receiver `self`, which moves value
   --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/collect.rs:310:18
    |
310 |     fn into_iter(self) -> Self::IntoIter;
    |                  ^^^^
help: you can `clone` the value and consume it, but this might not be your desired behavior
    |
  5 -     let _x = Rc::new(vec![1, 2]).clone().into_iter();
  5 +     let _x = <Vec<i32> as Clone>::clone(&Rc::new(vec![1, 2])).into_iter();
    |

For more information about this error, try `rustc --explain E0507`.
```

[Rust Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=7e767bed3f1c573c03642f20f454ed03)

In this case, `Rc::clone` only increments the reference count and returns a new `Rc<Vec<i32>>`; it does not grant ownership of the inner `Vec<i32>`. As a result, calling into_iter() attempts to move the `Vec<i32>`, leading to the same E0507 error again.

On the other hand, in UFCS form:

```
<Vec<i32> as Clone>::clone(&Rc::new(vec![1, 2])).into_iter()
```

This explicitly calls `<Vec<i32> as Clone>::clone`, and the argument `&Rc<Vec<i32>>` is treated as `&Vec<i32>` via Rc’s `Deref` implementation. As a result, the `Vec<i32>` itself is cloned, yielding an owned `Vec<i32>`, which allows `into_iter()` to succeed, if my understanding is correct.

I addressed the issue as far as I could find the edge cases but please advice me if I'm overlooking something.
…illot

Handle index projections in call destinations in DSE

Since call destinations are evaluated after call arguments, we can't turn copy arguments into moves if the same local is later used as an index projection in the call destination.

DSE call arg optimization: rust-lang#113758

r? @cjgillot
cc @RalfJung
bootstrap: Don't clone submodules unconditionally in dry-run

This made it very annoying to debug bootstrap itself, because every `--dry-run` invocation would start out by cloning LLVM, which is almost never necessary. Instead change a few Steps to properly support dry_run when no submodule is checked out.

I tested this by running all of `check`, `build`, `doc`, `dist`, `install`, `vendor`, `clippy`, `fix`, and `miri` with `--dry-run`.
…youxu

Account for `GetSyntheticValue` failures

`GetSyntheticValue` returns an invalid `SBValue` if no synthetic is present. That wasn't a problem before when we  were attaching synthetics to every type, but it won't be the case once github.com/rust-lang/pull/155336 or similar lands. Additionally, codelldb subverts `lldb_commands` to apply similar behavior that doesn't attach synthetics to every type, so this fixes a regression there too.

Additionally, I removed 1 useless instance of `GetSyntheticValue`, since pointers should always be `IndirectionSyntheticProvider`, not `DefaultSyntheticProvider`.
Pass fields to `is_tuple_fields` instead of `SBValue` object

straightforward fix for a logic error. `is_tuple_fields` expects a `list`, so we pass that in instead of the value object.

Coincidentally, this also fixes one of the 3 DI tests that fails on `x86_64-pc-windows-gnu` (`tests/debuginfo/union-smoke.rs`)
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Apr 25, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 25, 2026
@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Apr 25, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 25, 2026

📌 Commit 84fd561 has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 25, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 25, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 25, 2026

☀️ Test successful - CI
Approved by: jhpratt
Duration: 3h 18m 45s
Pushing 7e0430f to main...

@rust-bors rust-bors Bot merged commit 7e0430f into rust-lang:main Apr 25, 2026
12 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 25, 2026
@rust-timer
Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#154197 Avoid redundant clone suggestions in borrowck diagnostics bae7c978d4cfd95ed7ff5f872c90d53faf5cdae7 (link)
#154372 Exposing Float Masks 863518e1e913d2e547310bef8b8dade316ee9827 (link)
#155643 Improve suggestion for $-prefixed fragment specifiers 10f9f939caaafc4f46014589d9ed1e10c05bce87 (link)
#155680 Handle index projections in call destinations in DSE 0d080cf5bf3ef7e7fc6eebe05767c3d639346c0f (link)
#155732 bootstrap: Don't clone submodules unconditionally in dry-run 71daffd7cc181754fe355d74182f49c417d39de7 (link)
#155737 Account for GetSyntheticValue failures 4a8eff7a09500f9bba9670b9a06426c06384a4aa (link)
#155738 Pass fields to is_tuple_fields instead of SBValue object 42b0b5b339f5ba946399940330d649b77ab00dfe (link)

previous master: 0a4ee3f74b

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@github-actions
Copy link
Copy Markdown
Contributor

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 0a4ee3f (parent) -> 7e0430f (this PR)

Test differences

Show 753 test diffs

Stage 1

  • [ui] tests/ui/suggestions/ufcs-for-deref-inner-clone.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/suggestions/ufcs-for-deref-inner-clone.rs: [missing] -> pass (J0)
  • [run-make] tests/run-make/compressed-debuginfo-zstd: ignore (ignored if LLVM wasn't build with zstd for ELF section compression or LLVM is not the default codegen backend) -> pass (J2)

Additionally, 750 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 7e0430fafc66bd0fdfaff94e65148a1f207438cd --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. pr-check-1: 37m 18s -> 20m 54s (-43.9%)
  2. x86_64-rust-for-linux: 1h 2m -> 35m 58s (-42.6%)
  3. x86_64-gnu-tools: 1h 17m -> 55m 27s (-28.1%)
  4. dist-powerpc64-linux-gnu: 1h 13m -> 1h 33m (+27.0%)
  5. x86_64-msvc-2: 2h -> 2h 31m (+26.1%)
  6. pr-check-2: 53m 55s -> 39m 58s (-25.9%)
  7. x86_64-gnu-miri: 1h 46m -> 1h 22m (-22.8%)
  8. optional-x86_64-gnu-parallel-frontend: 2h 56m -> 2h 18m (-21.8%)
  9. armhf-gnu: 1h 45m -> 1h 22m (-21.7%)
  10. dist-x86_64-apple: 1h 54m -> 2h 18m (+21.0%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (7e0430f): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (secondary -0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.4% [1.0%, 3.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.3% [-6.3%, -6.3%] 1
All ❌✅ (primary) - - 0

Cycles

Results (primary -3.0%, secondary -20.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-20.9% [-21.8%, -19.9%] 2
All ❌✅ (primary) -3.0% [-3.0%, -3.0%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 492.019s -> 491.487s (-0.11%)
Artifact size: 394.25 MiB -> 394.23 MiB (-0.00%)

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

Labels

merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants