summary refs log tree commit diff
path: root/compiler/rustc_errors/src/translation.rs
AgeCommit message (Collapse)AuthorLines
2022-10-10errors: `DiagnosticMessage::Eager`David Wood-1/+3
Add variant of `DiagnosticMessage` for eagerly translated messages (messages in the target language which don't need translated by the emitter during emission). Also adds `eager_subdiagnostic` function which is intended to be invoked by the diagnostic derive for subdiagnostic fields which are marked as needing eager translation. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-10errors: use `HashMap` to store diagnostic argsDavid Wood-9/+21
Eager translation will enable subdiagnostics to be translated multiple times with different arguments - this requires the ability to replace the value of one argument with a new value, which is better suited to a `HashMap` than the previous storage, a `Vec`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-08-30Use more `into_iter` rather than `drain(..)`Donough Liu-1/+1
2022-08-15errors: move translation logic into moduleDavid Wood-0/+103
Just moving code around so that triagebot can ping relevant parties when translation logic is modified. Signed-off-by: David Wood <david.wood@huawei.com>