Skip to content

Comments

Rollup of 9 pull requests#152924

Merged
rust-bors[bot] merged 24 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-vnwkCh0
Feb 21, 2026
Merged

Rollup of 9 pull requests#152924
rust-bors[bot] merged 24 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-vnwkCh0

Conversation

@JonathanBrouwer
Copy link
Contributor

Successful merges:

r? @ghost

Create a similar rollup

JonathanBrouwer and others added 24 commits February 10, 2026 22:10
Since llvm/llvm-project 159143, llvm no longer weak links the __cpp_exception tag into
each object that uses it. They are now defined in compiler-rt. Rust doesn't seem to
get them from compiler-rt so llvm decides they need to be imported. This adds them to
libunwind.
inline rest of the check
try fix ci errors
inline in check_let
As far as I can tell it was introduced to allow fat LTO with
-Clinker-plugin-lto. Later a change was made to automatically disable
ThinLTO summary generation when -Clinker-plugin-lto -Clto=fat is used,
so we can safely remove it.
…r=petrochenkov

Not linting irrefutable_let_patterns on let chains

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/146832)*

# Description

this PR makes the lint `irrefutable_let_patterns` not check for `let chains`,
only check for single `if let`, `while let`, and `if let guard`.

# Motivation

Since `let chains` were stabilized, the following code has become common:

```rust
fn max() -> usize { 42 }

fn main() {
    if let mx = max() && mx < usize::MAX { /* */ }
}
```

This code naturally expresses "please call that function and then do something if the return value satisfies a condition".
Putting the let binding outside the if would be bad as then it remains in scope after the if, which is not the intent.

Current Output:

```bash
warning: leading irrefutable pattern in let chain
 --> src/main.rs:7:8
  |
7 |     if let mx = max() && mx < usize::MAX {
  |        ^^^^^^^^^^^^^^
  |
  = note: this pattern will always match
  = help: consider moving it outside of the construct
  = note: `#[warn(irrefutable_let_patterns)]` on by default
```

Another common case is progressively destructuring a struct with enum fields, or an enum with struct variants:

```rust
struct NameOfOuterStruct {
    middle: NameOfMiddleEnum,
    other: (),
}
enum NameOfMiddleEnum {
    Inner(NameOfInnerStruct),
    Other(()),
}
struct NameOfInnerStruct {
    id: u32,
}

fn test(outer: NameOfOuterStruct) {
    if let NameOfOuterStruct { middle, .. } = outer
        && let NameOfMiddleEnum::Inner(inner) = middle
        && let NameOfInnerStruct { id } = inner
    {
        /* */
    }
}
```

Current Output:

```bash
warning: leading irrefutable pattern in let chain
  --> src\main.rs:17:8
   |
17 |     if let NameOfOuterStruct { middle, .. } = outer
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this pattern will always match
   = help: consider moving it outside of the construct
   = note: `#[warn(irrefutable_let_patterns)]` on by default

warning: trailing irrefutable pattern in let chain
  --> src\main.rs:19:12
   |
19 |         && let NameOfInnerStruct { id } = inner
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this pattern will always match
   = help: consider moving it into the body
