about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2021-10-03 23:13:18 -0700
committerGitHub <noreply@github.com>2021-10-03 23:13:18 -0700
commite4d257e1d359cb0ec25f7a38964eef8a19d7ae71 (patch)
tree8f64ccb1f17884c6cc3ecde80afa01b286f45ae8 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parentf2ec71fe74ca9db59dbcc43983d689ca31139779 (diff)
parent848a38ac9d9bc956cded893bdd55e1171a2706dd (diff)
downloadrust-e4d257e1d359cb0ec25f7a38964eef8a19d7ae71.tar.gz
rust-e4d257e1d359cb0ec25f7a38964eef8a19d7ae71.zip
Rollup merge of #88305 - ijackson:exitstatus-debug, r=dtolnay
Manual Debug for Unix ExitCode ExitStatus ExitStatusError

These structs have misleading names.  An ExitStatus[Error] is actually a Unix wait status; an ExitCode is actually an exit status.  These misleading names appear in the `Debug` output.

The `Display` impls on Unix have been improved, but the `Debug` impls are still misleading, as reported in #74832.

Fix this by pretending that these internal structs are called `unix_exit_status` and `unix_wait_status` as applicable.  (We can't actually rename the structs because of the way that the cross-platform machinery works: the names are cross-platform.)

After this change, this program
```
#![feature(exit_status_error)]
fn main(){
    let x = std::process::Command::new("false").status().unwrap();
    dbg!(x.exit_ok());
    eprintln!("x={:?}",x);
}
```
produces this output
```
[src/main.rs:4] x.exit_ok() = Err(
    ExitStatusError(
        unix_wait_status(
            256,
        ),
    ),
)
x=ExitStatus(unix_wait_status(256))
```

Closes #74832
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions