-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Convert to inline diagnostics in rustc_builtin_macros
#152121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert to inline diagnostics in rustc_builtin_macros
#152121
Conversation
|
|
r? me |
| #[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, | ||
| } |
There was a problem hiding this comment.
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...
| #[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, | ||
| } |
There was a problem hiding this comment.
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
|
Reading all these PRs makes me also think about
@bors r+ rollup |
I want to put some compile-time checks on the formatting of these messages, but I'll do that after we finish porting everything
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
Agreed, this would be better, put it in the tracking issue so I can do it for all messages at the same time |
ac37233 to
d40e60f
Compare
|
|
|
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. |
|
@bors r=lqd |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
…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.)
Rollup merge of #152121 - JonathanBrouwer:convert_builtin_macros, r=lqd Convert to inline diagnostics in `rustc_builtin_macros` For #151366 r? @jdonszelmann
For #151366
r? @jdonszelmann