Skip to content

Rollup of 20 pull requests#152781

Closed
jhpratt wants to merge 41 commits intorust-lang:mainfrom
jhpratt:rollup-SVzPiL1
Closed

Rollup of 20 pull requests#152781
jhpratt wants to merge 41 commits intorust-lang:mainfrom
jhpratt:rollup-SVzPiL1

Conversation

@jhpratt
Copy link
Member

@jhpratt jhpratt commented Feb 18, 2026

Successful merges:

r? @ghost

Create a similar rollup

nickkuk and others added 30 commits February 5, 2026 16:34
…dness"

Because:
* Something like it did not exist before PR 107404
* That it is not run our mir-opt-level 0 indicates that it is not
  required for soundness
* Its `MirPass::can_be_overridden()` is unchanged and thus returns true,
  indicating that it is not a required MIR pass.
* No test fails in PR 151426 that stops enabling by default in non-optimized builds

As can be seen from the updated test `tests/mir-opt/optimize_none.rs`,
this means that `#[optimize(none)]` functions become even less
optimized. As expected and as desired.
* Find ref prefix span for owned suggestions
* Improve missing lifetime suggestions for `&mut str`
Remove "failed to resolve" and use the same format we use in other resolution errors "cannot find `name`".

```
error[E0433]: cannot find `nonexistent` in `existent`
  --> $DIR/custom_attr_multisegment_error.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ could not find `nonexistent` in `existent`
```
…range_end_end, r=davidtwco

Stop using rustc_layout_scalar_valid_range_* in rustc

Another step towards rust-lang#135996

Required some manual impls, but we already do many manual impls for the newtype_index types, so it's not really a new maintenance burden.
…r=petrochenkov

Unify wording of resolve error

Remove "failed to resolve" from the main error message and use the same format we use in other resolution errors "cannot find `name`":

```
error[E0433]: cannot find `nonexistent` in `existent`
  --> $DIR/custom_attr_multisegment_error.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ could not find `nonexistent` in `existent`
```

The intent behind this is to end up with all resolve errors eventually be on the form of

```
error[ECODE]: cannot find `{NAME}` in {SCOPE}
  --> $DIR/file.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ {SPECIFIC LABEL}
```

A category of errors that is interest are those that involve keywords. For example:

```
error[E0433]: cannot find `Self` in this scope
  --> $DIR/issue-97194.rs:2:35
   |
LL |     fn bget(&self, index: [usize; Self::DIM]) -> bool {
   |                                   ^^^^ `Self` is only available in impls, traits, and type definitions
```
and

```
error[E0433]: cannot find `super` in this scope
  --> $DIR/keyword-super.rs:2:9
   |
LL |     let super: isize;
   |         ^^^^^ there are too many leading `super` keywords
```

For these the label provides the actual help, while the message is less informative beyond telling you "couldn't find `name`".

This is an off-shoot of rust-lang#126810 and rust-lang#128086, a subset of the intended changes there with review comments applied.

r? @petrochenkov
…ffleLapkin

tail calls: fix copying non-scalar arguments to callee

Alternative to rust-lang#144933: when invoking a tail call with a non-scalar argument, we need to delay freeing the caller's local variables until after the callee is initialized, so that we can copy things from the caller to the callee.

Fixes rust-lang#144820... but as the FIXMEs in the code show, it's not clear to me whether these are the right semantics.
r? @WaffleLapkin
std: move `exit` out of PAL

