Return ErrorGuaranteed
from span_err_with_code
methods.
`ErrorGuaranteed` should be used for all error methods involving the `Error` level, e.g. as is done for the corresponding `span_err` methods.
This commit is contained in:
parent
f7e3d05aa7
commit
b2a856ea3c
2 changed files with 4 additions and 3 deletions
|
@ -970,11 +970,12 @@ impl Handler {
|
||||||
span: impl Into<MultiSpan>,
|
span: impl Into<MultiSpan>,
|
||||||
msg: impl Into<DiagnosticMessage>,
|
msg: impl Into<DiagnosticMessage>,
|
||||||
code: DiagnosticId,
|
code: DiagnosticId,
|
||||||
) {
|
) -> ErrorGuaranteed {
|
||||||
self.emit_diag_at_span(
|
self.emit_diag_at_span(
|
||||||
Diagnostic::new_with_code(Error { lint: false }, Some(code), msg),
|
Diagnostic::new_with_code(Error { lint: false }, Some(code), msg),
|
||||||
span,
|
span,
|
||||||
);
|
)
|
||||||
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustc_lint_diagnostics]
|
#[rustc_lint_diagnostics]
|
||||||
|
|
|
@ -478,7 +478,7 @@ impl Session {
|
||||||
sp: S,
|
sp: S,
|
||||||
msg: impl Into<DiagnosticMessage>,
|
msg: impl Into<DiagnosticMessage>,
|
||||||
code: DiagnosticId,
|
code: DiagnosticId,
|
||||||
) {
|
) -> ErrorGuaranteed {
|
||||||
self.diagnostic().span_err_with_code(sp, msg, code)
|
self.diagnostic().span_err_with_code(sp, msg, code)
|
||||||
}
|
}
|
||||||
#[rustc_lint_diagnostics]
|
#[rustc_lint_diagnostics]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue