about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2021-02-22 14:30:03 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2021-02-22 18:15:42 +0000
commitfbd575aedf1a60ca5528d5be945639e02d44b3e7 (patch)
tree4270508d0b9106f474b2ff8d5bc189613dd681a6 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent8a9f7862bcfa5870a34bb54f77a03c73d1db5c37 (diff)
downloadrust-fbd575aedf1a60ca5528d5be945639e02d44b3e7.tar.gz
rust-fbd575aedf1a60ca5528d5be945639e02d44b3e7.zip
process::unix: Handle other wait statuses in ExitStatus as Display
Currently, on Nightly, this panics:

```
use std::process::ExitStatus;
use std::os::unix::process::ExitStatusExt;

fn main() {
    let st = ExitStatus::from_raw(0x007f);
    println!("st = {}", st);
}
```

This is because the impl of Display assumes that if .code() is None,
.signal() must be Some.  That was a false assumption, although it was
true with buggy code before
  5b1316f78152a9c066b357ea9addf803d48e114a
  unix ExitStatus: Do not treat WIFSTOPPED as WIFSIGNALED

This is not likely to have affected many people in practice, because
`Command` will never produce such a wait status (`ExitStatus`).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions