Skip to content

document some -Z flags as living in the rustc-dev-guide #141480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# `eagerly-emit-delayed-bugs`

This feature is perma-unstable and has no tracking issue.

------------------------

This flag converts all [`span_delayed_bug()`] calls to [`bug!`] calls, exiting the compiler immediately and allowing you to generate a backtrace of where the delayed bug occurred.
For full documentation, see [the rustc-dev-guide][dev-guide-delayed].

[`bug!`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/macro.bug.html
[`span_delayed_bug()`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.DiagCtxtHandle.html#method.span_delayed_bug
[dev-guide-delayed]: https://rustc-dev-guide.rust-lang.org/compiler-debugging.html#debugging-delayed-bugs
11 changes: 11 additions & 0 deletions src/doc/unstable-book/src/compiler-flags/track-diagnostics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `track-diagnostics`

This feature is perma-unstable and has no tracking issue.

------------------------

This flag prints the source code span in the compiler where a diagnostic was generated, respecting [`#[track_caller]`][track_caller]. Note that this may be different from the place it was emitted.
For full documentation, see [the rustc-dev-guide][dev-guide-track-diagnostics].

[track_caller]: https://doc.rust-lang.org/reference/attributes/codegen.html#the-track_caller-attribute
[dev-guide-track-diagnostics]: https://rustc-dev-guide.rust-lang.org/compiler-debugging.html#getting-the-error-creation-location
13 changes: 13 additions & 0 deletions src/doc/unstable-book/src/compiler-flags/treat-err-as-bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# `treat-err-as-bug`

This feature is perma-unstable and has no tracking issue.

------------------------

This 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.
For full documentation, see [the rustc-dev-guide][dev-guide-backtrace].

Note that the compiler automatically sets `RUST_BACKTRACE=1` for itself, and so you do not need to set it yourself when using this flag.

[`bug!`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/macro.bug.html
[dev-guide-backtrace]: https://rustc-dev-guide.rust-lang.org/compiler-debugging.html#getting-a-backtrace-for-errors
Loading