devela/code/result/panic/
reexports.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// devela::code::result::panic::reexports
//
//! Reexported items.
//

use crate::reexport;

/* structs */

reexport! { rust: core::panic,
    doc: "A struct providing information about a panic.",
    PanicInfo
}
reexport! { rust: core::panic,
    doc: "A struct containing information about the location of a panic.",
    @Location as PanicLocation
}
reexport! { rust: core::panic,
    doc: "A simple wrapper around a type to assert that it is unwind safe.",
    @AssertUnwindSafe as PanicAssertUnwindSafe
    // AssertUnwindSafe
}

/* traits */

reexport! { rust: core::panic,
    doc: "A marker trait which represents a shared reference considered unwind safe.",
    @RefUnwindSafe as PanicRefUnwindSafe
    // RefUnwindSafe
}
reexport! { rust: core::panic,
    doc: "A marker trait which represents “panic safe” types in Rust.",
    @UnwindSafe as PanicUnwindSafe
    // UnwindSafe
}

/* functions */

reexport! { rust: std::panic,
    doc: "Invokes a closure, capturing the cause of an unwinding panic if one occurs.",
    @catch_unwind as panic_catch
}
reexport! { rust: std::panic,
    doc: "Panic the current thread with the given message as the panic payload.",
    panic_any
}
reexport! { rust: std::panic,
    doc: "Triggers a panic without invoking the panic hook.",
    @resume_unwind as panic_resume
}
reexport! { rust: std::panic,
    doc: "Registers a custom panic hook, replacing the previously registered hook.",
    @set_hook as panic_set_hook
}
reexport! { rust: std::panic,
    doc: "Unregisters the current panic hook, returns it and registers
    the default hook in its place.",
    @take_hook as panic_unset_hook
}

/* macros */

reexport! { rust: core, doc: "Indicates unfinished code.", todo }
reexport! { rust: core, doc: "Indicates unreachable code.", unreachable }
reexport! { rust: core, doc: "Indicates unimplemented code.", unimplemented }

// NOTE: the macro and the module have the same name
//
/// <span class='stab portability' title='re-exported from rust&#39;s `core`'>`core`</span>
/// Panics the current thread.
///
#[doc = "*Re-exported from [`core::panic`][macro@crate::_core::panic]*."]
#[doc = "\n\n---"]
///
/// The reason of the `_` suffix is to avoid conflicting with the Rust's prelude
/// when glob importing from this crate. Since this macro has the same name
/// as its sibling module `core::panic`, in order to be able to re-export
/// only the macro we have to wrap it with our own.
#[macro_export]
#[cfg_attr(cargo_primary_package, doc(hidden))]
macro_rules! panic_ { ($($tt:tt)*) => { core::panic![$($tt)*] } }
#[doc(inline)]
pub use panic_;