about summary refs log tree commit diff
path: root/compiler/rustc_query_system/src/error.rs
AgeCommit message (Collapse)AuthorLines
2025-09-08fixup limit handling codeJana Dönszelmann-1/+1
2025-01-07don't return an Option from try_find_dep_kindMartin Zacho-2/+2
2025-01-06improve diagnostics for const eval query overflowMartin Zacho-3/+3
2024-08-29Add `warn(unreachable_pub)` to `rustc_query_system`.Nicholas Nethercote-7/+7
2024-01-29Stop using `String` for error codes.Nicholas Nethercote-1/+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-10-26Stash and cancel cycle errors for auto trait leakage in opaquesMichael Goulet-0/+1
2023-07-18moved note as unspanned note, moved note to the bottom of the msgnxya-1/+2
2023-07-18added links as a notenxya-0/+1
2022-12-04Always evaluate vecs of subdiagnostics eagerlymejrs-1/+1
2022-10-23Migrate all diagnosticsNilstrieb-15/+15
2022-10-10query_system: finish migrationDavid Wood-11/+4
Using eager translation, migrate the remaining repeated cycle stack diagnostic. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-10errors: `AddToDiagnostic::add_to_diagnostic_with`David Wood-2/+5
`AddToDiagnostic::add_to_diagnostic_with` is similar to the previous `AddToDiagnostic::add_to_diagnostic` but takes a function that can be used by the caller to modify diagnostic messages originating from the subdiagnostic (such as performing translation eagerly). `add_to_diagnostic` now just calls `add_to_diagnostic_with` with an empty closure. Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-21FIX - adopt new Diagnostic naming in newly migrated modulesJhonny Bill Mena-1/+1
FIX - ambiguous Diagnostic link in docs UPDATE - rename diagnostic_items to IntoDiagnostic and AddToDiagnostic [Gardening] FIX - formatting via `x fmt` FIX - rebase conflicts. NOTE: Confirm wheather or not we want to handle TargetDataLayoutErrorsWrapper this way DELETE - unneeded allow attributes in Handler method FIX - broken test FIX - Rebase conflict UPDATE - rename residual _SessionDiagnostic and fix LintDiag link
2022-09-21UPDATE - rename SessionSubdiagnostic macro to SubdiagnosticJhonny Bill Mena-3/+4
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-3/+3
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-7/+7
2022-09-15correct span, add help message and add UI test when query depth overflowsSparrowLii-3/+7
2022-09-15add note for `layout_of` when query depth overflowsSparrowLii-1/+13
2022-09-06Make `HandleCycleError` an enum instead of a macro-generated closureJoshua Nelson-0/+7
- Add a `HandleCycleError` enum to rustc_query_system, along with a `handle_cycle_error` function - Move `Value` to rustc_query_system, so `handle_cycle_error` can use it - Move the `Value` impls from rustc_query_impl to rustc_middle. This is necessary due to orphan rules.
2022-08-31SessionDiagnostic for QueryOverflow errorLi Yuanheng-0/+4
2022-08-31use derive proc macro to impl SessionDiagnosticYuanheng Li-39/+48
fixes `SessionSubdiagnostic` to accept multiple attributes emitting list of fluent message remains unresolved
2022-08-31link related issue to FIXMELi Yuanheng-1/+1
Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2022-08-31migrate rustc_query_system to use SessionDiagnosticYuanheng Li-0/+60
with manual impl SessionDiagnostic