Skip to content

Remove skip_arg attribute from Diagnostic and Subdiagnostic proc-macros#157070

Open
GuillaumeGomez wants to merge 2 commits into
rust-lang:mainfrom
GuillaumeGomez:rm-skip_arg
Open

Remove skip_arg attribute from Diagnostic and Subdiagnostic proc-macros#157070
GuillaumeGomez wants to merge 2 commits into
rust-lang:mainfrom
GuillaumeGomez:rm-skip_arg

Conversation

@GuillaumeGomez
Copy link
Copy Markdown
Member

Instead of having users to manually add #[skip_arg] for each field that is not used in fluent messages, I think it's better to instead let the proc-macro only call diag.arg("name", field) on the fields actually used.

r? @JonathanBrouwer

…c-macros, skipping fields based on whether or not they are used in error messages
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 28, 2026

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, @tshepang

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

rustc_macros::diagnostics was changed

cc @TaKO8Ki, @JonathanBrouwer

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

Some changes occurred in match checking

cc @Nadrieril

@rustbot rustbot added A-rustc-dev-guide Area: rustc-dev-guide 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. labels May 28, 2026
@GuillaumeGomez
Copy link
Copy Markdown
Member Author

I didn't expect to ping half the compiler team though. O.o

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

JonathanBrouwer commented May 28, 2026

@bors try @rust-timer queue
Just in case

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 28, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 28, 2026
Remove `skip_arg` attribute from `Diagnostic` and `Subdiagnostic` proc-macros
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 28, 2026

☀️ Try build successful (CI)
Build commit: 8f93c9d (8f93c9d17d1ef0821b932d7ec77d1f88c1687baa, parent: b5e038d7158c1af55a646027fdacf5ecd7c783c7)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (8f93c9d): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary 15.5%, secondary -1.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
15.5% [15.5%, 15.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-2.5%, -0.8%] 2
All ❌✅ (primary) 15.5% [15.5%, 15.5%] 1

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 512.125s -> 509.812s (-0.45%)
Artifact size: 400.67 MiB -> 400.68 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 28, 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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants