Skip to content

Commit

Permalink
Pass artifact notifications though SharedEmitterMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
pacak committed Mar 31, 2024
1 parent 439f67d commit ff73679
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,7 @@ enum SharedEmitterMessage {
Diagnostic(Diagnostic),
InlineAsmError(u32, String, Level, Option<(String, Vec<InnerSpan>)>),
Fatal(String),
Artifact(PathBuf, String),
}

#[derive(Clone)]
Expand Down Expand Up @@ -1907,6 +1908,13 @@ impl Emitter for SharedEmitter {
);
}

fn emit_artifact_notification(&mut self, path: &Path, artifact_type: &str) {
drop(
self.sender
.send(SharedEmitterMessage::Artifact(path.to_owned(), artifact_type.to_owned())),
)
}

fn source_map(&self) -> Option<&Lrc<SourceMap>> {
None
}
Expand Down Expand Up @@ -1982,6 +1990,9 @@ impl SharedEmitterMain {
Ok(SharedEmitterMessage::Fatal(msg)) => {
sess.dcx().fatal(msg);
}
Ok(SharedEmitterMessage::Artifact(path, artifact_type)) => {
sess.dcx().emit_artifact_notification(&path, &artifact_type);
}
Err(_) => {
break;
}
Expand Down

0 comments on commit ff73679

Please sign in to comment.