enable short backtraces by default

Uses panic_backtrace_config feature to set BacktraceStyle::Short,
so panics show useful backtraces without needing RUST_BACKTRACE=1.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-12 20:11:27 -04:00
parent dfab7d0a33
commit 4556e16fd7
2 changed files with 10 additions and 1 deletions

View file

@ -1,2 +1,7 @@
#![feature(panic_backtrace_config)]
#![warn(unreachable_pub)]
fn main() { consciousness::user::main() }
fn main() {
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
consciousness::user::main()
}

View file

@ -1,3 +1,5 @@
#![feature(panic_backtrace_config)]
// poc-memory: graph-structured memory for AI assistants
//
// Authors: ProofOfConcept <poc@bcachefs.org> and Kent Overstreet
@ -617,6 +619,8 @@ impl Run for AdminCmd {
}
fn main() {
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
// Handle --help ourselves for expanded subcommand display
let args: Vec<String> = std::env::args().collect();
if args.len() <= 1 || args.iter().any(|a| a == "--help" || a == "-h") && args.len() == 2 {