Skip to content

Commit

Permalink
Check precompiled subprocess exit status
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 19, 2023
1 parent 63c65ef commit 425a4b7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions precompiled/serde_derive/src/lib_precompiled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ fn derive(select: u8, input: TokenStream) -> TokenStream {
buf.clear();
stdout.read_to_end(&mut buf).unwrap();

let success = match child.wait() {
Ok(exit_status) => exit_status.success(),
Err(_) => !buf.is_empty(),
};
if !success {
panic!();
}

let mut buf = InputBuffer::new(&buf);
memory.receive(&mut buf)
}
Expand Down

0 comments on commit 425a4b7

Please sign in to comment.