Skip to content

Conversation

steveklabnik
Copy link
Contributor

Fixes #19245.

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

///
/// fn main() {
/// unsafe {
/// libc::exit(1 as libc::c_int);
Copy link
Member

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.

@steveklabnik
Copy link
Contributor Author

@sfackler addressed


/// Exits the running program in a possibly dangerous manner.
///
/// # Unsafety
Copy link
Member

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.

Copy link
Contributor Author

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".

bors added a commit that referenced this pull request Jan 14, 2015
Add note about libc::exit's unsafety.

Reviewed-by: sfackler
@nikomatsakis nikomatsakis changed the title Add note about libc::exit's unsafety. [r+] Add note about libc::exit's unsafety. Jan 14, 2015
bors added a commit that referenced this pull request Jan 17, 2015
[r+] Add note about libc::exit's unsafety.

Reviewed-by: steveklabnik
bors added a commit that referenced this pull request Jan 17, 2015
[r+] Add note about libc::exit's unsafety.

Reviewed-by: steveklabnik
@steveklabnik
Copy link
Contributor Author

Doing this manually as part of #21300

@steveklabnik steveklabnik deleted the gh19245 branch October 25, 2017 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document (in?)ability to exit a program
6 participants