Skip to content

Rollup of 11 pull requests#154705

Closed
jhpratt wants to merge 46 commits intorust-lang:mainfrom
jhpratt:rollup-Ef0J2Wm
Closed

Rollup of 11 pull requests#154705
jhpratt wants to merge 46 commits intorust-lang:mainfrom
jhpratt:rollup-Ef0J2Wm

Conversation

@jhpratt
Copy link
Copy Markdown
Member

@jhpratt jhpratt commented Apr 2, 2026

Successful merges:

r? @ghost

Create a similar rollup

scrabsha and others added 30 commits March 22, 2026 12:53
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.
This annotates the `Arc` type with the diagnostic attribute
`#[diagnostic::on_move]`. Now when a moved `Arc` is borrowed,
a suggestion to clone it is made, with a label explaining why.
jhpratt added 7 commits April 2, 2026 03:36
…_arc_type, r=tgross35

Introduce #[diagnostic::on_move] on `Arc`

This is related to the tracking issue rust-lang#154181 and to the original issue rust-lang#149862 .
…leLapkin

tidy-alphabetical: fix line number in error message
Export `derive` at the crate root: `core::derive` and `std::derive`

This PR makes the `derive` macro available at the crate root:

```rust
#[std::derive(Clone)]
#[core::derive(Copy)]
struct X;
```

ACP: rust-lang/libs-team#766

Tracking issue: rust-lang#154645
…-items, r=GuillaumeGomez

rustdoc: seperate methods and associated functions in sidebar

fixes rust-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" />
…ooeo

Avoid creating async return opaques for foreign async fns

Fixes rust-lang#146754

Previously, def collection created the desugared async return opaque for foreign `async fn` items, but AST lowering won't lower that opaque for foreign items. That left a `DefId` without a corresponding HIR owner, which later caused an ICE during analysis.
Add a test for a past ICE when calling a const fn of an unresolved type with the wrong number of args

The ICE is fixed, but there needs to be a regression test for it.

Closes rust-lang#127423.
… r=Urgau

[rustdoc] Replace `DocContext` with `TyCtxt` wherever possible

In a lot of places, we pass down `DocContext` but actually only use its `tcx` field (`TyCtxt`). To make it more obvious what's actually being done, I replaced `DocContext` with `TyCtxt` (which implements `Copy`) in the function arguments. It created quite the cascade effect so I ended up with a lot more changes I expected.

Because it's a lot of changes, I made small commits which are easy to go through, so I strongly recommend reviewing this PR one commit at a time.

r? @Urgau
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Apr 2, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-tidy Area: The tidy tool 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 2, 2026
@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Apr 2, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 2, 2026

📌 Commit 79cba78 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 Apr 2, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 2, 2026

rust-bors bot pushed a commit that referenced this pull request Apr 2, 2026
Rollup of 11 pull requests

Successful merges:

 - #153105 (Compute the result of a projection type with region errors)
 - #153960 (Make `layout_of` cycles fatal errors)
 - #154527 (Emit pre-expansion feature gate warnings for negative impls and specialization)
 - #154666 (Remove `StableHashContext` impls)
 - #154669 (Introduce #[diagnostic::on_move] on `Arc`)
 - #154213 (tidy-alphabetical: fix line number in error message)
 - #154442 (Export `derive` at the crate root: `core::derive` and `std::derive`)
 - #154644 (rustdoc: seperate methods and associated functions in sidebar)
 - #154660 (Avoid creating async return opaques for foreign async fns)
 - #154671 (Add a test for a past ICE when calling a const fn of an unresolved type with the wrong number of args)
 - #154680 ([rustdoc] Replace `DocContext` with `TyCtxt` wherever possible)
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Stuck. Will make a bigger rollup that includes this one.

@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 Apr 2, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 2, 2026

This pull request was unapproved due to being closed.

Auto build was cancelled due to the PR being closed. Cancelled workflows:

@jhpratt jhpratt deleted the rollup-Ef0J2Wm branch April 2, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-tidy Area: The tidy tool 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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.