about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/error.rs
AgeCommit message (Collapse)AuthorLines
2024-03-05Rename `DiagnosticMessage` as `DiagMessage`.Nicholas Nethercote-4/+4
2024-02-28Rename `DiagnosticArg{,Map,Name,Value}` as `DiagArg{,Map,Name,Value}`.Nicholas Nethercote-3/+3
2024-02-03Use `DiagnosticArgName` in a few more places.Nicholas Nethercote-4/+3
2024-01-30Remove the lifetime from `DiagnosticArgValue`.Nicholas Nethercote-5/+2
Because it's almost always static. This makes `impl IntoDiagnosticArg for DiagnosticArgValue` trivial, which is nice. There are a few diagnostics constructed in `compiler/rustc_mir_build/src/check_unsafety.rs` and `compiler/rustc_mir_transform/src/errors.rs` that now need symbols converted to `String` with `to_string` instead of `&str` with `as_str`, but that' no big deal, and worth it for the simplifications elsewhere.
2024-01-29Stop using `String` for error codes.Nicholas Nethercote-2/+2
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.
2023-09-14don't point at const usage site for resolution-time errorsRalf Jung-0/+7
also share the code that emits the actual error
2023-07-27Don't attempt to compute layout of type referencing errorMichael Goulet-0/+3
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-0/+55
2023-05-16Remove `LangItems::require`Nilstrieb-1/+9
It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff.
2023-04-03fix(middle): emit error rather than delay bug when reaching limitbohan-0/+8
2022-11-21Match crate and slug namesmejrs-0/+8
2022-10-30better error for rustc_strict_coherence misuseMichael Goulet-0/+9
2022-10-23Migrate all diagnosticsNilstrieb-6/+6
2022-10-03Add diagnostic struct for const eval error in `rustc_middle`pierwill-0/+7
Co-authored-by: Michael Goulet <michael@errs.io>
2022-09-21UPDATE - rename SessionSubdiagnostic macro to SubdiagnosticJhonny Bill Mena-1/+1
Also renames: - sym::AddSubdiagnostic to sym:: Subdiagnostic - rustc_diagnostic_item = "AddSubdiagnostic" to rustc_diagnostic_item = "Subdiagnostic"
2022-09-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-4/+4
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-4/+4
2022-09-05fix comment111-1/+1
2022-09-01Migrate limit error111-0/+10
2022-09-01Migrate OpaqueHiddenType mismatch111-0/+26
2022-09-01Migrate DropCheckOverflow111-0/+14