Skip to content

Rollup of 10 pull requests#156834

Merged
rust-bors[bot] merged 22 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-TdEisIq
May 22, 2026
Merged

Rollup of 10 pull requests#156834
rust-bors[bot] merged 22 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-TdEisIq

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

Walnut356 and others added 22 commits April 27, 2026 01:03
…ulacrum

[Debug Info] Gracefully handle invalid `String`/`Vec`

Somewhat related to rust-lang#150392.

Currently the handling can throw an exception, which we should absolutely not do. It causes issues with debugger adapters (e.g. CodeLLDB will hang forever. Trying to stop the debugger via vscode's interface causes a CodeLLDB to leak memory constantly until RAM is depleted and the OS starts killing processes). The exception has been replaced with a printed error message and a placeholder value.

Additionally, if a String/Vec is in an "invalid" state due to niche optimization (`capacity >= (1 << 63)`, common with `Option<String>`/`Option<Vec<T>>`), the pointer and length values will be meaningless, but are not guaranteed to be 0'd. The debugger will happily proceed as if they are useful values, and often do things like \<try to read multiple GB of data from the debugee\>.

I added simple checks to ensure that the capacity and length are within bounds, and that the pointer is non-null. If any check fails, the string/vec just acts as if it's empty.

Eventually this problem will be solved on LLDB's end via llvm/llvm-project#188487 or similar, but preventing issues on our end in the short term will help a lot.

---

try-job: aarch64-apple
…clubby789

Install additional LLVM DLL on Windows

Fixes rust-lang#155268

The problem is that with shared linking to LLVM lib we have binaries requiring it in `$sysroot/bin` and `$sysroot/lib/rustlib/triple/bin`, but place the DLL only in the first location. On Unix systems rpath would take care of that, but on Windows the required DLL must be next to the binary or be found in PATH.

This PR puts another copy of the library into that second location. The size overhead of such copy compared to static linking is much lower than I anticipated even though I couldn't manage to make bootstrap create hard links.

The sizes without and with `llvm-tools` component:
```
❯ du --summarize -h .rustup/toolchains/{additional-dll,static}*
638M    .rustup/toolchains/additional-dll
800M    .rustup/toolchains/additional-dll-tools
608M    .rustup/toolchains/static-link
1.1G    .rustup/toolchains/static-link-tools
```
Statically linked LLD sits at 139M while dynamically linked one is 7.5M + 150M for the libLLVM, so the difference is minor.

Alternatively, we could require that on Windows, binaries located in `$sysroot/lib/rustlib/triple/bin` must always be called with `$sysroot/bin` in the PATH. However, that sounds like something that would require an announcement and some grace period.
…feature_hard_error_option, r=dingxiangfei2009

Allow forbidden target features to be hard errors

Sometimes when adding a new target features to the list of known target features, we want to completely forbid them from being used because they are ABI affecting and should be target modifiers instead. As such, we want to issue an error rather than a warning since there are no future compatibility concerns .

r? @workingjubilee since you're familiar with the motivating case in rust-lang#136597

If I rebase that PR on top of this locally, then we get the following error messages when trying to activate the SLS target feature (note that they are *errors* not *warnings* and we've omitted the usual note about future compatibility):

```
error: target feature `harden-sls-ijmp` cannot be enabled with `-Ctarget-feature`: use `harden-sls` compiler flag instead

error: target feature `harden-sls-ret` cannot be enabled with `-Ctarget-feature`: use `harden-sls` compiler flag instead

error: aborting due to 2 previous errors
```
…-compiler-doc-comments, r=jackh726

compiler: fix duplicated "the" in two doc-comments

Two one-line typo fixes for duplicated "the" in compiler doc-comments:
- `compiler/rustc_type_ir/src/solve/mod.rs` — "only if any of the the opaques in the opaque type storage has a hidden type" → "...any of the opaques in..."
- `compiler/rustc_borrowck/src/diagnostics/var_name.rs` — "/// Find the the name and span of the variable corresponding to the given region." → "/// Find the name and span of the variable corresponding to the given region."

No code/behavior change.
…diagnostic, r=jackh726

Remove stale RTN FIXME for assoc item constraint fallback

The old FIXME suggested that this diagnostic path should emit a `return_type_notation` feature-gate diagnostic.

That is no longer correct: RTN associated item constraints now use `(..)`, so a form like `Trait<method(): Bound>` is not made valid by enabling `return_type_notation`.

This PR removes the stale FIXME without changing the diagnostic behavior.
…contract, r=jackh726

Fix reborrow ICE in MIR place lowering

## Summary

Fixes rust-lang#156482.

This fixes an internal THIR/MIR contract inconsistency for generic reborrow expressions.

`ExprKind::Reborrow` is lowered into MIR as `Rvalue::Reborrow`, but MIR expression categorization treated it as place-like while `expr_as_place` treated evaluating it as a place as unreachable. That caused the rust-lang#156482 ICE, where the compiler panicked with `entered unreachable code` in `expr_as_place` while building MIR for a generic reborrow expression.

The fix makes the MIR builder contract explicit: a reborrow expression is rvalue-producing. Its source may be a place, but the reborrow expression itself is not an assignable place.

## What changed

- Updated MIR expression categorization so `ExprKind::Reborrow` is categorized as rvalue-producing rather than place-like.
- Updated place lowering so reborrow follows the normal rvalue temporary-materialization path if a place is needed.
- Added a targeted UI regression test covering the exact rust-lang#156482 repro.

cc @aapoalas
…aits, r=ytmimi

rustfmt: format const trait impls to `const impl` for syntax transition

Because this concerns rustc development (we want this in next beta) so that we can ensure by the next beta rustc can remove the parser support for `impl const Trait`, this PR is made against the r-l/r repo :)
…ided-infer-lt-rib, r=petrochenkov

delegation: visit body under elided-infer lifetime rib

Fixes rust-lang#156806. Part of rust-lang#118212.

r? @petrochenkov
…nnethercote

Turn `lint_index` from `Option<u16>` to `u16` for LintExpectationId

While doing lint attributes PR, I realised that the field `lint_index` didn't need to be Optional

(this PR is part of a series of PRs that will make the lint attrs PR more easily reviewable)

r? @nnethercote because you did rust-lang#156596 recently
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label May 22, 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-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels May 22, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 22, 2026

📌 Commit 29eaf53 has been approved by JonathanBrouwer

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 10. This pull request will be tested once the tree is reopened.

@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 May 22, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors p=10

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 22, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #155509 ([Debug Info] Gracefully handle invalid `String`/`Vec`)
 - #156229 (Install additional LLVM DLL on Windows)
 - #152821 (Allow forbidden target features to be hard errors)
 - #156560 (compiler: fix duplicated "the" in two doc-comments)
 - #156725 (Remove stale RTN FIXME for assoc item constraint fallback)
 - #156803 (Fix reborrow ICE in MIR place lowering)
 - #156815 (rustfmt: format const trait impls to `const impl` for syntax transition)
 - #156818 (Privacy: enqueue type alias)
 - #156820 (delegation: visit body under elided-infer lifetime rib)
 - #156829 (Turn `lint_index` from `Option<u16>` to `u16` for LintExpectationId)
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 22, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 22, 2026

💔 Test for 1a251dc failed: CI. Failed job:

@jieyouxu
Copy link
Copy Markdown
Member

Hm..
@bors retry

@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 May 22, 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 May 22, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 22, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 10m 23s
Pushing b52edc2 to main...

@rust-bors rust-bors Bot merged commit b52edc2 into rust-lang:main May 22, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone May 22, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors treeopen

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 22, 2026

Tree is now open for merging.

@rust-timer
Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#152821 Allow forbidden target features to be hard errors 56bffc3568ea18ffbb7fb13c0f0c2526561d0334 (link)
#155509 [Debug Info] Gracefully handle invalid String/Vec 23633b29d7d2e5c0f66bafe49fa0f5d3c5d72b67 (link)
#156229 Install additional LLVM DLL on Windows 6dfe1538862da5bbbf62eba16da18615642ae9d3 (link)
#156560 compiler: fix duplicated "the" in two doc-comments 7530a1b7a5afcf49a6dc45b44aa04fbf06075aff (link)
#156725 Remove stale RTN FIXME for assoc item constraint fallback 4829d62cb1c72bca28ccb4027164b75f53deea4f (link)
#156803 Fix reborrow ICE in MIR place lowering 4b9e1e21f8edf17f16932ab8de49eaa3a9241a28 (link)
#156815 rustfmt: format const trait impls to const impl for synta… 8b2e9ea1ce6f0481222129269101cf676335ae97 (link)
#156818 Privacy: enqueue type alias 3830cc01d2253ecd84a5e4dbbd4eb197a8d7e854 (link)
#156820 delegation: visit body under elided-infer lifetime rib 3276b24ce1ea8c0012734cac252d0f151973b19d (link)
#156829 Turn lint_index from Option<u16> to u16 for LintExpec… e846849ab65602271e4457d157332e0ff88ba9d4 (link)

previous master: 62f36da19c

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 62f36da (parent) -> b52edc2 (this PR)

Test differences

Show 17 test diffs

Stage 1

  • [ui] tests/ui/privacy/reach-type-alias-issue-156778.rs: [missing] -> pass (J2)
  • [ui] tests/ui/reborrow/generic-reborrow-rvalue-contract.rs: [missing] -> pass (J2)

Stage 2

  • [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 (J0)
  • [ui] tests/ui/privacy/reach-type-alias-issue-156778.rs: [missing] -> pass (J1)
  • [ui] tests/ui/reborrow/generic-reborrow-rvalue-contract.rs: [missing] -> pass (J1)

Additionally, 12 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 b52edc25bfbaa955b4b83c10f998e5224c3478b2 --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: 47m 56s -> 26m 19s (-45.1%)
  2. x86_64-rust-for-linux: 1h 15m -> 45m 44s (-39.5%)
  3. x86_64-gnu-llvm-21-1: 59m 56s -> 40m 21s (-32.7%)
  4. pr-check-2: 58m 39s -> 39m 43s (-32.3%)
  5. x86_64-gnu-gcc: 1h 28m -> 1h 1m (-30.0%)
  6. x86_64-gnu-tools: 1h 24m -> 1h (-28.4%)
  7. optional-x86_64-gnu-parallel-frontend: 3h 24m -> 2h 30m (-26.1%)
  8. x86_64-gnu-miri: 1h 58m -> 1h 28m (-24.7%)
  9. test-various: 2h 38m -> 2h 2m (-23.1%)
  10. i686-msvc-1: 2h 58m -> 2h 18m (-22.8%)
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 (b52edc2): 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 (primary 1.6%, secondary 0.7%)

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

mean range count
Regressions ❌
(primary)
3.1% [2.8%, 3.4%] 2
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-1.5% [-1.5%, -1.5%] 1
Improvements ✅
(secondary)
-0.8% [-0.8%, -0.8%] 1
All ❌✅ (primary) 1.6% [-1.5%, 3.4%] 3

Cycles

Results (secondary 3.4%)

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)
3.4% [3.0%, 3.9%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.1%, secondary -0.1%)

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)
-0.1% [-0.1%, -0.0%] 62
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 25
All ❌✅ (primary) -0.1% [-0.1%, -0.0%] 62

Bootstrap: 510.755s -> 513.181s (0.47%)
Artifact size: 400.62 MiB -> 400.52 MiB (-0.02%)

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-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.