This PR moves `exit` out of `sys::pal` (as per rust-lang#117276) and into a common module with `unique_thread_exit`.
…ired, r=cjgillot

compiler: Don't mark `SingleUseConsts` MIR pass as "required for soundness"

I don't think this MIR pass is required for soundness. The reasons are:
* Something like it was not enabled by default before PR rust-lang#107404 which was the precursor to `SingleUseConsts` (see rust-lang#125910 for the switch).
* By following the advice from rust-lang#128657 (comment) we can conclude it is not required for soundness since it has only ever run on MIR opt level > 0.
* Its [`MirPass::can_be_overridden()`](https://github.com/rust-lang/rust/blob/0ee7d96253f92b15115c94a530db8b79cb341b15/compiler/rustc_mir_transform/src/pass_manager.rs#L98-L102) is unchanged and thus returns `true`, indicating that it is not a required MIR pass.
* PR CI pass in rust-lang#151426 which stops enabling it by default in non-optimized builds.

As shown in the updated test `tests/mir-opt/optimize_none.rs`, `#[optimize(none)]` functions become even less optimized, as expected and desired.

Unblocks rust-lang#151426.
remove the explicit error for old `rental` versions

This was converted to a hard error 20 months ago (in rust-lang#125596). This seems like enough time for anyone still using it to notice, so remove the note entirely now.
In comparison, the explicit note for the more impactful `time` breakage was already removed after 6 months (rust-lang#129343).

Closes rust-lang#73933.
Closes rust-lang#83125.

r? @petrochenkov
Remove ShallowInitBox.

All uses of this were removed by rust-lang#148190
Split from rust-lang#147862

r? @RalfJung
Fix invalid `mut T` suggestion for `&mut T` in missing lifetime error

close: rust-lang#150077

When suggesting to return an owned value instead of a borrowed one, the diagnostic was only removing `&` instead of `&mut `, resulting in invalid syntax like `mut T`. This PR fixes the span calculation to properly cover the entire `&mut ` prefix.
…shadowing-incompatible-args, r=Kivooeo

Fix ICE in `suggest_param_env_shadowing` with incompatible args

Fixes rust-lang#152684
…zelmann

make `rustc_allow_const_fn_unstable` an actual `rustc_attrs` attribute

It is already named like one, but used to have its own feature gate, which this PR now removes in favor of just using `#![feature(rustc_attrs)]`.

Most of the diff is just the line number changes in `malformed-attrs.stderr`.
…ooeo

Miri: recursive validity: also recurse into Boxes

Now that rust-lang#97270 is fixed, the recursive validity mode for Miri can recuse into Boxes without exploding everywhere.
…ttmcm

carryless_mul: mention the base

Arithmetic operations do not typically care about the base that is used to represent numbers, but this one does. Mentioning that makes it easier to understand the operation, I think.

Cc @folkertdev
… r=fmease

Update tracking issue number for final_associated_functions

From rust-lang#151783 (comment)
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Feb 18, 2026
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 18, 2026
@jhpratt
Copy link
Member Author

jhpratt commented Feb 18, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 18, 2026

📌 Commit 44d9f42 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 Feb 18, 2026
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
REPOSITORY                                   TAG       IMAGE ID       CREATED       SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    afc745c7535d   3 weeks ago   783MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:faae3d3a1dedd24cde388bb506bbacc0f7ed1eae99ebac129af66acd8540c84a
deleted: sha256:afc745c7535da1bb12f92c273b9a7e9c52c3f12c5873714b2542da259c6d9769
deleted: sha256:64e147d5e54d9be8b8aa322e511cda02296eda4b8b8d063c6a314833aca50e29
deleted: sha256:5cba409bb463f4e7fa1a19f695450170422582c1bc7c0e934d893b4e5f558bc6
deleted: sha256:cddc6ebd344b0111eaab170ead1dfda24acdfe865ed8a12599a34d338fa8e28b
deleted: sha256:2412c3f334d79134573cd45e657fb6cc0abd75bef3881458b0d498d936545c8d
---
error[E0433]: failed to resolve: could not find `rustc_query_system` in the list of imported crates
   --> compiler/rustc_middle/src/middle/region.rs:144:1
    |
144 | / rustc_index::newtype_index! {
145 | |     /// Represents a subscope of `block` for a binding that is introduced
146 | |     /// by `block.stmts[first_statement_index]`. Such subscopes represent
147 | |     /// a suffix of the block. Note that each subscope does not include
...   |
165 | |     pub struct FirstStatementIndex {}
166 | | }
    | | ^
    | | |
---
error[E0433]: failed to resolve: could not find `rustc_query_system` in the list of imported crates
  --> compiler/rustc_middle/src/mir/coverage.rs:10:1
   |
10 | / rustc_index::newtype_index! {
11 | |     /// Used by [`CoverageKind::BlockMarker`] to mark blocks during THIR-to-MIR
12 | |     /// lowering, so that those blocks can be identified later.
13 | |     #[stable_hash]
...  |
16 | |     pub struct BlockMarkerId {}
17 | | }
   | | ^
   | | |
---
error[E0433]: failed to resolve: could not find `rustc_query_system` in the list of imported crates
  --> compiler/rustc_middle/src/mir/coverage.rs:19:1
   |
19 | / rustc_index::newtype_index! {
20 | |     /// ID of a coverage counter. Values ascend from 0.
21 | |     ///
22 | |     /// Before MIR inlining, counter IDs are local to their enclosing function.
...  |
33 | |     pub struct CounterId {}
34 | | }
---
error[E0433]: failed to resolve: could not find `rustc_query_system` in the list of imported crates
  --> compiler/rustc_middle/src/mir/coverage.rs:36:1
   |
36 | / rustc_index::newtype_index! {
37 | |     /// ID of a coverage-counter expression. Values ascend from 0.
38 | |     ///
39 | |     /// Before MIR inlining, expression IDs are local to their enclosing function.
...  |
50 | |     pub struct ExpressionId {}
51 | | }
---
error[E0433]: failed to resolve: could not find `rustc_query_system` in the list of imported crates
   --> compiler/rustc_middle/src/mir/coverage.rs:199:1
    |
199 | / rustc_index::newtype_index! {
200 | |     /// During the `InstrumentCoverage` MIR pass, a BCB is a node in the
201 | |     /// "coverage graph", which is a refinement of the MIR control-flow graph
202 | |     /// that merges or omits some blocks that aren't relevant to coverage.
...   |
213 | | }
    | | ^
    | | |
    | |_could not find `rustc_query_system` in the list of imported crates
---
error[E0433]: failed to resolve: could not find `rustc_query_system` in the list of imported crates
  --> compiler/rustc_middle/src/mir/query.rs:15:1
   |
15 | / rustc_index::newtype_index! {
16 | |     #[stable_hash]
17 | |     #[encodable]
18 | |     #[debug_format = "_s{}"]
19 | |     pub struct CoroutineSavedLocal {}
20 | | }
   | | ^
   | | |
   | |_could not find `rustc_query_system` in the list of imported crates
---
error[E0433]: failed to resolve: could not find `rustc_query_system` in the list of imported crates
    --> compiler/rustc_middle/src/mir/mod.rs:1263:1
     |
1263 | / rustc_index::newtype_index! {
1264 | |     /// A node in the MIR [control-flow graph][CFG].
1265 | |     ///
1266 | |     /// There are no branches (e.g., `if`s, function calls, etc.) within a basic block, which makes
...    |
1293 | | }
     | | ^
     | | |
     | |_could not find `rustc_query_system` in the list of imported crates
---
error[E0433]: failed to resolve: could not find `rustc_query_system` in the list of imported crates
    --> compiler/rustc_middle/src/mir/mod.rs:1419:1
     |
1419 | / rustc_index::newtype_index! {
1420 | |     #[stable_hash]
1421 | |     #[encodable]
1422 | |     #[debug_format = "scope[{}]"]
...    |
1426 | | }
     | | ^
     | | |
     | |_could not find `rustc_query_system` in the list of imported crates
---
error[E0433]: failed to resolve: could not find `rustc_query_system` in the list of imported crates
    --> compiler/rustc_middle/src/mir/mod.rs:1558:1
     |
1558 | / rustc_index::newtype_index! {
1559 | |     #[stable_hash]
1560 | |     #[encodable]
1561 | |     #[orderable]
1562 | |     #[debug_format = "promoted[{}]"]
1563 | |     pub struct Promoted {}
1564 | | }
     | | ^
     | | |
     | |_could not find `rustc_query_system` in the list of imported crates
---
  --> compiler/rustc_middle/src/thir.rs:46:13
   |
41 | /   macro_rules! thir_with_elements {
42 | |       (
43 | |           $($name:ident: $id:ty => $value:ty => $format:literal,)*
44 | |       ) => {
45 | |           $(
46 | | /             newtype_index! {
47 | | |                 #[stable_hash]
48 | | |                 #[debug_format = $format]
49 | | |                 pub struct $id {}
50 | | |             }
   | | |             ^
   | | |             |
   | | |_____________could not find `rustc_query_system` in the list of imported crates
   | |               in this macro invocation (#2)
...  |
87 | |   }
   | |___- in this expansion of `thir_with_elements!` (#1)
88 |
89 |   / thir_with_elements! {
90 |   |     arms: ArmId => Arm<'tcx> => "a{}",
91 |   |     blocks: BlockId => Block => "b{}",
92 |   |     exprs: ExprId => Expr<'tcx> => "e{}",
93 |   |     stmts: StmtId => Stmt<'tcx> => "s{}",
94 |   |     params: ParamId => Param<'tcx> => "p{}",
95 |   | }
   |   |_- in this macro invocation (#1)
   |
  ::: compiler/rustc_index_macros/src/lib.rs:48:1
   |
48 |     pub fn newtype_index(input: TokenStream) -> TokenStream {
   |     ------------------------------------------------------- in this expansion of `newtype_index!` (#2)
---
error[E0433]: failed to resolve: could not find `rustc_query_system` in the list of imported crates
   --> compiler/rustc_middle/src/ty/typeck_results.rs:718:1
    |
718 | / rustc_index::newtype_index! {
719 | |     #[stable_hash]
720 | |     #[encodable]
721 | |     #[debug_format = "UserType({})"]
...   |
725 | | }
    | | ^
    | | |
    | |_could not find `rustc_query_system` in the list of imported crates

@jhpratt jhpratt closed this Feb 18, 2026
@jhpratt jhpratt deleted the rollup-SVzPiL1 branch February 18, 2026 03:33
@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 18, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 18, 2026

PR #152569, which is a member of this rollup, was unapproved.
This rollup was thus also unapproved.

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

Labels

A-run-make Area: port run-make Makefiles to rmake.rs O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comments