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
@ -970,11 +970,12 @@ pub fn span_err_with_code(
|
||||
span: impl Into<MultiSpan>,
|
||||
msg: impl Into<DiagnosticMessage>,
|
||||
code: DiagnosticId,
|
||||
) {
|
||||
) -> ErrorGuaranteed {
|
||||
self.emit_diag_at_span(
|
||||
Diagnostic::new_with_code(Error { lint: false }, Some(code), msg),
|
||||
span,
|
||||
);
|
||||
)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
#[rustc_lint_diagnostics]
|
||||
|
@ -478,7 +478,7 @@ pub fn span_err_with_code<S: Into<MultiSpan>>(
|
||||
sp: S,
|
||||
msg: impl Into<DiagnosticMessage>,
|
||||
code: DiagnosticId,
|
||||
) {
|
||||
) -> ErrorGuaranteed {
|
||||
self.diagnostic().span_err_with_code(sp, msg, code)
|
||||
}
|
||||
#[rustc_lint_diagnostics]
|
||||
|
Loading…
Reference in New Issue
Block a user