rt/hosted.rs
1// hosted -- what rt has for a program with the standard library (feature std, docs/CRATES.md
2// CR6); the only file of rt that names std, compiled only with that feature. std brings the panic
3// handler, the allocator and the memory functions then (lib.rs, mem.rs and os.rs leave theirs out).
4//
5// panic_hook() std's panics end as rt's panic handler ends them without std
6
7/// (feature std) std's panics end as rt's panic handler ends them without std: one line on stderr,
8/// the crash hook, exit code 3. plat's start of a std program installs it; replacing it with
9/// `std::panic::set_hook` gives up JFLib's crash report for panics.
10pub fn panic_hook() {
11 std::panic::set_hook(alloc::boxed::Box::new(|info| crate::panic_report(info)));
12}