-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Rename remaining Failures in Documentation to Panic #18773
Rename remaining Failures in Documentation to Panic #18773
Conversation
@@ -43,7 +43,7 @@ pub unsafe fn reallocate(ptr: *mut u8, old_size: uint, size: uint, align: uint) | |||
/// Resize the allocation referenced by `ptr` to `size` bytes. | |||
/// | |||
/// If the operation succeeds, it returns `usable_size(size, align)` and if it | |||
/// fails (or is a no-op) it returns `usable_size(old_size, align)`. | |||
/// panics (or is a no-op) it returns `usable_size(old_size, align)`. |
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.
This is a good change, but should probably move to a Panics
section like the others have.
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.
This isn't a panic. Otherwise it would be nonsense to speak of the return value.
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.
oh duh, lol
@steveklabnik Comments addressed. I have also removed some unnecessary changes; better verify if system actually panics in those situations, before we change wording. |
Conflicts resolved and rebased. |
/// `low >= high`. | ||
/// Generate a random value in the range [`low`, `high`). | ||
/// | ||
/// # Panics |
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.
This should move to the end of the doc-block so that "This is a convience ..." isn't included in this subsection.
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.
@huonw Agree 👍. Moved below explanation section.
@subhashb sorry, didn't see that this other nit got addressed. We've had a few PRs for this, can you rebase it one more time, then leave a comment? I'll r+ asap after you do. |
@steveklabnik Rebased. Good to pull now. |
…nic, r=steveklabnik I have also renamed `fail` to `panic` in some non-documentation comments, where I thought it mattered. Fixes #18677 cc @steveklabnik
Just saw this when looking at rust-lang#19297 and couldn't find an issue/PR dealing with this. rust-lang#18773 seems to have missed this file. Compiler output is generated [here](https://github.com/rust-lang/rust/blob/770378a313a573776b16237a46b75bafa49072c1/src/librustc_trans/driver/mod.rs#L466). cc @steveklabnik
I have also renamed
fail
topanic
in some non-documentation comments, where I thought it mattered.Fixes #18677
cc @steveklabnik