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 22, 2024
1 parent ad5d7f4 commit 6efffd7
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 @@ -1784,7 +1784,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 @@ -1853,7 +1852,6 @@ impl Emitter for SharedEmitter {
args,
})),
);
drop(self.sender.send(SharedEmitterMessage::AbortIfErrors));
}

fn source_map(&self) -> Option<&Lrc<SourceMap>> {
Expand Down Expand Up @@ -1895,6 +1893,7 @@ impl SharedEmitterMain {
.collect();
d.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 @@ -1927,9 +1926,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 6efffd7

Please sign in to comment.