Refine wording of Thread::panicking
Previous wording wasn’t clear about its actual behaviour. It could be interpreted as answering either: * Can current thread panic? * Is current thread unwinding because of panic?
This commit is contained in:
parent
89c4e3792d
commit
618cf5f8d7
2 changed files with 2 additions and 2 deletions
|
@ -152,7 +152,7 @@ pub unsafe fn try<F: FnOnce()>(f: F) -> Result<(), Box<Any + Send>> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Test if the current thread is currently panicking.
|
/// Determines whether the current thread is unwinding because of panic.
|
||||||
pub fn panicking() -> bool {
|
pub fn panicking() -> bool {
|
||||||
PANICKING.with(|s| s.get())
|
PANICKING.with(|s| s.get())
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,7 +382,7 @@ impl Thread {
|
||||||
unsafe { imp::yield_now() }
|
unsafe { imp::yield_now() }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Determines whether the current thread is panicking.
|
/// Determines whether the current thread is unwinding because of panic.
|
||||||
#[inline]
|
#[inline]
|
||||||
#[stable]
|
#[stable]
|
||||||
pub fn panicking() -> bool {
|
pub fn panicking() -> bool {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue