rust/compiler/rustc_parse/src/parser
Nicholas Nethercote b18f3e11fa Prefer DiagnosticBuilder over Diagnostic in diagnostic modifiers.
There are lots of functions that modify a diagnostic. This can be via a
`&mut Diagnostic` or a `&mut DiagnosticBuilder`, because the latter type
wraps the former and impls `DerefMut`.

This commit converts all the `&mut Diagnostic` occurrences to `&mut
DiagnosticBuilder`. This is a step towards greatly simplifying
`Diagnostic`. Some of the relevant function are made generic, because
they deal with both errors and warnings. No function bodies are changed,
because all the modifier methods are available on both `Diagnostic` and
`DiagnosticBuilder`.
2024-02-19 20:23:20 +11:00
..
attr.rs Prefer DiagnosticBuilder over Diagnostic in diagnostic modifiers. 2024-02-19 20:23:20 +11:00
attr_wrapper.rs Rename Parser::span_diagnostic as Parser::dcx. 2023-12-18 16:06:21 +11:00
diagnostics.rs Prefer DiagnosticBuilder over Diagnostic in diagnostic modifiers. 2024-02-19 20:23:20 +11:00
expr.rs Prefer DiagnosticBuilder over Diagnostic in diagnostic modifiers. 2024-02-19 20:23:20 +11:00
generics.rs Remove unnecessary .to_string()/.as_str()s 2024-02-02 15:16:05 -08:00
item.rs Rollup merge of #121085 - davidtwco:always-eager-diagnostics, r=nnethercote 2024-02-17 18:47:40 +01:00
mod.rs Add ErrorGuaranteed to ast::LitKind::Err, token::LitKind::Err. 2024-02-15 14:46:08 +11:00
nonterminal.rs Use .into_diagnostic() less. 2023-12-18 20:46:13 +11:00
pat.rs errors: only eagerly translate subdiagnostics 2024-02-15 10:34:41 +00:00
path.rs Add an ErrorGuaranteed to ast::TyKind::Err. 2024-02-15 09:35:11 +11:00
stmt.rs Suggest wrapping mac args in parens rather than the whole expression 2024-01-18 00:01:13 +00:00
ty.rs Add an ErrorGuaranteed to ast::TyKind::Err. 2024-02-15 09:35:11 +11:00