Skip to content

Conversation

@JonathanBrouwer
Copy link
Contributor

@JonathanBrouwer JonathanBrouwer commented Jan 25, 2026

This PR does a lot of refactoring on the implementation of #[derive(Diagnostic)]. It should have no observable effect other than error messages for incorrect usage of the attributes. In general, I think the error messages got better.

This PR can be reviewed commit by commit, each commit passes the tests.

r? @Kivooeo
(Thanks for reviewing my PRs so far :3)

@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. labels Jan 25, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@JonathanBrouwer JonathanBrouwer marked this pull request as ready for review January 28, 2026 21:38
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 28, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 28, 2026

rustc_macros::diagnostics was changed

cc @davidtwco, @TaKO8Ki

@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 Jan 28, 2026
@Kivooeo
Copy link
Member

Kivooeo commented Jan 28, 2026

rustc_macros::diagnostics was changed

cc davidtwco, TaKO8Ki

hm, do we still need this notification?

In general, I think the error messages got better

yep, i think so too

Thanks for reviewing my PRs so far

i'll take a closer look tomorrow, but i'm pretty sure that's all fine <3

@JonathanBrouwer
Copy link
Contributor Author

JonathanBrouwer commented Jan 28, 2026

hm, do we still need this notification?

Afaik these notifications are for people who want to know if certain directories change, whether it is needed is mostly for them to decide. There is no further expectations such as waiting for their review. Actually just added myself to the list, cause I'm now also interested in changes of these files #151800

@Kivooeo
Copy link
Member

Kivooeo commented Jan 28, 2026

Actually just added myself to the list

oh, that's nice, thanks for keeping an eye on it

@Kivooeo
Copy link
Member

Kivooeo commented Jan 29, 2026

ok, nice, thanks for working on it!

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 29, 2026

📌 Commit 2e8347a has been approved by Kivooeo

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 Jan 29, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 29, 2026
Rollup of 5 pull requests

Successful merges:

 - #151775 (Portable SIMD subtree update)
 - #151488 (Tweak E0599 to consolidate unsatisfied trait bound messages)
 - #149823 (fix(parser): Disallow CR in frontmatter )
 - #151475 (add foregin type tests for issue 64458)
 - #151657 (Cleanup of `#[derive(Diagnostic)]` attribute parsers)
@rust-bors rust-bors bot merged commit 617288e into rust-lang:main Jan 29, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Jan 29, 2026
Rollup merge of #151657 - JonathanBrouwer:diag2, r=Kivooeo

Cleanup of `#[derive(Diagnostic)]` attribute parsers

This PR does a lot of refactoring on the implementation of `#[derive(Diagnostic)]`. It should have no observable effect other than error messages for incorrect usage of the attributes. In general, I think the error messages got better.

This PR can be reviewed commit by commit, each commit passes the tests.
- [Convert parse_nested_meta to parse_args_with for #[diagnostic]](9e61014)
  Start parsing `#[diagnostic]` using `syn`'s `parse_args_with` function instead of `parse_nested_meta`. This improves error messages and prepares for the new syntax needed for #151366 which cannot be parsed using `parse_args_with`.
- [Convert parse_nested_meta to parse_args_with for #[subdiagnostic]](5d21a21)
  Same as above but for `#[subdiagnostic]`
- [Remove unused no_span option](0bf3f5d)
  Removes the `no_span` option of `#[suggestion]`, which there were no tests for and which seems to have been unused. If needed again in the future, this can be re-added pretty easily, but I find that unlikely.
- [Remove HasFieldMap trait in favour of passing FieldMap directly](2e8347a)
  Removes the `HasFieldMap` trait, because I don't really see the point of having a trait "has a field map" if we can just pass the fieldmap itself instead.

r? @Kivooeo
(Thanks for reviewing my PRs so far :3)
@rustbot rustbot added this to the 1.95.0 milestone Jan 29, 2026
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 30, 2026
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151775 (Portable SIMD subtree update)
 - rust-lang/rust#151488 (Tweak E0599 to consolidate unsatisfied trait bound messages)
 - rust-lang/rust#149823 (fix(parser): Disallow CR in frontmatter )
 - rust-lang/rust#151475 (add foregin type tests for issue 64458)
 - rust-lang/rust#151657 (Cleanup of `#[derive(Diagnostic)]` attribute parsers)
Kobzol pushed a commit to Kobzol/portable-simd that referenced this pull request Feb 3, 2026
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151775 (Portable SIMD subtree update)
 - rust-lang/rust#151488 (Tweak E0599 to consolidate unsatisfied trait bound messages)
 - rust-lang/rust#149823 (fix(parser): Disallow CR in frontmatter )
 - rust-lang/rust#151475 (add foregin type tests for issue 64458)
 - rust-lang/rust#151657 (Cleanup of `#[derive(Diagnostic)]` attribute parsers)
Kobzol pushed a commit to Kobzol/portable-simd that referenced this pull request Feb 3, 2026
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151775 (Portable SIMD subtree update)
 - rust-lang/rust#151488 (Tweak E0599 to consolidate unsatisfied trait bound messages)
 - rust-lang/rust#149823 (fix(parser): Disallow CR in frontmatter )
 - rust-lang/rust#151475 (add foregin type tests for issue 64458)
 - rust-lang/rust#151657 (Cleanup of `#[derive(Diagnostic)]` attribute parsers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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-compiler Relevant 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.

4 participants