1
Fork 0

make -Z mir-include-spans a dedicated enum

We want to allow setting this on the CLI, override it only in MIR
passes, and disable it altogether in mir-opt tests.

The default value is "only for NLL MIR dumps", which is considered off
for all intents and purposes, except for `rustc_borrowck` when an NLL
MIR dump is requested.
This commit is contained in:
Rémy Rakic 2024-08-28 21:13:56 +00:00
parent c646b46b52
commit e0bb1c7291
4 changed files with 44 additions and 7 deletions

View file

@ -54,7 +54,7 @@ pub struct PrettyPrintMirOptions {
impl PrettyPrintMirOptions {
/// Create the default set of MIR pretty-printing options from the CLI flags.
pub fn from_cli(tcx: TyCtxt<'_>) -> Self {
Self { include_extra_comments: tcx.sess.opts.unstable_opts.mir_include_spans }
Self { include_extra_comments: tcx.sess.opts.unstable_opts.mir_include_spans.is_enabled() }
}
}