Avoid struct_diagnostic
where possible.
It's necessary for `derive(Diagnostic)`, but is best avoided elsewhere because there are clearer alternatives. This required adding `Handler::struct_almost_fatal`.
This commit is contained in:
parent
dc05a30996
commit
7bdb227567
7 changed files with 26 additions and 19 deletions
|
@ -19,7 +19,7 @@ impl<'a> IntoDiagnostic<'a> for FeatureGateError {
|
|||
self,
|
||||
handler: &'a rustc_errors::Handler,
|
||||
) -> rustc_errors::DiagnosticBuilder<'a, ErrorGuaranteed> {
|
||||
let mut diag = handler.struct_diagnostic(self.explain);
|
||||
let mut diag = handler.struct_err(self.explain);
|
||||
diag.set_span(self.span);
|
||||
diag.code(error_code!(E0658));
|
||||
diag
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue