Skip to content

Rollup of 7 pull requests#156056

Closed
GuillaumeGomez wants to merge 19 commits intorust-lang:mainfrom
GuillaumeGomez:rollup-6DdRYmD
Closed

Rollup of 7 pull requests#156056
GuillaumeGomez wants to merge 19 commits intorust-lang:mainfrom
GuillaumeGomez:rollup-6DdRYmD

Conversation

@GuillaumeGomez
Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

joboet and others added 19 commits April 30, 2026 13:56
It has a single method and a single impl and the trait isn't directly
used. It can just become an inherent method.
When you have `impl Foo for Bar` and `Bar` has no generics it's useless
(and odd) to have `where Self: Baz` bounds on methods when the trait
itself doesn't have those bounds. This commit removes a few.
FWIW, note that `Diagnostic` doesn't have this bound.
While reading through stuff I was noticing just how many `+1` fixes there were in various places (and comments explaining that fixup), so this adds a new inherent helper on `Local` for making an argument to help make this clearer.
core: drop unmapped ZSTs in array `map`

Fixes rust-lang#152211.
Alternative to rust-lang#152220 and rust-lang#152248.

This makes the `Drain` type use the same ZST-handling strategy as `slice::IterMut`, which stores the remaining length instead of a one-past-the-end pointer when the type is a ZST. I've also removed the const-generic `N` parameter from `Drain` to avoid unnecessary monomorphizations.
refactor rustc_on_unimplemented's filtering

Previously when you had a
```rust
pub struct Directive {
    pub is_rustc_attr: bool,
    pub condition: Option<OnUnimplementedCondition>,
    pub subcommands: ThinVec<Directive>,
    pub message: Option<(Span, FormatString)>,
    ...
}
```
that condition would control the emission of the message, label, notes etc. I've changed that to
```rust
pub struct Directive {
    pub is_rustc_attr: bool,
    pub filters: ThinVec<(Filter, Directive)>,
    pub message: Option<(Span, FormatString)>,
    ...
```

so that the message etc is always emitted, and there's a vec of tuples with (filter, directive) where the filter controls whether that directive is even emitted,  which i think is much clearer. That also makes it easier to not have to do the reverse iteration thing and this makes it so that notes are emitted in declaration order (with nonfiltered options always last).

The rename is because I plan on making it available to other diagnostic attributes at some point (very wip) so `OnUnimplementedCondition` and the like would have to be renamed anyway.
Improve source code for `librustdoc/visit_ast.rs`

While working on this part of rustdoc, got annoyed at the tuples and decided to transform them into types. Code is now much easier to follow. :3

r? @Urgau
…r=jackh726

Clean up some traits

I was looking at various traits and found some unnecessary trait bounds, and some unnecessary traits. Details in individual commits.

r? @Nadrieril
Add a `Local::arg(i)` helper constructor

While reading through stuff I was noticing just how many `+1` fixes there were in various places (and comments explaining those fixups), so this adds a new inherent helper on `Local` for making an argument to help make this clearer.

r? mir
…, r=JonathanBrouwer

Add AcceptContext::expect_no_args
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label May 1, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels May 1, 2026
@GuillaumeGomez
Copy link
Copy Markdown
Member Author

@bors r+ p=5 rollup=never

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 1, 2026

📌 Commit cf18107 has been approved by GuillaumeGomez

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 May 1, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 1, 2026
Rollup of 7 pull requests

Successful merges:

 - #152487 (core: drop unmapped ZSTs in array `map`)
 - #155940 (refactor rustc_on_unimplemented's filtering)
 - #156020 (Improve source code for `librustdoc/visit_ast.rs`)
 - #156021 (Clean up some traits)
 - #156028 (Add a `Local::arg(i)` helper constructor)
 - #156037 (Add AcceptContext::expect_no_args)
 - #156040 (Add missing alias to mailmap)
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job test-various failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 1, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 1, 2026

💔 Test for 4db537e failed: CI. Failed job:

@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-review Status: Awaiting review from the assignee but also interested parties. labels May 1, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 1, 2026

PR #152487, which is a member of this rollup, was unapproved.

@GuillaumeGomez
Copy link
Copy Markdown
Member Author

@bors r-

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 1, 2026

This pull request was not previously approved.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic rollup A PR which is a rollup 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants