Skip to content

Commit 618cf5f

Browse files
committed
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?
1 parent 89c4e37 commit 618cf5f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/libstd/rt/unwind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub unsafe fn try<F: FnOnce()>(f: F) -> Result<(), Box<Any + Send>> {
152152
}
153153
}
154154

155-
/// Test if the current thread is currently panicking.
155+
/// Determines whether the current thread is unwinding because of panic.
156156
pub fn panicking() -> bool {
157157
PANICKING.with(|s| s.get())
158158
}

src/libstd/thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ impl Thread {
382382
unsafe { imp::yield_now() }
383383
}
384384

385-
/// Determines whether the current thread is panicking.
385+
/// Determines whether the current thread is unwinding because of panic.
386386
#[inline]
387387
#[stable]
388388
pub fn panicking() -> bool {

0 commit comments

Comments
 (0)