Skip to content

Convert to inline diagnostics in rustc_builtin_macros - #152121

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
JonathanBrouwer:convert_builtin_macros
Feb 5, 2026
Merged

Convert to inline diagnostics in rustc_builtin_macros#152121
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
JonathanBrouwer:convert_builtin_macros

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

@rustbotrustbot added 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. labels Feb 4, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

jdonszelmann is currently at their maximum review capacity.
They may take a while to respond.

@lqd

lqd commented Feb 4, 2026

Copy link
Copy Markdown
Member

jdonszelmann is currently at their maximum review capacity.

r? me

@rustbotrustbot assigned lqd and unassigned jdonszelmannFeb 4, 2026
Comment on lines 465 to 470
#[derive(Diagnostic)]
#[diag(builtin_macros_coerce_pointee_requires_transparent, code = E0802)]
#[diag("`CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]`", code = E0802)]
struct RequireTransparent {
#[primary_span]
span: Span,
}

@lqdlqdFeb 5, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

interesting that these are not in errors.rs...

Comment on lines 1056 to 1061
#[derive(Diagnostic)]
#[diag(builtin_macros_non_generic_pointee)]
#[diag("the `#[pointee]` attribute may only be used on generic parameters")]
pub(crate) struct NonGenericPointee {
#[primary_span]
pub span: Span,
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

...which makes this one split from its sibling diagnostic structs from coerce_pointee.rs

@lqd

lqd commented Feb 5, 2026

Copy link
Copy Markdown
Member

Reading all these PRs makes me also think about

  • formatting, with the many newlines and space at the beginning of lines, that are sometimes ignored sometimes not -- maybe in those cases extracting the message to a const str could be helpful
  • whether to collect all diagnostic structs in an errors module or not
  • whether it'd be nice to use r#"" strings when the parts of the error message needs escaping

@bors r+ rollup

@rust-bors

rust-borsBot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ac37233 has been approved by lqd

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 Feb 5, 2026
@JonathanBrouwer

Copy link
Copy Markdown
MemberAuthor

formatting, with the many newlines and space at the beginning of lines, that are sometimes ignored sometimes not -- maybe in those cases extracting the message to a const str could be helpful

I want to put some compile-time checks on the formatting of these messages, but I'll do that after we finish porting everything

whether to collect all diagnostic structs in an errors module or not

This is something I've been thinking about as well, I kinda want to distribute them among the code but that's something I'd want to MCP in the future

whether it'd be nice to use r#"" strings when the parts of the error message needs escaping

Agreed, this would be better, put it in the tracking issue so I can do it for all messages at the same time

@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 Feb 5, 2026
@rust-bors

rust-borsBot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ A new commit d40e60fc447e36afc664c69353a0b1e6ab4d2738 was pushed to the branch, the PR will need to be re-approved.

@rustbot

Copy link
Copy Markdown
Collaborator

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.

@JonathanBrouwer

Copy link
Copy Markdown
MemberAuthor

@bors r=lqd

@rust-bors

rust-borsBot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit d40e60f has been approved by lqd

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 5, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web)(plain enhanced)(plain)

Click to see the possible cause of the failure (guessed by this bot)
REPOSITORY TAG IMAGE ID CREATED SIZE
ghcr.io/dependabot/dependabot-updater-core latest bcec0b4e062b 9 days ago 783MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:b662be51f7b8ef7e2c8464428f14e49cb79c36aa9afb7ecb9221dfe0f507050c
deleted: sha256:bcec0b4e062b5ffe11cc1c2729558c0cd96621c0271ab5e97ff3a56e0c25045a
deleted: sha256:64e147d5e54d9be8b8aa322e511cda02296eda4b8b8d063c6a314833aca50e29
deleted: sha256:5cba409bb463f4e7fa1a19f695450170422582c1bc7c0e934d893b4e5f558bc6
deleted: sha256:cddc6ebd344b0111eaab170ead1dfda24acdfe865ed8a12599a34d338fa8e28b
deleted: sha256:2412c3f334d79134573cd45e657fb6cc0abd75bef3881458b0d498d936545c8d
---
tests/ui/drop_non_drop.rs ... ok
tests/ui/drain_collect.fixed ... ok
tests/ui/duplicate_underscore_argument.rs ... ok
tests/ui/duplicated_attributes.rs ... ok
tests/ui/duration_suboptimal_units.rs ... ok
tests/ui/duration_suboptimal_units_days_weeks.rs ... ok
tests/ui/duration_subsec.rs ... ok
tests/ui/double_parens.fixed ... ok
tests/ui/duration_suboptimal_units_days_weeks.fixed ... ok
tests/ui/duration_suboptimal_units.fixed ... ok
tests/ui/duration_subsec.fixed ... ok
tests/ui/eager_transmute.rs ... ok
tests/ui/else_if_without_else.rs ... ok
tests/ui/elidable_lifetime_names.rs ... ok
tests/ui/empty_docs.rs ... ok
---
.............................................. (146/146)
======== tests/rustdoc-gui/search-filter.goml ========
[ERROR] line 48: Error: The CSS selector "#search-tabs .count.loading" still exists: for command `wait-for-false: "#search-tabs .count.loading"`
at <file:///checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/test_docs/index.html?search=test>
======== tests/rustdoc-gui/search-result-display.goml ========
[WARNING] line 39: Delta is 0 for "x", maybe try to use `compare-elements-position` instead?

rust-borsBot pushed a commit that referenced this pull request Feb 5, 2026
…uwer
Rollup of 9 pull requests
Successful merges:
- #150831 (c-variadic: make `va_arg` match on `Arch` exhaustive)
- #152113 (Fix GitHub CI summary in CodeBuild)
- #152153 (Incorporate query description functions into `QueryVTable`)
- #152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
- #152106 (Convert to inline diagnostics in `rustc_ast_passes`)
- #152109 (Convert to inline diagnostics in `rustc_errors`)
- #152119 (Convert to inline diagnostics in `rustc_middle`)
- #152121 (Convert to inline diagnostics in `rustc_builtin_macros`)
- #152133 (library/std: Rename `ON_BROKEN_PIPE_FLAG_USED` to `ON_BROKEN_PIPE_USED`)
Failed merges:
- #152107 (Convert to inline diagnostics in `rustc_borrowck`)
- #152117 (Convert to inline diagnostics in `rustc_trait_selection`)
- #152126 (Convert to inline diagnostics in `rustc_mir_build`)
- #152131 (Port rustc_no_implicit_bounds attribute to parser.)
@lqd

lqd commented Feb 5, 2026

Copy link
Copy Markdown
Member

cc @GuillaumeGomez

@rust-bors
rust-borsBot merged commit 3c61714 into rust-lang:mainFeb 5, 2026
7 of 11 checks passed
@rustbotrustbot added this to the 1.95.0 milestone Feb 5, 2026
rust-timer added a commit that referenced this pull request Feb 5, 2026
Rollup merge of #152121 - JonathanBrouwer:convert_builtin_macros, r=lqd
Convert to inline diagnostics in `rustc_builtin_macros`
For #151366
r? @jdonszelmann
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler 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

@JonathanBrouwer@rustbot@lqd@rust-log-analyzer@jdonszelmann