```

To avoid the warning, the readability would be much worse:

```rust
fn test(outer: NameOfOuterStruct) {
    if let NameOfOuterStruct {
        middle: NameOfMiddleEnum::Inner(NameOfInnerStruct { id }),
        ..
    } = outer
    {
        /* */
    }
}
```

# related issue

* rust-lang#139369

# possible questions

1. Moving the irrefutable pattern at the head of the chain out of it would cause a variable that was intended to be temporary to remain in scope, so we remove it.
   However, should we keep the check for moving the irrefutable pattern at the tail into the body?

2. Should we still lint `entire chain is made up of irrefutable let`?

---

This is my first time contributing non-documentation code to Rust. If there are any irregularities, please feel free to point them out.
: )
…ate, r=petrochenkov

Support importing path-segment keyword with renaming

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/146972)*

#### Reference PR

- rust-lang/reference#2010
- rust-lang/reference#2136

#### Description

This PR unifies and extends the behavior of importing path-segment keywords (`crate`/`$crate`/`super`/`self`), resolving several long-standing inconsistencies.

Previously, Rust only allowed `use crate as name;` without renaming support for other path keywords. This PR enables importing these keywords with explicit renaming. And it also denies importing these keywords without renaming.

##### What's now allowed

For **`crate`** and **`$crate`**:
- `use crate as name;`
- `use crate::{self as name};`
- `use $crate as name;`
- `use $crate::{self as name};`

For **`super`** (including chained `super::super`):
- `use super as name;`
- `use super::{self as name};`
- `use super::super as name;`
- `use super::super::{self as name};`

For **`self`**:
- `use self as name;`
- `use self::{self as name};`

##### Removed error codes

Two error codes are no longer emitted:

- **E0430**: Previously emitted for duplicate `self` imports like `std::fmt::{self, self}`. The existing E0252 ("name defined multiple times") provides sufficient guidance.
- **E0431**: Previously emitted for `use {self [as name]};` and `use ::{self [as name]};`. These patterns are now allowed or denied but with new clearer errors.
    - For `use {self as name};` and `use ::{self as name};` (in edition 2015), they are allowed now and equivalent to `use crate as name`;
    - For `use {self};` and `use ::{self};` (in edition 2015) without renaming, they are equivalent to `use crate;`, the new clearer error suggests adding an explicit rename.
    - For `use ::{self [as name]};` after edition 2015, it is equivalent to `use ${extern-prelude} [as name];`, it is denied with new errors.

##### Future

We plan to remove error [E0429](https://doc.rust-lang.org/stable/error_codes/E0429.html#error-code-e0429) and support `self` at the end of paths (rust-lang#146972 (comment)). This language extension and lint for redundant `::self` instead of hard error `E0429` will be landed separately in the future.

---

Fixes rust-lang#29036
Fixes rust-lang#35612
Fixes rust-lang#37156
Fixes rust-lang#146967
Fixes rust-lang#149811

r? petrochenkov
…ption, r=alexcrichton

For panic=unwind on Wasm targets, define __cpp_exception tag

Since llvm/llvm-project#159143, llvm no longer weak links the __cpp_exception tag into each object that uses it. They are now defined in compiler-rt. Rust doesn't seem to get them from compiler-rt so llvm decides they need to be imported. This adds them to libunwind.

Same changes applied to compiler-builtins: rust-lang/compiler-builtins#1077

See wasm-bindgen/wasm-bindgen#4938 for a downstream workaround.

cc @sbc100
…uviper

Remove -Zemit-thin-lto flag

As far as I can tell it was introduced in rust-lang#98162 to allow fat LTO with `-Clinker-plugin-lto`. In rust-lang#136840 a change was made to automatically disable ThinLTO summary generation when `-Clinker-plugin-lto -Clto=fat` is used, so we can safely remove it.

Fixes rust-lang#152490
…coieni

Do not cancel try builds after first job failure

Suggested by @ZuseZ4, who was doing a bunch of parallel try builds recently.

r? @marcoieni
…tests, r=petrochenkov

Add tests for delegation generics

This PR adds tests from rust-lang#151864 as discussed in this [comment](rust-lang#151864 (comment)). Part of rust-lang#118212.

The majority of new tests are added in `mapping` folder, (`ast-hir-engine` folder in rust-lang#151864), those tests test mapping between generic params of delegee and our generated function for delegation (that is why the name of the folder was changed, I think it better reflects what those tests testing). In each mapping test comments were added to each test case and one comment describing the goal of mapping tests was added at the top of each file.

Next, tests for defaults in generic params (`generic-params-defaults.rs`), params with the same name (`generic-params-same-names`), errors in providing user-specified generic args (`generics-gen-args-errors.rs`) and wrong signature of a generated function in impl trait case (`impl-trait-wrong-args-count.rs`, renamed from `wrong-args-count-ice.rs` in rust-lang#151864). `generic-aux-pass.rs` test was not added, as all reuses in this test produce known ICE `DefId::expect_local DefId(..) isn't local` rust-lang#143498 (which will be fixed in rust-lang#151864, however it will not close mentioned issue, as synthetic generic params are not yet supported in new generics implementation).

