Skip to content

Commit 1ba2721

Browse files
authored
Unrolled build for rust-lang#119566
Rollup merge of rust-lang#119566 - Zalathar:remove-spanview, r=Swatinem,Nilstrieb Remove `-Zdump-mir-spanview` The `-Zdump-mir-spanview` flag was added back in rust-lang#76074, as a development/debugging aid for the initial work on what would eventually become `-Cinstrument-coverage`. It causes the compiler to emit an HTML file containing a function's source code, with various spans highlighted based on the contents of MIR. When the suggestion was made to [triage and remove unnecessary `-Z` flags (Zulip)](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60-Z.60.20option.20triage), I noted that this flag could potentially be worth removing, but I wanted to keep it around to see whether I found it useful for my own coverage work. But when I actually tried to use it, I ran into various issues (e.g. it crashes on `tests/coverage/closure.rs`). If I can't trust it to work properly without a full overhaul, then instead of diving down a rabbit hole of trying to fix arcane span-handling bugs, it seems better to just remove this obscure old code entirely. --- ````@rustbot```` label +A-code-coverage
2 parents 432fffa + af32054 commit 1ba2721

12 files changed

+2
-919
lines changed

compiler/rustc_interface/src/tests.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use rustc_session::config::{
66
build_configuration, build_session_options, rustc_optgroups, BranchProtection, CFGuard, Cfg,
77
DebugInfo, DumpMonoStatsFormat, ErrorOutputType, ExternEntry, ExternLocation, Externs,
88
FunctionReturn, InliningThreshold, Input, InstrumentCoverage, InstrumentXRay,
9-
LinkSelfContained, LinkerPluginLto, LocationDetail, LtoCli, MirSpanview, NextSolverConfig,
10-
OomStrategy, Options, OutFileName, OutputType, OutputTypes, PAuthKey, PacRet, Passes, Polonius,
9+
LinkSelfContained, LinkerPluginLto, LocationDetail, LtoCli, NextSolverConfig, OomStrategy,
10+
Options, OutFileName, OutputType, OutputTypes, PAuthKey, PacRet, Passes, Polonius,
1111
ProcMacroExecutionStrategy, Strip, SwitchWithOptPath, SymbolManglingVersion, WasiExecModel,
1212
};
1313
use rustc_session::lint::Level;
@@ -666,7 +666,6 @@ fn test_unstable_options_tracking_hash() {
666666
untracked!(dump_mir_dir, String::from("abc"));
667667
untracked!(dump_mir_exclude_pass_number, true);
668668
untracked!(dump_mir_graphviz, true);
669-
untracked!(dump_mir_spanview, Some(MirSpanview::Statement));
670669
untracked!(dump_mono_stats, SwitchWithOptPath::Enabled(Some("mono-items-dir/".into())));
671670
untracked!(dump_mono_stats_format, DumpMonoStatsFormat::Json);
672671
untracked!(dylib_lto, true);

compiler/rustc_middle/src/mir/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ pub mod mono;
5555
pub mod patch;
5656
pub mod pretty;
5757
mod query;
58-
pub mod spanview;
5958
mod statement;
6059
mod syntax;
6160
pub mod tcx;

compiler/rustc_middle/src/mir/pretty.rs

-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::io::{self, Write as _};
55
use std::path::{Path, PathBuf};
66

77
use super::graphviz::write_mir_fn_graphviz;
8-
use super::spanview::write_mir_fn_spanview;
98
use rustc_ast::InlineAsmTemplatePiece;
109
use rustc_middle::mir::interpret::{
1110
alloc_range, read_target_uint, AllocBytes, AllocId, Allocation, GlobalAlloc, Pointer,
@@ -141,16 +140,6 @@ fn dump_matched_mir_node<'tcx, F>(
141140
write_mir_fn_graphviz(tcx, body, false, &mut file)?;
142141
};
143142
}
144-
145-
if let Some(spanview) = tcx.sess.opts.unstable_opts.dump_mir_spanview {
146-
let _: io::Result<()> = try {
147-
let file_basename = dump_file_basename(tcx, pass_num, pass_name, disambiguator, body);
148-
let mut file = create_dump_file_with_basename(tcx, &file_basename, "html")?;
149-
if body.source.def_id().is_local() {
150-
write_mir_fn_spanview(tcx, body, spanview, &file_basename, &mut file)?;
151-
}
152-
};
153-
}
154143
}
155144

156145
/// Returns the file basename portion (without extension) of a filename path

0 commit comments

Comments
 (0)