Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide ExitStatusError #82973

Merged
merged 7 commits into from
May 18, 2021
Merged

Provide ExitStatusError #82973

merged 7 commits into from
May 18, 2021

Commits on May 10, 2021

  1. windows: provide NonZeroDWORD

    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed May 10, 2021
    Configuration menu
    Copy the full SHA
    b50c1bb View commit details
    Browse the repository at this point in the history

Commits on May 12, 2021

  1. Provide ExitStatusError

    Closes rust-lang#73125
    
    This is in pursuance of
      Issue rust-lang#73127 Consider adding #[must_use] to std::process::ExitStatus
    
    In
      MR rust-lang#81452 Add #[must_use] to [...] process::ExitStatus
    we concluded that the existing arrangements in are too awkward
    so adding that #[must_use] is blocked on improving the ergonomics.
    
    I wrote a mini-RFC-style discusion of the approach in
      rust-lang#73125 (comment)
    
    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed May 12, 2021
    Configuration menu
    Copy the full SHA
    e893089 View commit details
    Browse the repository at this point in the history
  2. unix: impl ExitStatusExt for ExitStatusError

    It is unergnomic to have to say things like
       bad.into_status().signal()
    
    Implementing `ExitStatusExt` for `ExitStatusError` fixes this.
    Unfortunately it does mean making a previously-infallible method
    capable of panicing, although of course the existing impl remains
    infallible.
    
    The alternative would be a whole new `ExitStatusErrorExt` trait.
    
    `<ExitStatus as ExitStatusExt>::into_raw()` is not particularly
    ergonomic to call because of the often-required type annotation.
    See for example the code in the test case in
      library/std/src/sys/unix/process/process_unix/tests.rs
    
    Perhaps we should provide equivalent free functions for `ExitStatus`
    and `ExitStatusExt` in std::os::unix::process and maybe deprecate this
    trait method.  But I think that is for the future.
    
    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed May 12, 2021
    Configuration menu
    Copy the full SHA
    60a4d96 View commit details
    Browse the repository at this point in the history
  3. Fix typo in doc

    Co-authored-by: Josh Triplett <josh@joshtriplett.org>
    ijackson and joshtriplett committed May 12, 2021
    Configuration menu
    Copy the full SHA
    8832b0a View commit details
    Browse the repository at this point in the history
  4. ExitStatusError: Be more verbose in Display impl

    Co-authored-by: Jane Lusby <jlusby@yaah.dev>
    ijackson and yaahc committed May 12, 2021
    Configuration menu
    Copy the full SHA
    bb4ef68 View commit details
    Browse the repository at this point in the history
  5. impl crate::error::Error for ExitStatusError

    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed May 12, 2021
    Configuration menu
    Copy the full SHA
    4687153 View commit details
    Browse the repository at this point in the history
  6. ExitStatusError: Remove mentions in stable docs

    We should revert this commit when this is stabilised.
    
    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed May 12, 2021
    Configuration menu
    Copy the full SHA
    26c782b View commit details
    Browse the repository at this point in the history