Skip to content

Commit a700546

Browse files
committed
Fix thread::catch_panic documentation to mention its return value on success
Fixes #27027.
1 parent d4d4206 commit a700546

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/libstd/thread/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ pub fn panicking() -> bool {
434434

435435
/// Invokes a closure, capturing the cause of panic if one occurs.
436436
///
437-
/// This function will return `Ok(())` if the closure does not panic, and will
438-
/// return `Err(cause)` if the closure panics. The `cause` returned is the
439-
/// object with which panic was originally invoked.
437+
/// This function will return `Ok` with the closure's result if the closure
438+
/// does not panic, and will return `Err(cause)` if the closure panics. The
439+
/// `cause` returned is the object with which panic was originally invoked.
440440
///
441441
/// It is currently undefined behavior to unwind from Rust code into foreign
442442
/// code, so this function is particularly useful when Rust is called from

0 commit comments

Comments
 (0)