src/doc/unstable-book/src/compiler-flags/treat-err-as-bug.md MARKDOWN 14 lines View on github.com → Search inside
1# `treat-err-as-bug`23This feature is perma-unstable and has no tracking issue.45------------------------67This flag converts the selected error to a [`bug!`] call, exiting the compiler immediately and allowing you to generate a backtrace of where the error occurred.8For full documentation, see [the rustc-dev-guide][dev-guide-backtrace].910Note that the compiler automatically sets `RUST_BACKTRACE=1` for itself, and so you do not need to set it yourself when using this flag.1112[`bug!`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/macro.bug.html13[dev-guide-backtrace]: https://rustc-dev-guide.rust-lang.org/compiler-debugging.html#getting-a-backtrace-for-errors

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.