consciousness/src/bin/consciousness.rs

18 lines
709 B
Rust
Raw Normal View History

#![feature(panic_backtrace_config)]
#![warn(unreachable_pub)]
fn main() {
// Force the default panic hook to print a backtrace. stderr is
// already redirected to a daemon log; without this the hook obeys
// RUST_BACKTRACE (unset by default), so the log only shows the
// "note: run with `RUST_BACKTRACE=full`" tail and the actual
// frames are lost.
//
// SAFETY: called before any other thread is spawned, so no
// concurrent env reader can race.
if std::env::var_os("RUST_BACKTRACE").is_none() {
unsafe { std::env::set_var("RUST_BACKTRACE", "1"); }
}
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
consciousness::user::main()
}