about summary refs log tree commit diff
path: root/compiler/rustc_attr/src/session_diagnostics.rs
AgeCommit message (Collapse)AuthorLines
2023-12-19Add `level` arg to `into_diagnostic`.Nicholas Nethercote-13/+14
And make all hand-written `IntoDiagnostic` impls generic, by using `DiagnosticBuilder::new(dcx, level, ...)` instead of e.g. `dcx.struct_err(...)`. This means the `create_*` functions are the source of the error level. This change will let us remove `struct_diagnostic`. Note: `#[rustc_lint_diagnostics]` is added to `DiagnosticBuilder::new`, it's necessary to pass diagnostics tests now that it's used in `into_diagnostic` functions.
2023-12-18Rename many `DiagCtxt` arguments.Nicholas Nethercote-4/+4
2023-12-18Rename `Handler` as `DiagCtxt`.Nicholas Nethercote-3/+3
2023-10-23Validate `since` value in stable attributeDavid Tolnay-0/+7
2023-10-04Remove E0551.Nicholas Nethercote-9/+0
Because it's the same as E0539. Fixes #51489.
2023-02-22errors: generate typed identifiers in each crateDavid Wood-9/+10
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-05Fix `uninlined_format_args` for some compiler cratesnils-1/+1
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-2/+2
2022-10-23Migrate all diagnosticsNilstrieb-47/+43
2022-09-21FIX - adopt new Diagnostic naming in newly migrated modulesJhonny Bill Mena-2/+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-2/+2
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-30/+30
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-34/+34
2022-09-21UPDATE - move SessionDiagnostic from rustc_session to rustc_errorsJhonny Bill Mena-1/+1
2022-09-05UPDATE - accept start_point and snippet instead of SourceMapJhonny Bill Mena-5/+5
2022-09-05[Gardening] UPDATE - tidy fixesJhonny Bill Mena-1/+1
2022-09-05UPDATE - avoid exposing source_map methods from HandlerJhonny Bill Mena-6/+5
2022-09-05UPDATE - into_diagnostic to take a Handler instead of a ParseSessJhonny Bill Mena-7/+11
Suggested by the team in this Zulip Topic https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler Handler already has almost all the capabilities of ParseSess when it comes to diagnostic emission, in this migration we only needed to add the ability to access source_map from the emitter in order to get a Snippet and the start_point. Not sure if this is the best way to address this gap
2022-08-27use smaller span for suggestionsTakayuki Maeda-8/+6
2022-08-22Move `LitKind` logic to `session_diagnostics` moduleHampus Lidin-1/+16
2022-08-22Change to `diag` attributesHampus Lidin-29/+30
2022-08-22Reorder diagnostics in code order, then alphabetical orderHampus Lidin-110/+233
2022-08-22Refactor additional diagnostics in `rustc_attr`Hampus Lidin-0/+62
2022-08-22Refactor diagnostics in `handle_errors` functionHampus Lidin-0/+196