summary refs log tree commit diff
path: root/compiler/rustc_expand/src/errors.rs
AgeCommit message (Collapse)AuthorLines
2024-02-21Rollup merge of #121288 - tshepang:make-expand-translatable, r=michaelwoeristerDylan DPC-0/+30
make rustc_expand translatable these are the last of the easy ones
2024-02-20make "proc-macro derive panicked" translatableTshepang Mbambo-0/+15
2024-02-19make "custom attribute panicked" translatableTshepang Mbambo-0/+15
2024-02-16make "invalid fragment specifier" translatableTshepang Mbambo-0/+10
2024-01-29Stop using `String` for error codes.Nicholas Nethercote-5/+6
Error codes are integers, but `String` is used everywhere to represent them. Gross! This commit introduces `ErrCode`, an integral newtype for error codes, replacing `String`. It also introduces a constant for every error code, e.g. `E0123`, and removes the `error_code!` macro. The constants are imported wherever used with `use rustc_errors::codes::*`. With the old code, we have three different ways to specify an error code at a use point: ``` error_code!(E0123) // macro call struct_span_code_err!(dcx, span, E0123, "msg"); // bare ident arg to macro call \#[diag(name, code = "E0123")] // string struct Diag; ``` With the new code, they all use the `E0123` constant. ``` E0123 // constant struct_span_code_err!(dcx, span, E0123, "msg"); // constant \#[diag(name, code = E0123)] // constant struct Diag; ``` The commit also changes the structure of the error code definitions: - `rustc_error_codes` now just defines a higher-order macro listing the used error codes and nothing else. - Because that's now the only thing in the `rustc_error_codes` crate, I moved it into the `lib.rs` file and removed the `error_codes.rs` file. - `rustc_errors` uses that macro to define everything, e.g. the error code constants and the `DIAGNOSTIC_TABLES`. This is in its new `codes.rs` file.
2024-01-17Improved collapse_debuginfo attribute, added command-line flag (no|external|yes)Andrew Zhogin-0/+7
2023-12-10Remove edition umbrella features.Eric Huss-10/+0
2023-12-03Detect attempts to expand a macro to a match arm againNadrieril-0/+2
Because a macro invocation can expand to a never pattern, we can't rule out a `arm!(),` arm at parse time. Instead we detect that case at expansion time, if the macro tries to output a pattern followed by `=>`.
2023-10-21Mention the syntax for `use` on `mod foo;` if `foo` doesn't existEsteban Küber-0/+1
Newcomers might get confused that `mod` is the only way of defining scopes, and that it can be used as if it were `use`. Fix #69492.
2023-04-25Fix static string lintsclubby789-0/+10
2023-03-04rustc_expand: make proc-macro derive error translatableTshepang Mbambo-0/+7
2023-02-24make "proc macro panicked" translatableTshepang Mbambo-0/+15
2023-02-22errors: generate typed identifiers in each crateDavid Wood-7/+7
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-30session: diagnostic migration lint on more fnsDavid Wood-0/+7
Apply the diagnostic migration lint to more functions on `Session`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-12-10Migrate parts of `rustc_expand` to session diagnosticsnils-2/+324
This migrates everything but the `mbe` and `proc_macro` modules. It also contains a few cleanups and drive-by/accidental diagnostic improvements which can be seen in the diff for the UI tests.
2022-10-23Migrate all diagnosticsNilstrieb-6/+6
2022-09-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-7/+7
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-7/+7
2022-08-21Replace #[lint/warning/error] with #[diag]Xiretza-6/+6
2022-08-17Hotfix for duplicated slug name on VarStillRepeating structnidnogg-1/+1
2022-08-17Moved structs to rustc_expand::errors, added several more migrations, fixed ↵nidnogg-3/+1
slug name
2022-08-17Moved structs to rustc_expand::errors, added several more migrations, fixed ↵nidnogg-0/+50
slug name