Make some inline functions like WIFEXITED and WEXITSTATUS const and safe#1870
Merged
JohnTitor merged 1 commit intorust-lang:masterfrom Aug 20, 2020
Merged
Make some inline functions like WIFEXITED and WEXITSTATUS const and safe#1870JohnTitor merged 1 commit intorust-lang:masterfrom
JohnTitor merged 1 commit intorust-lang:masterfrom
Conversation
|
r? @JohnTitor (rust_highfive has picked a reviewer for you, use r? to override) |
Member
|
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. |
Member
|
AFAIK this should be fine to do, there's nothing technically preventing this. I believe the original decision for these functions was uniformity in |
JohnTitor
approved these changes
Aug 20, 2020
Member
JohnTitor
left a comment
There was a problem hiding this comment.
Thanks, Alex! The macro itself looks good to me, let's go ahead :) And thanks to Josh for implementing it!
Member
Author
|
Awesome, thanks @JohnTitor and @alexcrichton. |
xonatius
added a commit
to xonatius/nix
that referenced
this pull request
Sep 13, 2020
Use #[allow(unused_unsafe)] to work around inconsitency with fn unsafe in libc after [nix-rust#1870](rust-lang/libc#1870) change.
xonatius
added a commit
to xonatius/libc
that referenced
this pull request
Sep 13, 2020
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.
xonatius
added a commit
to xonatius/libc
that referenced
this pull request
Sep 13, 2020
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.
vi
added a commit
to vi/nix
that referenced
this pull request
Sep 13, 2020
(rust-lang/libc#1870) Denied lint being overridden instead of unsafe block removed to preserve compatibility with old `libc` versions.
xonatius
added a commit
to xonatius/nix
that referenced
this pull request
Sep 20, 2020
Use #[allow(unused_unsafe)] to work around inconsitency with fn unsafe in libc after [nix-rust#1870](rust-lang/libc#1870) change.
yoav-steinberg
pushed a commit
to yoav-steinberg/nix
that referenced
this pull request
Oct 4, 2020
(rust-lang/libc#1870) Denied lint being overridden instead of unsafe block removed to preserve compatibility with old `libc` versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.