# Function std::panic::propagate [−] [src]

    pub fn propagate(payload: Box<Any + Send>) -> !

Unstable (`panic_propagate` #30752)

: awaiting feedback

Triggers a panic without invoking the panic handler.

This is designed to be used in conjunction with `recover` to, for example, carry a panic across a layer of C code.

# Examples

#![feature(std_panic, recover, panic_propagate)] fn main() { use std::panic; let result = panic::recover(|| { panic!("oh no!"); }); if let Err(err) = result { panic::propagate(err); } }

    #![feature(std_panic, recover, panic_propagate)]

    use std::panic;

    let result = panic::recover(|| {
        panic!("oh no!");
    });

    if let Err(err) = result {
        panic::propagate(err);
    }

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)