diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-30 13:57:35 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-02 08:58:24 +1100 |
| commit | b2a856ea3cb0087e52f90a9ac7e4e32f0b52a66e (patch) | |
| tree | 4ef1ee7123a35f5f44436a62e5a65376a932dc48 /compiler/rustc_errors | |
| parent | f7e3d05aa7e012402269aa02fd0c628445465b86 (diff) | |
| download | rust-b2a856ea3cb0087e52f90a9ac7e4e32f0b52a66e.tar.gz rust-b2a856ea3cb0087e52f90a9ac7e4e32f0b52a66e.zip | |
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.
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 6bd87f54140..0233cccbf43 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -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] |
