Skip to content

diags: Pass DiagArgMap instead of FluentArgs into format_diag_message#153231

Open
JonathanBrouwer wants to merge 3 commits intorust-lang:mainfrom
JonathanBrouwer:move_diag_arg_map
Open

diags: Pass DiagArgMap instead of FluentArgs into format_diag_message#153231
JonathanBrouwer wants to merge 3 commits intorust-lang:mainfrom
JonathanBrouwer:move_diag_arg_map

Conversation

@JonathanBrouwer
Copy link
Contributor

@JonathanBrouwer JonathanBrouwer commented Feb 28, 2026

This PR no longer exposes FluentArgs outside of translation.rs, instead using the already existing DiagArgMap.
This is in preparation of a few upcoming PRs, as well as just making the code slightly nicer.

Will do a perf run because this technically calls to_fluent_args a few more times than previously, but not expecting this to be significant

@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 28, 2026
@JonathanBrouwer
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 28, 2026
diags: Pass `DiagArgMap` instead of `FluentArgs` into `format_diag_message`
@rust-bors

This comment has been minimized.

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

rust-bors bot commented Feb 28, 2026

☀️ Try build successful (CI)
Build commit: af9f66e (af9f66e30b7aaff0099d07a9b180cd698bbd12ce, parent: ba1567989ee7774a1fb53aa680a8e4e8daa0f519)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (af9f66e): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary -3.7%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-3.7%, -3.7%] 1
All ❌✅ (primary) - - 0

Binary size

Results (secondary -0.0%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 13
All ❌✅ (primary) - - 0

Bootstrap: 479.975s -> 484.497s (0.94%)
Artifact size: 395.63 MiB -> 397.50 MiB (0.47%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 28, 2026
@JonathanBrouwer
Copy link
Contributor Author

r? @Kivooeo (or cc @lqd if you feel like stealing again :P)

@JonathanBrouwer JonathanBrouwer marked this pull request as ready for review March 1, 2026 09:12
@rustbot
Copy link
Collaborator

rustbot commented Mar 1, 2026

rustc_errors::translation was changed

cc @davidtwco, @TaKO8Ki

rustc_error_messages was changed

cc @davidtwco, @TaKO8Ki

rustc_errors::annotate_snippet_emitter_writer was changed

cc @Muscraft

rustc_errors::emitter was changed

cc @Muscraft

@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 Mar 1, 2026
@Kivooeo
Copy link
Member

Kivooeo commented Mar 1, 2026

r=me with adding small doc comment explaining this new structure type, i feel like it could be useful in future

@JonathanBrouwer
Copy link
Contributor Author

@bors r=Kivooeo rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 1, 2026

📌 Commit 01dbf41 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 Mar 1, 2026
@lqd
Copy link
Member

lqd commented Mar 1, 2026

Maybe there is a better name as well, maybe DiagArgs or something similar.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 1, 2026
… r=Kivooeo

diags: Pass `DiagArgMap` instead of `FluentArgs` into `format_diag_message`

This PR no longer exposes `FluentArgs` outside of `translation.rs`, instead using the already existing `DiagArgMap`.
This is in preparation of a few upcoming PRs, as well as just making the code slightly nicer.

Will do a perf run because this technically calls `to_fluent_args` a few more times than previously, but not expecting this to be significant
rust-bors bot pushed a commit that referenced this pull request Mar 1, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #153130 (std: move `getpid` to `sys::process`)
 - #152549 (Revert "resolve: Downgrade `ambiguous_glob_imports` to warn-by-default")
 - #153231 (diags: Pass `DiagArgMap` instead of `FluentArgs` into `format_diag_message`)
 - #153246 (Fix compile error in std::fs impl on VEXos target)
 - #153255 (Recover feature lang_items for emscripten)
 - #153257 (update my mailmap)
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. 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