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

Enable API documentation for std::os::wasi. #82420

Merged
merged 6 commits into from
Feb 27, 2021

Commits on Feb 23, 2021

  1. Enable API documentation for std::os::wasi.

    This adds API documentation support for `std::os::wasi` modeled after
    how `std::os::unix` works, so that WASI can be documented [here] along
    with the other platforms.
    
    [here]: https://doc.rust-lang.org/stable/std/os/index.html
    
    Two changes of particular interest:
    
     - This changes the `AsRawFd` for `io::Stdin` for WASI to return
       `libc::STDIN_FILENO` instead of `sys::stdio::Stdin.as_raw_fd()` (and
       similar for `Stdout` and `Stderr`), which matches how the `unix`
       version works. `STDIN_FILENO` etc. may not always be explicitly
       reserved at the WASI level, but as long as we have Rust's `std` and
       `libc`, I think it's reasonable to guarantee that we'll always use
       `libc::STDIN_FILENO` for stdin.
    
     - This duplicates the `osstr2str` utility function, rather than
       trying to share it across all the configurations that need it.
    sunfishcode committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    132ec26 View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2021

  1. Cast libc::STDIN_FILENO to RawFd.

    WASI's `RawFd` is a `u32`, while `libc` uses `c_int`.
    sunfishcode committed Feb 24, 2021
    Configuration menu
    Copy the full SHA
    9ce567e View commit details
    Browse the repository at this point in the history
  2. Use super:: to refer to WASI-specific names.

    This ensures that these names resolve to the right place even when
    building the WASI support on other platforms for generating the
    documentation.
    sunfishcode committed Feb 24, 2021
    Configuration menu
    Copy the full SHA
    0208fca View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e66e263 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    94e75ac View commit details
    Browse the repository at this point in the history
  5. x.py fmt

    sunfishcode committed Feb 24, 2021
    Configuration menu
    Copy the full SHA
    7d5242a View commit details
    Browse the repository at this point in the history