r? @petrochenkov
…, r=jdonszelmann

Remove the translation `-Z` options and the `Translator` type.

This PR implements MCP rust-lang/compiler-team#967

It is split up into individually reviewable commits, each commit passes tests:

* rust-lang@6782119 Removes the translation compiler options from the session
* rust-lang@8f300d0 Removes the now empty `Translator` type
* rust-lang@ab715c5 Renames `translate_message` to `format_diag_message`, as the function no longer does any translation
* rust-lang@8bcbc3f Removes a section describing the removed compiler options from the rustc dev guide
Skip the `use_existential_projection_new_instead` field in the `Debug` impl

Resolves: rust-lang#152807 .

Simply slap a `#derive_where[skip(Debug)]` on that field.
…makai410

Expose Span for all DefIds in rustc_public

Part of rust-lang/project-stable-mir#118

To be maximally useful, `VariantDef` and `FieldDef` should be changed to be a wrapper around `DefId` instead of holding their parent and index. I can do this change in this PR or a follow-up if it is desired. For now, I added the missing `impl Stable for DefId` in internals so you can convert from rustc internals.
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Feb 20, 2026
@rustbot rustbot added A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic labels Feb 20, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc 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. labels Feb 20, 2026
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=2

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 20, 2026

📌 Commit 7655d93 has been approved by JonathanBrouwer

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 Feb 20, 2026
@JonathanBrouwer
Copy link
Contributor Author

JonathanBrouwer commented Feb 20, 2026

Trying commonly failed jobs because queue is large so we don't want rollups to fail
@bors try jobs=x86_64-msvc-1,i686-msvc-1,x86_64-mingw-1,test-various,armhf-gnu,aarch64-apple,x86_64-gnu-llvm-20-3,dist-various-2

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 20, 2026
Rollup of 9 pull requests


try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: test-various
try-job: armhf-gnu
try-job: aarch64-apple
try-job: x86_64-gnu-llvm-20-3
try-job: dist-various-2
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 21, 2026

☀️ Try build successful (CI)
Build commit: 84fe3cb (84fe3cb85a1b1f52d57822d1e770d957807c3d2b, parent: 0376d43d443cba463a0b6a6ec9140ea17d7b7130)

@jhpratt
Copy link
Member

jhpratt commented Feb 21, 2026

@bors p=3

moving ahead of stuck PR

@rust-bors rust-bors bot mentioned this pull request Feb 21, 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 Feb 21, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 21, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 51m 2s
Pushing 1c00e98 to main...

@rust-bors rust-bors bot merged commit 1c00e98 into rust-lang:main Feb 21, 2026
13 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 21, 2026
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#146832 Not linting irrefutable_let_patterns on let chains b8f4091f988faca31533b7f8b3085174c59d4197 (link)
#146972 Support importing path-segment keyword with renaming 8ce11ce5a41e170257b892a31ca39a7bdcb6fdc9 (link)
#152241 For panic=unwind on Wasm targets, define __cpp_exception tag 6526668597b1970e9e787968e6f03aeba464f657 (link)
#152455 Remove the translation -Z options and the Translator ty… 30613dd1a9db43130c9f20620d0d94c91dec1d6a (link)
#152527 Remove -Zemit-thin-lto flag 59f66e6f0a8aad58bd459c15bf47e194cdd76c2d (link)
#152769 Do not cancel try builds after first job failure 29fd5b88b51f883a4a0aca85325066052b4e3e3e (link)
#152813 Skip the use_existential_projection_new_instead field in … 220bc230a69d06e1e9b00009fda254ae90007292 (link)
#152907 Add tests for delegation generics 29c05cbd767e9b3646b414b114c39bfe9444ca62 (link)
#152912 Expose Span for all DefIds in rustc_public 0f6a966adf595f75a7f3f5536a29a20155a4f6c8 (link)

previous master: 0376d43d44

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
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 0376d43 (parent) -> 1c00e98 (this PR)

Test differences

Show 71 test diffs

Stage 1

  • [run-make] tests/run-make/translation: ignore (ignored always) -> [missing] (J0)
  • [ui] tests/ui/binding/irrefutable-in-let-chains.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/generic-params-defaults.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/generic-params-same-names.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/generics-gen-args-errors.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/impl-trait-wrong-args-count.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/mapping/free-to-free.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/mapping/free-to-trait.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/mapping/impl-trait-to-free.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/mapping/impl-trait-to-trait.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/mapping/inherent-impl-to-free.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/mapping/inherent-impl-to-trait.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/mapping/trait-to-free.rs: [missing] -> pass (J0)
  • [ui] tests/ui/delegation/generics/mapping/trait-to-trait.rs: [missing] -> pass (J0)
  • [ui] tests/ui/diagnostics-infra/primary-fluent-bundle-missing.rs: pass -> [missing] (J0)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs: [missing] -> pass (J0)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs#allowed: pass -> [missing] (J0)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs#disallowed: pass -> [missing] (J0)
  • [ui] tests/ui/use/use-path-segment-kw.rs: pass -> [missing] (J0)
  • [ui] tests/ui/use/use-path-segment-kw.rs#e2015: [missing] -> pass (J0)
  • [ui] tests/ui/use/use-path-segment-kw.rs#e2018: [missing] -> pass (J0)

Stage 2

  • [run-make] tests/run-make/translation: ignore (ignored always) -> [missing] (J1)
  • [ui] tests/ui/binding/irrefutable-in-let-chains.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/generic-params-defaults.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/generic-params-same-names.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/generics-gen-args-errors.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/impl-trait-wrong-args-count.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/mapping/free-to-free.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/mapping/free-to-trait.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/mapping/impl-trait-to-free.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/mapping/impl-trait-to-trait.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/mapping/inherent-impl-to-free.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/mapping/inherent-impl-to-trait.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/mapping/trait-to-free.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/generics/mapping/trait-to-trait.rs: [missing] -> pass (J2)
  • [ui] tests/ui/diagnostics-infra/primary-fluent-bundle-missing.rs: pass -> [missing] (J2)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs: [missing] -> pass (J2)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs#allowed: pass -> [missing] (J2)
  • [ui] tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs#disallowed: pass -> [missing] (J2)
  • [ui] tests/ui/use/use-path-segment-kw.rs: pass -> [missing] (J2)
  • [ui] tests/ui/use/use-path-segment-kw.rs#e2015: [missing] -> pass (J2)
  • [ui] tests/ui/use/use-path-segment-kw.rs#e2018: [missing] -> pass (J2)

Additionally, 29 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 1c00e989ca032d57e815e930fad00b61e65a1826 --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. dist-aarch64-linux: 1h 48m -> 2h 32m (+40.7%)
  2. aarch64-apple: 2h 47m -> 3h 44m (+34.2%)
  3. dist-aarch64-apple: 2h 48m -> 2h 16m (-18.9%)
  4. test-various: 1h 51m -> 2h 6m (+13.2%)
  5. armhf-gnu: 1h 22m -> 1h 32m (+11.9%)
  6. x86_64-msvc-ext1: 2h 15m -> 2h 3m (-9.0%)
  7. dist-aarch64-llvm-mingw: 1h 35m -> 1h 44m (+8.9%)
  8. dist-s390x-linux: 1h 33m -> 1h 25m (-8.7%)
  9. x86_64-gnu-llvm-20-2: 1h 32m -> 1h 40m (+8.4%)
  10. dist-x86_64-apple: 2h 48m -> 2h 36m (-7.1%)
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
Collaborator

Finished benchmarking commit (1c00e98): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 4.9%, secondary -1.6%)

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

mean range count
Regressions ❌
(primary)
4.9% [3.0%, 6.8%] 2
Regressions ❌
(secondary)
3.6% [3.6%, 3.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.9% [-6.9%, -6.9%] 1
All ❌✅ (primary) 4.9% [3.0%, 6.8%] 2

Cycles

Results (primary 2.6%)

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

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.6% [2.6%, 2.6%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 482.81s -> 480.967s (-0.38%)
Artifact size: 397.93 MiB -> 397.91 MiB (-0.00%)

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

Labels

A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.