Skip to content

Rustc pull update#2863

Merged
reddevilmidzy merged 84 commits intomainfrom
rustc-pull
May 4, 2026
Merged

Rustc pull update#2863
reddevilmidzy merged 84 commits intomainfrom
rustc-pull

Conversation

@workflows-rustc-dev-guide
Copy link
Copy Markdown

Latest update from rustc.

RalfJung and others added 30 commits March 24, 2026 08:09
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 212b0d480f337082bbe1132d2b62be20e7e61f8a
Filtered ref: e8897faa70ed30070b7637e854418aa7aa5ea0d9
Upstream diff: rust-lang/rust@fd0c901...212b0d4

This merge was created using https://github.com/rust-lang/josh-sync.
GPU targets have convergent operations that must not be duplicated or
moved in or out of control-flow.
An example convergent operation is a barrier/syncthreads.

The only MIR pass affected by this is jump-threading, it can duplicate
calls. Disable jump-hreading for GPU targets to prevent generating
incorrect code.

This affects the amdgpu and nvptx targets.
freebsd sync: fix _umtx_time flags check to use bitwise operation.
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 12ab1cf1fd3dc925a846b0eb8a4b39393140fdd3
Filtered ref: 2df32b408f466131afc57abba520dcc01d9b130f
Upstream diff: rust-lang/rust@116458d...12ab1cf

This merge was created using https://github.com/rust-lang/josh-sync.
Add network socket `read`/`recv` and `write`/`send` shims
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 4c4205163abcbd08948b3efab796c543ba1ea687
Filtered ref: d09bed217e03a25403a0294a935c52309ae5d084
Upstream diff: rust-lang/rust@30d0309...4c42051

This merge was created using https://github.com/rust-lang/josh-sync.
Fix panic when multiple threads block on same fd
Remove artificial short reads/writes from TCP sockets
bump openssl-sys to support OpenSSL 4.0.x
…le-support

tree borrows (implicit writes): add support for #[rustc_no_writable]
…orn3

Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup

Relies on rust-lang/llvm-project#194.
Reland of rust-lang/rust#151771.

Previously this was not correctly implemented. Each funclet may need its own terminate block, so this changes the `terminate_block` into a `terminate_blocks` `IndexVec` which can have a terminate_block for each funclet. We key on the first basic block of the funclet -- in particular, this is the start block for the old case of the top level terminate function.

Rather than using a catchswitch/catchpad pair, I used a cleanuppad. The reason for the pair is to avoid catching foreign exceptions on MSVC. On wasm, it seems that the catchswitch/catchpad pair is optimized back into a single cleanuppad and a catch_all instruction is emitted which will catch foreign exceptions. Because the new logic is only used on wasm, it seemed better to take the simpler approach seeing as they do the same thing.

- [ ] Add test for rust-lang/rust#153948
Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets

Fixes rust-lang/rust#155830

glibc on RISC-V exports `_mcount`, not `mcount`. https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/riscv/machine-gmon.h;hb=HEAD

r? mati865 (I think you're well-suited to review this area, but feel free to reroll)
JonathanBrouwer and others added 26 commits May 2, 2026 10:18
…Lapkin

Make `diverging_type_vars` a vec of `TyVid`

r? @lcnr

The following changes, in separate commits:
* Make its elements a `TyVid`, since there should never by any other types than `TyVars` in there
* Make it a vec, since it being a set doesn't make much sense. You never really should do a `contains` on it, since you should normalize the tyvids in the set to their root var first.
Reuse CTFE MIR for constructors.

For constructors, we manually build the MIR shim we want. We can just have `optimized_mir` call `mir_for_ctfe` instead of rebuilding the shim.
compiler: Print valid `-Zmir-enable-passes` names if invalid name is used

If a user passes an invalid name to `-Zmir-enable-passes`, print the valid names as a note.

To avoid the annoyance of having to keep blessing test output, completely normalize away the list of names in the test.

The diagnostic is duplicated, but that is not introduced by this commit. In other words, we don't make matters worse. The existing "is unknown and will be ignored" diagnostic is already duplicated, as can be seen in the existing test stderr.

The output is on one long line, but that makes normalization in tests easier, and I don't think we have to overdo this. We can let terminals wrap the line.

<details>

<summary>Click to expand current output</summary>

`note: valid MIR pass names are: AbortUnwindingCalls, AddCallGuards, AddMovesForPackedDrops, AddRetag, CheckAlignment, CheckCallRecursion, CheckConstItemMutation, CheckDropRecursion, CheckEnums, CheckForceInline, CheckInlineAlwaysTargetFeature, CheckLiveDrops, CheckNull, CheckPackedRef, CleanupPostBorrowck, CopyProp, CtfeLimit, DataflowConstProp, DeadStoreElimination-final, DeadStoreElimination-initial, Derefer, DestinationPropagation, EarlyOtherwiseBranch, ElaborateBoxDerefs, ElaborateDrops, EnumSizeOpt, EraseDerefTemps, ForceInline, FunctionItemReferences, GVN, ImpossiblePredicates, Inline, InstSimplify-after-simplifycfg, InstSimplify-before-inline, InstrumentCoverage, JumpThreading, KnownPanicsLint, LowerIntrinsics, LowerSliceLenCalls, Marker, MatchBranchSimplification, MentionedItems, MultipleReturnTerminators, PostAnalysisNormalize, PreCodegen, PromoteTemps, ReferencePropagation, RemoveNoopLandingPads, RemovePlaceMention, RemoveStorageMarkers, RemoveUninitDrops, RemoveUnneededDrops, RemoveZsts, ReorderBasicBlocks, ReorderLocals, RequiredConstsVisitor, SanityCheck, ScalarReplacementOfAggregates, SimplifyCfg-after-unreachable-enum-branching, SimplifyCfg-final, SimplifyCfg-initial, SimplifyCfg-make_shim, SimplifyCfg-post-analysis, SimplifyCfg-pre-optimizations, SimplifyCfg-promote-consts, SimplifyCfg-remove-false-edges, SimplifyComparisonIntegral, SimplifyConstCondition-after-const-prop, SimplifyConstCondition-after-inst-simplify, SimplifyConstCondition-final, SimplifyLocals-after-value-numbering, SimplifyLocals-before-const-prop, SimplifyLocals-final, SingleUseConsts, SsaRangePropagation, StateTransform, StripDebugInfo, Subtyper, UnreachableEnumBranching, UnreachablePropagation, Validator`

</details>
…uwer

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#156030 (Make stable hashing names consistent (part 1))
 - rust-lang/rust#156020 (Improve source code for `librustdoc/visit_ast.rs`)
 - rust-lang/rust#156021 (Clean up some traits)
 - rust-lang/rust#156028 (Add a `Local::arg(i)` helper constructor)
 - rust-lang/rust#156037 (Add AcceptContext::expect_no_args)
 - rust-lang/rust#156040 (Add missing alias to mailmap)
 - rust-lang/rust#156048 (Make `diverging_type_vars` a vec of `TyVid`)
 - rust-lang/rust#156053 (Reuse CTFE MIR for constructors.)
 - rust-lang/rust#156059 (compiler: Print valid `-Zmir-enable-passes` names if invalid name is used)

Failed merges:

 - rust-lang/rust#155940 (refactor rustc_on_unimplemented's filtering)
 - rust-lang/rust#156065 (Remove unused spans from AttributeKind)
Add extra symbol check for `.to_owned()`

Follow up of rust-lang/rust#154646

Previously when adding a suggestion for using `Cow::into_owned()` instead of `ToOwned::to_owned()`, the compiler would just convert the methods `Span` into a `String` and do checks on that `String`. This PR adds an extra guard to that suggestion by checking if the method is `sym::to_owned_method`.

r? @davidtwco since you added the review to the previous PR
…s, r=Kivooeo

Move tests associated consts

r? @Kivooeo moved tests into associated-consts
…2009

Do not depend on typeck to borrow-check inline consts.

Instead fetch the type from the inline-const's MIR, which comes from exactly the same typeck information.
…uwer

Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#156074 (Add extra symbol check for `.to_owned()`)
 - rust-lang/rust#156045 (Move tests associated consts)
 - rust-lang/rust#156064 (Do not depend on typeck to borrow-check inline consts.)
 - rust-lang/rust#156083 (Move tests attributes)
feat: tid support to sched_getaffinity/sched_setaffinity
`-Znext-solver` Eager normalization outside of solver 




This PR adds a normalization routine for the next solver that behaves the same as the normalization in the old solver.
The new routine is used to normalize eagerly outside of the next solver.

This is [part 2](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/Eager.20normalization.2C.20ahoy.21/near/582996783) of modifying the next solver to support eager normalization.

Those test changes are mostly wording changes, duplicating some errors or reducing some duplicates. But I could have overlooked something.
Notably it fixes the first, third and fourth examples in rust-lang/trait-system-refactor-initiative#191, but not the second variant.

It's probably easier to review commit by commit.

Fixes rust-lang/rust#151308
Fixes rust-lang/rust#101557
Fixes rust-lang/rust#119692
Fixes rust-lang/rust#136859
Validate source snippet when format input is raw string



Fixes rust-lang/rust#114865

The issue occurred because the user's proc macro respanned the format arg to an unrelated multi-byte string and we ICE'd by landing in the middle of a multi-byte char.

This PR adds validation that prevents the parser from trying to walk such obviously wrong snippets. Such validation already existed for non-raw strings. This PR adds it for raw strings as well.
…uwer

Fix 'assign to data in an index of' collection suggestions

fixes rust-lang/rust#150001
fixes rust-lang/rust-analyzer#16076
fixes rust-lang/rust#134917

The issues are threefold and linked:
 1. Assigning data to a ~~collection~~BTreeMap/HashMap suggests 3 solutions all marked as `MachineApplicable`
 2. The suggestions are slightly wrong with regards to their borrowing needs.
 3. The suggestions are not guaranteed to produce code that is valid, and suggestion number two is equivalent to an update, not an insertion.

This PR:
 - splits the large triple suggestion into three
 - sets them to `MaybeIncorrect`
 - automatically determines the required borrowing to use.

 I think this solution may not be very elegant, expecially the key typechecking / borrowing part, but it works. I am however very open to any improvement/change :)

 edit: edited to replace 'collection' with  BTreeMap/HashMap'
…ShoyuVanilla

Rip out rustc_layout_scalar_valid_range_* attribute support

And either removes tests for it or replaces the uses with pattern types.

primarily fixes rust-lang/rust#135996

fixes rust-lang/rust#147761
fixes rust-lang/rust#133652
…omez

Hand-implement `impl Debug for NumBuffer` to avoid constraining `T` or printing MaybeUninit

The derived implementation requires `T: Debug`, and doesn't need to.
…uwer

Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#156073 ([rustdoc] Fix `doc_cfg` feature on reexports)
 - rust-lang/rust#152216 (Fix 'assign to data in an index of' collection suggestions)
 - rust-lang/rust#155433 (Rip out rustc_layout_scalar_valid_range_* attribute support)
 - rust-lang/rust#156098 (Hand-implement `impl Debug for NumBuffer` to avoid constraining `T` or printing MaybeUninit)
…xyUwU

Add `const_param_ty_unchecked` gate

Add `const_param_ty_unchecked` internal feature gate to skip `ConstParamTy_` trait enforcement on type. Provides an escape hatch for writing tests and examples that use const generics without needing to ensure all fields implement `ConstParamTy_`.

r? BoxyUwU
VaList::next_arg: track_caller for better Miri errors

The test diff should explain why this is better. :)

r? @folkertdev
…uwer

Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#153536 (Add `const_param_ty_unchecked` gate)
 - rust-lang/rust#155528 (const-stabilize `char::is_control()`)
 - rust-lang/rust#156086 (VaList::next_arg: track_caller for better Miri errors)
This updates the rust-version file to 045b17737dab5fcc28e4cbee0cfe2ce4ed363b32.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 4, 2026

Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using r? rustc-dev-guide or r? <username>.

@rustbot rustbot added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label May 4, 2026
@reddevilmidzy reddevilmidzy merged commit cefef0e into main May 4, 2026
1 check passed
@rustbot rustbot removed the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants