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

Rollup of 3 pull requests #127757

Merged
merged 31 commits into from
Jul 15, 2024
Merged

Rollup of 3 pull requests #127757

merged 31 commits into from
Jul 15, 2024

Commits on Jul 14, 2024

  1. std: deny(unsafe_op_in_unsafe_fn) but allow sites

    This provides a list of locations to hunt down issues in.
    workingjubilee committed Jul 14, 2024
    Configuration menu
    Copy the full SHA
    4572ed6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    87d850d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ce35265 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2024

  1. Configuration menu
    Copy the full SHA
    83a0fe5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    df353a0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    64fb236 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e324602 View commit details
    Browse the repository at this point in the history
  5. Remove NonZeroDWORD

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    1d1cae1 View commit details
    Browse the repository at this point in the history
  6. Remove LARGE_INTEGER

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    91ba4eb View commit details
    Browse the repository at this point in the history
  7. Remove LONG

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    65da4af View commit details
    Browse the repository at this point in the history
  8. Remove UINT

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    b107cfa View commit details
    Browse the repository at this point in the history
  9. Remove LPWSTR

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    e70cc28 View commit details
    Browse the repository at this point in the history
  10. Remove USHORT

    We stick to C types in for socket and address as these are at least nominally BSD-ish and they're used outside of pal/windows in general *nix code
    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    f2cc943 View commit details
    Browse the repository at this point in the history
  11. Remove CHAR

    As with USHORT, keep using C types for BSD socket APIs.
    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    5b700a7 View commit details
    Browse the repository at this point in the history
  12. Remove SIZE_T

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    286c327 View commit details
    Browse the repository at this point in the history
  13. Remove LPCVOID

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    8052fb8 View commit details
    Browse the repository at this point in the history
  14. Remove LPOVERLAPPED

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    1b7cf3a View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    351f1f3 View commit details
    Browse the repository at this point in the history
  16. Remove LPVOID

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    84dd7e4 View commit details
    Browse the repository at this point in the history
  17. Remove PSRWLOCK

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    21f69b5 View commit details
    Browse the repository at this point in the history
  18. Remove ULONG

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    d8d7c5c View commit details
    Browse the repository at this point in the history
  19. Remove DWORD

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    e2b062c View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    8a1ce3d View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    ffe8fc2 View commit details
    Browse the repository at this point in the history
  22. Fix Windows 7

    ChrisDenton committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    816d90a View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    2402e84 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    3411a02 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    7e16d5f View commit details
    Browse the repository at this point in the history
  26. Rollup merge of rust-lang#127712 - ChrisDenton:raw-types, r=workingju…

    …bilee
    
    Windows: Remove some unnecessary type aliases
    
    Back in the olden days, C did not have fixed-width types so these type aliases were at least potentially useful. Nowadays, and especially in Rust, we don't need the aliases and they don't help with anything. Notably the windows bindings we use also don't bother with the aliases. And even when we have used aliases they're often only used once then forgotten about.
    
    The only one that gives me pause is `DWORD` because it's used a fair bit. But it's still used inconsistently and we implicitly assume it's a `u32` anyway (e.g. `as` casting from an `i32`).
    workingjubilee authored Jul 15, 2024
    Configuration menu
    Copy the full SHA
    64495b5 View commit details
    Browse the repository at this point in the history
  27. Rollup merge of rust-lang#127744 - workingjubilee:deny-unsafe-op-in-s…

    …td, r=jhpratt
    
    std: `#![deny(unsafe_op_in_unsafe_fn)]` in platform-independent code
    
    This applies the `unsafe_op_in_unsafe_fn` lint in all places in std that _do not have platform-specific cfg in their code_. For all such places, the lint remains allowed, because they need further work to address the relevant concerns. This list includes:
    
    - `std::backtrace_rs` (internal-only)
    - `std::sys` (internal-only)
    - `std::os`
    
    Notably this eliminates all "unwrapped" unsafe operations in `std::io` and `std::sync`, which will make them much more auditable in the future. Such has *also* been left for future work. While I made a few safety comments along the way on interfaces I have grown sufficiently familiar with, in most cases I had no context, nor particular confidence the unsafety was correct.
    
    In the cases where I was able to determine the unsafety was correct without having prior context, it was obviously redundant. For example, an unsafe function calling another unsafe function that has the exact same contract, forwarding its caller's requirements just as it forwards its actual call.
    workingjubilee authored Jul 15, 2024
    Configuration menu
    Copy the full SHA
    99c5302 View commit details
    Browse the repository at this point in the history
  28. Rollup merge of rust-lang#127750 - ChrisDenton:safe-unsafe-unsafe, r=…

    …workingjubilee
    
    Make os/windows and pal/windows default to `#![deny(unsafe_op_in_unsafe_fn)]`
    
    This is to prevent regressions in modules that currently pass. I did also fix up a few trivial places where the module contained only one or two simple wrappers. In more complex cases we should try to ensure the `unsafe` blocks are appropriately scoped and have any appropriate safety comments.
    
    This does not fix the windows bits of rust-lang#127747 but it should help prevent regressions until that is done and also make it more obvious specifically which modules need attention.
    workingjubilee authored Jul 15, 2024
    Configuration menu
    Copy the full SHA
    476d399 View commit details
    Browse the repository at this point in the history