Skip to content

Conversation

@JonathanBrouwer
Copy link
Contributor

@JonathanBrouwer JonathanBrouwer commented Feb 8, 2026

For #151366
Just some more cleanup :)
SubdiagMessage is now identical to DiagMessage, so there's no point in having both of them

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler 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. labels Feb 8, 2026
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Feb 8, 2026
@rustbot rustbot added the A-rustc-dev-guide Area: rustc-dev-guide label Feb 8, 2026
@JonathanBrouwer
Copy link
Contributor Author

r? @jdonszelmann

@JonathanBrouwer JonathanBrouwer marked this pull request as ready for review February 8, 2026 21:43
@rustbot
Copy link
Collaborator

rustbot commented Feb 8, 2026

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

rustc_error_messages was changed

cc @davidtwco, @TaKO8Ki

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol, @tshepang

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 8, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 9, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@nnethercote nnethercote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first two commits should be squashed, because the tests will fail with just the first commit applied. The third commit could be squashed too.

View changes since this review

@JonathanBrouwer
Copy link
Contributor Author

Let's see how this works :)
@bors squash msg="Remove SubdiagMessage in favour of the identical DiagMessage"

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

🔨 3 commits were squashed into ea36128.

@JonathanBrouwer
Copy link
Contributor Author

I like to have the seperate commits as a way to guide the review order, but indeed for this PR it didn't really make sense given how small the other commits are

Copy link
Contributor

@nnethercote nnethercote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup. r=me if you want it, but if you want to wait for @jdonszelmann that's fine too :)

View changes since this review

///
/// - If the `SubdiagMessage` is non-translatable then return the message as a `DiagMessage`.
/// - If `self` is non-translatable then return `self`'s message.
pub fn with_subdiagnostic_message(&self, sub: SubdiagMessage) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the heart of the change, right? I.e. this was the main thing that distinguished DiagMessage and SubdiagMessage... I assume the .ftl removal eliminated uses of this method?

Copy link
Contributor Author

@JonathanBrouwer JonathanBrouwer Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, previously sub-diags like #[help] were allowed to have no slug, and would automatically take the parent DiagMessage's slug and add _help. There was an extra variant for this in SubdiagMessage which was already removed.

After the removal of .ftl files, all sub-diags need to have their own message so this distinction no longer exists

@JonathanBrouwer
Copy link
Contributor Author

@bors r=nnethercote
I think this change should be simple enough that Jana doesn't need to see it

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

📌 Commit ea36128 has been approved by nnethercote

It is now in the queue for this repository.

@rust-bors rust-bors bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 10, 2026
@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
…nnethercote

Remove `SubdiagMessage` in favour of the identical `DiagMessage`

For rust-lang#151366
Just some more cleanup :)
SubdiagMessage is now identical to DiagMessage, so there's no point in having both of them
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
…nnethercote

Remove `SubdiagMessage` in favour of the identical `DiagMessage`

For rust-lang#151366
Just some more cleanup :)
SubdiagMessage is now identical to DiagMessage, so there's no point in having both of them
rust-bors bot pushed a commit that referenced this pull request Feb 10, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #152364 (Port a lot of attributes to the new parser)
 - #151954 (Add help message suggesting explicit reference cast for From/TryFrom)
 - #152148 (Move `impl Interner for TyCtxt` to its own submodule)
 - #152226 (Modernize diagnostic for indeterminate trait object lifetime bounds)
 - #152351 (Remove `SubdiagMessage` in favour of the identical `DiagMessage`)
 - #152417 (Move the needs-drop check for `arena_cache` queries out of macro code)
 - #150688 (typeck: Make it clearer that `check_pat_lit` only handles literal patterns)
 - #152293 (Format heterogeneous try blocks)
 - #152355 (Update documentation of rustc_macros)
 - #152396 (Uplift `Predicate::allow_normalization` to `rustc_type_ir`)
 - #152425 (Port #![test_runner] to the attribute parser)
rust-bors bot pushed a commit that referenced this pull request Feb 10, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #152364 (Port a lot of attributes to the new parser)
 - #151954 (Add help message suggesting explicit reference cast for From/TryFrom)
 - #152148 (Move `impl Interner for TyCtxt` to its own submodule)
 - #152226 (Modernize diagnostic for indeterminate trait object lifetime bounds)
 - #152351 (Remove `SubdiagMessage` in favour of the identical `DiagMessage`)
 - #152417 (Move the needs-drop check for `arena_cache` queries out of macro code)
 - #150688 (typeck: Make it clearer that `check_pat_lit` only handles literal patterns)
 - #152293 (Format heterogeneous try blocks)
 - #152355 (Update documentation of rustc_macros)
 - #152396 (Uplift `Predicate::allow_normalization` to `rustc_type_ir`)
@rust-bors rust-bors bot merged commit 70ef504 into rust-lang:main Feb 10, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustc-dev-guide Area: rustc-dev-guide A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants