Skip to content

Commit

Permalink
Remove SharedEmitterMessage::AbortIfErrors.
Browse files Browse the repository at this point in the history
It's always paired wth `SharedEmitterMessage::Diagnostic`, so the two
can be merged.
  • Loading branch information
nnethercote committed Feb 15, 2024
1 parent 92b38d3 commit 14453ca
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,6 @@ fn spawn_work<'a, B: ExtraBackendMethods>(
enum SharedEmitterMessage {
Diagnostic(Diagnostic),
InlineAsmError(u32, String, Level, Option<(String, Vec<InnerSpan>)>),
AbortIfErrors,
Fatal(String),
}

Expand Down Expand Up @@ -1852,7 +1851,6 @@ impl Emitter for SharedEmitter {
args,
})),
);
drop(self.sender.send(SharedEmitterMessage::AbortIfErrors));
}

fn source_map(&self) -> Option<&Lrc<SourceMap>> {
Expand Down Expand Up @@ -1894,6 +1892,7 @@ impl SharedEmitterMain {
.collect();
d.replace_args(diag.args);
dcx.emit_diagnostic(d);
sess.dcx().abort_if_errors();
}
Ok(SharedEmitterMessage::InlineAsmError(cookie, msg, level, source)) => {
assert!(matches!(level, Level::Error | Level::Warning | Level::Note));
Expand Down Expand Up @@ -1926,9 +1925,6 @@ impl SharedEmitterMain {

err.emit();
}
Ok(SharedEmitterMessage::AbortIfErrors) => {
sess.dcx().abort_if_errors();
}
Ok(SharedEmitterMessage::Fatal(msg)) => {
sess.dcx().fatal(msg);
}
Expand Down

0 comments on commit 14453ca

Please sign in to comment.