update panicking() docs for panic=abort#153295
update panicking() docs for panic=abort#153295biscuitrescue wants to merge 2 commits intorust-lang:mainfrom
Conversation
There was a problem hiding this comment.
|
@SpriteOvO: 🔑 Insufficient privileges: not in review users |
|
@rustbot reroll |
library/std/src/thread/functions.rs
Outdated
| /// |-----------|----------------------------------------------------------------------| | ||
| /// | Linux | [clock_nanosleep] (Monotonic clock) | | ||
| /// | BSD except OpenBSD | [clock_nanosleep] (Monotonic Clock)] | | ||
| /// | BSD except OpenBSD | [clock_nanosleep] (Monotonic Clock) | |
There was a problem hiding this comment.
| /// | BSD except OpenBSD | [clock_nanosleep] (Monotonic Clock) | | |
| /// | BSD except OpenBSD | [clock_nanosleep] (Monotonic Clock) | |
Before merging, perhaps you'd like to fix this very very very minor nitpick 😇 -- aligning the table's divider.
There was a problem hiding this comment.
done and pushed.
9fd469d to
7072f83
Compare
library/std/src/thread/functions.rs
Outdated
| } | ||
|
|
||
| /// Determines whether the current thread is unwinding because of panic. | ||
| /// Determines whether the current thread panicking. |
There was a problem hiding this comment.
“panicking” -> “is panicking”
library/std/src/thread/functions.rs
Outdated
| /// | ||
| /// Note that this returns `true` when thread is unwinding due to panic, | ||
| /// as well as when a panic hook is executing and program is configured to abort | ||
| /// on panic (`panic=abort`) |
There was a problem hiding this comment.
Perhaps this could be rephrased as
… unwinding due to a panic or executing a panic hook. The latter case will still happen when
panic=abortis set.
Since this returns true during panic hooks even when unwinding, right?
Also grammar nits on the current version: “due to a panic”, “and the program”, and missing period at the end of the sentence.
There was a problem hiding this comment.
changed. also edited the underlying system calls table to match case and removed the trailing ] because it was sticking out to me
|
Reminder, once the PR becomes ready for a review, use |
b5e609d to
6ac34fc
Compare
|
@rustbot ready |
6ac34fc to
bf08176
Compare
| /// Note that this returns `true` both when the thread is unwinding due to a | ||
| /// panic or executing a panic hook. The latter case will still happen when |
There was a problem hiding this comment.
This returns
truewhen the thread is either unwinding due to a panic, or when it is executing a panic hook. Note that the latter case ...
Minor rewording suggestion to move the "note" bit to the second sentence since it's more of a note, and slightly smooth out the first sentence.
Please squash commits after this then LGTM, thanks for the additional fixes
fixes #151458
The documentation for
std::thread::panicking()has not been changed since v1.0, even though panic hooks were added in v1.10.Current documentation is misleading for
panic=abortpanicking()can returntruein 2 different cases:panic=abortr? @SpriteOvO