Skip to content

Commit

Permalink
Remove SharedEmitterMessage::AbortIfErrors.
Browse files Browse the repository at this point in the history
It's now always paired with a `SharedEmitterMessage::Diagnostic`, so the
two message kinds can be combined.
  • Loading branch information
nnethercote committed Feb 2, 2024
1 parent 2d73a5d commit a5404f1
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 @@ -1754,7 +1754,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 @@ -1802,7 +1801,6 @@ impl Translate for SharedEmitter {
impl Emitter for SharedEmitter {
fn emit_diagnostic(&mut self, diag: &rustc_errors::Diagnostic) {
drop(self.sender.send(SharedEmitterMessage::Diagnostic(diag.clone())));
drop(self.sender.send(SharedEmitterMessage::AbortIfErrors));
}

fn source_map(&self) -> Option<&Lrc<SourceMap>> {
Expand All @@ -1828,6 +1826,7 @@ impl SharedEmitterMain {
match message {
Ok(SharedEmitterMessage::Diagnostic(diag)) => {
sess.dcx().emit_diagnostic(diag);
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 @@ -1860,9 +1859,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 a5404f1

Please sign in to comment.