-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make some inline functions like WIFEXITED and WEXITSTATUS const and safe #1870
Conversation
r? @JohnTitor (rust_highfive has picked a reviewer for you, use r? to override) |
I'm quite not sure if we could allow the safe things here; @alexcrichton if you have some time, could you review this? I assume you're familiar with that. |
AFAIK this should be fine to do, there's nothing technically preventing this. I believe the original decision for these functions was uniformity in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Alex! The macro itself looks good to me, let's go ahead :) And thanks to Josh for implementing it!
Awesome, thanks @JohnTitor and @alexcrichton. |
Use #[allow(unused_unsafe)] to work around inconsitency with fn unsafe in libc after [nix-rust#1870](rust-lang/libc#1870) change.
The pr rust-lang#1870 introduced safe_f! macro, which made some functions like WIFEXITED and WEXITSTATUS const and safe on linux_like platform only, which causes inconsistency when trying to use those functions in crates compiled across multiple platforms, as using unsafe on those functions will generate unused_unsafe warning on linux platforms and lack of unsafe block will fail compilation on non-linux platforms. To avoid the inconsistency, this commit applies the same macro for all the same functions on other platforms too.
The pr rust-lang#1870 introduced safe_f! macro, which made some functions like WIFEXITED and WEXITSTATUS const and safe on linux_like platform only, which causes inconsistency when trying to use those functions in crates compiled across multiple platforms, as using unsafe on those functions will generate unused_unsafe warning on linux platforms and lack of unsafe block will fail compilation on non-linux platforms. To avoid the inconsistency, this commit applies the same macro for all the same functions on other platforms too.
(rust-lang/libc#1870) Denied lint being overridden instead of unsafe block removed to preserve compatibility with old `libc` versions.
Use #[allow(unused_unsafe)] to work around inconsitency with fn unsafe in libc after [nix-rust#1870](rust-lang/libc#1870) change.
(rust-lang/libc#1870) Denied lint being overridden instead of unsafe block removed to preserve compatibility with old `libc` versions.
No description provided.