mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 05:51:58 +00:00
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 @@ impl Handler {
|
||||
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 @@ impl Session {
|
||||
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