Skip to content

Rustc pull update#2854

Merged
reddevilmidzy merged 18 commits intomainfrom
rustc-pull
Apr 27, 2026
Merged

Rustc pull update#2854
reddevilmidzy merged 18 commits intomainfrom
rustc-pull

Conversation

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

Latest update from rustc.

The rustc-josh-sync Cronjob Bot and others added 18 commits March 31, 2026 20:37
Crash tests are always expected to crash during compilation, so there is no
sensible meaning for specifying a pass/fail expectation in a crash test.
…pratt

Generalize IO Traits for `Arc<T>` where `&T: IoTrait`

ACP: rust-lang/libs-team#755
Tracking issue: rust-lang/rust#154046
Related: rust-lang/rust#94744

## Description

After experimenting with rust-lang/rust#155625, I noticed `Seek` and `SeekFrom` can almost be moved to `core::io`. Unfortunately, the implementation of `Seek` for `Arc<File>` is a blocker for such a move, since `Arc` is not a fundamental type. This PR attempts to resolve this potential blocker by replacing the implementation with a more general alternative. An internal trait `IoHandle` has been added which types can implement to opt-in to `Read`/`Write`/`Seek` implementations for `Arc<Self>` as long as `&Self` implements said trait. Note that `BufRead` is excluded as the signature for `fill_buf` would require returning from a temporary.

Since this "blanket" implementation only applies to a single type which already implements the same traits, I believe this should have no user-facing impact.

If this PR was merged, rust-lang/rust#134190 could be replaced with a 2 line PR:
```rust
impl IoHandle for TcpStream {}
impl IoHandle for UnixStream {}
```
Likewise for any other types, a table of which can be found [here](rust-lang/libs-team#504 (comment)). This is out of scope for this PR to avoid the need for an ACP.

---

## Notes

* See [this comment](rust-lang/rust#154046 (comment)) for further details.
* No AI tooling of any kind was used during the creation of this PR.
Move and clean up some ui test

`ui/reserved` -> `ui/keyword`
`ui/deref-patterns` -> `ui/pattern/deref-patterns`
`ui/unknown-unstable-lints` -> `ui/lint/unknown-lints`

Tests related to unknown_lints that were located above lint have also been moved to a subdirectory, and duplicate tests have been deleted.

And delete unnecessary `//@ check-fail`

r? Kivooeo
Avoid query cycles in DataflowConstProp

Fixes rust-lang/rust#155376 by skipping coroutines.
…ejrs,petrochenkov

Eliminate `CrateMetadataRef`.

There are a number of things I dislike about `CrateMetadataRef`.
- It contains two fields `cstore` and `cdata`. The latter points to data within the former. It's like having an `Elem` type that has a reference to a vec element and also a reference to the vec itself. Weird.
- The `cdata` field gets a lot of use, and the `Deref` impl just derefs that field. The `cstore` field is rarely used.
- `CrateMetadataRef` is not a good name.
- Variables named `cdata` sometimes refer to values of this type and sometimes to values of type `CrateMetadata`, which is confusing.

The good news is that `CrateMetadataRef` is not necessary and can be replaced with `&CrateMetadata`. Why? Everywhere that `CrateMetadataRef` is used, a `TyCtxt` is also present, and the `CStore` is accessible from the `TyCtxt` with `CStore::from_tcx`.

So this commit removes `CrateMetadataRef` and replaces all its uses with `&CrateMetadata`. Notes:
- This requires adding only two uses of `CStore::from_tcx`, which shows how rarely the `cstore` field was used.
- `get_crate_data` now matches `get_crate_data_mut` more closely.
- A few variables are renamed for consistency, e.g. `data`/`cmeta` -> `cdata`.
- An unnecessary local variable (`local_cdata`) in `decode_expn_id` is removed.
- All the `CrateMetadataRef` methods become `CrateMetadata` methods, and their receiver changes from `self` to `&self`.
- `RawDefId::decode_from_cdata` is inlined and removed, because it has a single call site.

r? @mejrs
Add `Sender` diagnostic item for `std::sync::mpsc::Sender`

Similar to the existing `Receiver` item, it will be used in Clippy to detect uses of `is_disconnected` that are racy.

Tracking issue: rust-lang/rust#153668
Suggested: rust-lang/libs-team#748 (comment)
… r=mu001999

Syntactically reject tuple index shorthands in struct patterns to fix a correctness regression

Split out of PR rust-lang/rust#154492. This fixes a correctness regression introduced in PR rust-lang/rust#81235 from 2021. Crater was run in my other PR and didn't report any real regressions (rust-lang/rust#154492 (comment)); a rerun has been issued for a few spurious builds (rust-lang/rust#154492 (comment)) but I'm certain it won't find anything either.

This is a theoretical breaking change that doesn't need any T-lang input IMHO since it's such a minute, niche and crystal clear bug that's not worth bothering them with (such a decision is not unprecedented). I'm adding it to the compatibility section of the release notes as is customary.

The Reference doesn't need updating since it didn't adopt this bug and thus accurately describes this part of the grammar as it used to be before 2021-02-23 and as it's meant to be.

The majority of the diff is doc comment additions & necessary UI test restructurings.
…p1-threads, r=jieyouxu

Remove myself as a maintainer of `wasm32-wasip1-threads`

Over time the landscape for myself has changed, and I no longer would like to be officially listed as a maintainer of this target in Rust, so I'm going to step down. There are still a number of others listed on this target, however, so I'm sure they can address issues should they come up.
…thanBrouwer

Remove `AttributeLintKind` variants - part 7

Part of rust-lang/rust#153099.

It's the last easy one. Next one will require to get the crate name and to pass `Session` to the remaining lints. Fun times ahead. :)

r? @JonathanBrouwer
Forbid `*-pass` and `*-fail` directives in tests/crashes

Crash tests are always expected to crash during compilation, so there is no sensible meaning for specifying a pass expectation or a run-fail expectation in a crash test.

It could conceivably be useful to use failure expectations to specify whether a crash test requires codegen in order to crash, but currently none of the crash tests try to do that. If that functionality is desired in the future, we can always look into re-adding it after the internals of pass/fail expectations have been cleaned up a bit.

---

After this change, pass/fail directives are only allowed in UI tests, which should make it easier to overhaul and simplify their implementation.

r? jieyouxu
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#155684 (Generalize IO Traits for `Arc<T>` where `&T: IoTrait`)
 - rust-lang/rust#155081 (Move and clean up some ui test)
 - rust-lang/rust#155379 (Avoid query cycles in DataflowConstProp)
 - rust-lang/rust#155663 (Eliminate `CrateMetadataRef`.)
 - rust-lang/rust#155669 (Add `Sender` diagnostic item for `std::sync::mpsc::Sender`)
 - rust-lang/rust#155698 (Syntactically reject tuple index shorthands in struct patterns to fix a correctness regression)
 - rust-lang/rust#155703 (Remove myself as a maintainer of `wasm32-wasip1-threads`)
 - rust-lang/rust#155706 (Remove `AttributeLintKind` variants - part 7)
 - rust-lang/rust#155712 (Forbid `*-pass` and `*-fail` directives in tests/crashes)
…=tgross35

compiler-builtins subtree update

Subtree update of `compiler-builtins` to rust-lang/compiler-builtins@4d3ab86.

Created using https://github.com/rust-lang/josh-sync.

Closes: rust-lang/rust#155653
Update LLVM to 22.1.4

Unlocks rust-lang/rust#155249.

I made a new branch that removes CI checks for macOS and reverts rust-lang/llvm-project@24b53fb.
privacy: Assert that compared visibilities are (usually) ordered



And make "greater than" (`>`) the new primary operation for comparing visibilities instead of "is at least" (`>=`).
This updates the rust-version file to ca9a134e0985765ded9cfdde4030a5df4db7e2bd.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 27, 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 Apr 27, 2026
@reddevilmidzy reddevilmidzy merged commit aa58530 into main Apr 27, 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 Apr 27, 2026
tshepang pushed a commit to tshepang/rust that referenced this pull request Apr 30, 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.

5 participants