-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[r+] Add note about libc::exit's unsafety. #21026
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
/// | ||
/// fn main() { | ||
/// unsafe { | ||
/// libc::exit(1 as libc::c_int); |
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.
You don't need the cast here.
@sfackler addressed |
|
||
/// Exits the running program in a possibly dangerous manner. | ||
/// | ||
/// # Unsafety |
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.
One last minor nit/question: Should this heading be Warning
or something like that rather than Unsafety
? I'm not sure how strict we want to be about the use of the term "unsafe" in documentation.
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.
Given that the function is an unsafe fn
, I chose unsafety
rather than something like "Warning".
Add note about libc::exit's unsafety. Reviewed-by: sfackler
[r+] Add note about libc::exit's unsafety. Reviewed-by: steveklabnik
[r+] Add note about libc::exit's unsafety. Reviewed-by: steveklabnik
Doing this manually as part of #21300 |
Fixes #19245.