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

I/O safety. #87329

Merged
merged 28 commits into from
Aug 20, 2021
Merged

I/O safety. #87329

merged 28 commits into from
Aug 20, 2021

Commits on Aug 19, 2021

  1. I/O safety.

    Introduce `OwnedFd` and `BorrowedFd`, and the `AsFd` trait, and
    implementations of `AsFd`, `From<OwnedFd>` and `From<T> for OwnedFd`
    for relevant types, along with Windows counterparts for handles and
    sockets.
    
    Tracking issue:
     - <rust-lang#87074>
    
    RFC:
     - <https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md>
    sunfishcode committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    d154185 View commit details
    Browse the repository at this point in the history
  2. Update library/std/src/os/unix/io/fd.rs

    Co-authored-by: Josh Triplett <[email protected]>
    sunfishcode and joshtriplett committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    3a38511 View commit details
    Browse the repository at this point in the history
  3. Update library/std/src/os/windows/io/handle.rs

    Co-authored-by: Josh Triplett <[email protected]>
    sunfishcode and joshtriplett committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    a23ca7c View commit details
    Browse the repository at this point in the history
  4. Update library/std/src/os/windows/io/socket.rs

    Co-authored-by: Josh Triplett <[email protected]>
    sunfishcode and joshtriplett committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    1c6bf04 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1f8a450 View commit details
    Browse the repository at this point in the history
  6. Be more precise about mmap and undefined behavior.

    `mmap` doesn't *always* cause undefined behavior; it depends on the
    details of how you use it.
    sunfishcode committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    6b4dbdb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    31f7bf8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    926344a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    45b5de3 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0cb69de View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    6486f89 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    6d72117 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    1b35f74 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    68964a7 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    ab08639 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    907f00b View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    71dab73 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    1dbd6d6 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    18a9f46 View commit details
    Browse the repository at this point in the history
  20. Rename OptionFileHandle to HandleOrInvalid and make it just wrap an O…

    …ption<OwnedHandle>
    
    The name (and updated documentation) make the FFI-only usage clearer, and wrapping Option<OwnedHandle> avoids the need to write a separate Drop or Debug impl.
    
    Co-authored-by: Josh Triplett <[email protected]>
    sunfishcode and joshtriplett committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    1ae1eee View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    cada5fb View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    a7d9ab5 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    9b99f8c View commit details
    Browse the repository at this point in the history
  24. Use the correct into_* on Windows to avoid dropping a stdio handle.

    Use `into_raw_handle()` rather than `into_inner()` to completely consume a
    `Handle` without dropping its contained handle.
    sunfishcode committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    6f87288 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    187ee5c View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    0377a63 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    e555003 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    b4dfa19 View commit details
    Browse the repository at this point in the history