Skip to content

Rollup of 6 pull requests - #154672

Closed
chenyukang wants to merge 18 commits into
rust-lang:mainfrom
chenyukang:rollup-kZc2P1h
Closed

Rollup of 6 pull requests#154672
chenyukang wants to merge 18 commits into
rust-lang:mainfrom
chenyukang:rollup-kZc2P1h

Conversation

@chenyukang

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

joshtriplettand others added 18 commits March 24, 2026 20:24
This allows traits in `core` to be sealed as well.
This could be the same trait as `std` via a re-export, but that would
require `core::sealed` to be `pub` (even if unstable). Keep them as
separate traits for now.
This provides `.truncate()`, `.saturating_truncate()`,
`.checked_truncate()`, and `.extend()`.
These only work within the same signedness (use `.cast_signed()` and
`.cast_unsigned()` to change sign).
The truncation methods only work to smaller (or equal) types.
`.extend()` only works to larger (or equal) types.
For the purposes of truncation and extending, `usize` is considered
larger than `u16` or `u8`. This is consistent with `From`/`Into`
conversions.
Adding these methods results in needing to update the output of one test
that gets a new method-name similarity result.
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
PR rust-lang#154634 recently renamed many type parameters that impl
`HashStableContext` as `Hcx`. It missed a few that are named `HirCtx`.
This commit renames them.
They're in multiple sections with no rhyme or reason.
`derive(HashStable_Generic)` generates impls like this:
```
impl<__CTX> HashStable<__CTX> for ExpnKind
where
__CTX: crate::HashStableContext
{
fn hash_stable(&self, hcx : &mut __CTX, __hasher: &mut StableHasher) {
...
}
}
```
This is used for crates that are upstream of `rustc_middle`.
The `crate::HashStableContext` bound means every crate that uses
`derive(HashStable_Generic)` must provide (or import) a trait
`HashStableContext` which `rustc_middle` then impls. In `rustc_span`
this trait is sensible, with three methods. In other crates, this trait
is empty, and there is the following trait hierarchy:
```
rustc_session::HashStableContext
| |
| rustc_hir::HashStableContext
| / \
rustc_ast::HashStableContext rustc_abi::HashStableContext
|
rustc_span::HashStableContext
```
All very strange and unnecessary. This commit changes
`derive(HashStable_Generic)` to use `rustc_span::HashStableContext`
instead of `crate::HashStableContext`. This eliminates the need for all
the empty `HashStableContext` traits and impls. Much better.
…mpls, r=petrochenkov
Remove `StableHashContext` impls
Details in individual commits.
r? @petrochenkov
…cate-extend, r=jhpratt
Add integer truncation and extension methods
Tracking issue: rust-lang#154330
This provides `.truncate()`, `.saturating_truncate()`, `.checked_truncate()`, and `.extend()`.
These only work within the same signedness (use `.cast_signed()` and `.cast_unsigned()` to change sign).
The truncation methods only work to smaller (or equal) types. `.extend()` only works to larger (or equal) types.
For the purposes of truncation and extending, `u128` is considered larger than or equal to the size of `usize`, and `usize` is considered larger than `u16` or `u8`. We might, in the future, want to consider ways to expand this.
Much of this was pair-programmed with @Amanieu.
In order to seal the new traits, this PR also adds a `core::sealed::Sealed`, like the one in `std`. I didn't modify `std` to re-export the same one, since by definition it isn't nameable, and since doing that would require that it be nameable (even if it was `#[unstable]`).
…uillaumeGomez,jieyouxu
build_helper: fix yarn locking, add check, and bump lockfile
fixesrust-lang#154446
cc @aDotInTheVoid, @GuillaumeGomez
not sure if this needs review from t-rustdoc, t-bootstrap, or both.
…-items, r=GuillaumeGomez
rustdoc: seperate methods and associated functions in sidebar
fixesrust-lang#154602
r? @fmease
before:
<img width="340" height="591" alt="image" src="https://github.com/user-attachments/assets/79268155-5260-4bb9-a826-46f459fc81eb" />
after:
<img width="514" height="588" alt="image" src="https://github.com/user-attachments/assets/b56b5ca6-28d7-45a7-86a9-ad6bf37f608a" />
example of type with both (`Box`):
<img width="410" height="760" alt="image" src="https://github.com/user-attachments/assets/a74dd536-e931-4d8f-af95-275bfcf48285" />
…oss35
change `c_double` to `f32` on `avr` targets
Extracted from rust-lang#152980. That version also makes this change for `msp430` but that is actually incorrect based on https://www.ti.com/lit/ug/slau132r/slau132r.pdf table 5-1 that specifies `double` as `f64`.
r? tgross35
cc @Patryk27@workingjubilee
…ializer-bound-syntax, r=jieyouxu
Fix associated type bound suggestion span issue
Fixesrust-lang#145586
@rust-borsrust-borsBot added the rollup A PR which is a rollup label Apr 1, 2026
@rustbotrustbot 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-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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Apr 1, 2026
@chenyukang

Copy link
Copy Markdown
MemberAuthor

@bors r+ rollup=never p=5

@rust-bors

rust-borsBot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 63e9022 has been approved by chenyukang

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 Apr 1, 2026
@rust-borsrust-borsBot 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 Apr 1, 2026
@rust-bors

rust-borsBot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

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

Labels

rollupA PR which is a rollupS-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@chenyukang@rustbot@joshtriplett@lolbinarycat@folkertdev@nnethercote