Skip to content

Commit e52f5bf

Browse files
committed
Remove -Zshow-span.
It's very old (added in #12087). It's strange, and it's not clear what its use cases are. It only works with the crate root file because it runs before expansion. I suspect it won't be missed.
1 parent e93e096 commit e52f5bf

File tree

8 files changed

+1
-91
lines changed

8 files changed

+1
-91
lines changed

Diff for: compiler/rustc_ast_passes/messages.ftl

-2
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ ast_passes_precise_capturing_duplicated = duplicate `use<...>` precise capturing
207207
208208
ast_passes_precise_capturing_not_allowed_here = `use<...>` precise capturing syntax not allowed in {$loc}
209209
210-
ast_passes_show_span = {$msg}
211-
212210
ast_passes_stability_outside_std = stability attributes may not be used outside of the standard library
213211
214212
ast_passes_static_without_body =

Diff for: compiler/rustc_ast_passes/src/errors.rs

-8
Original file line numberDiff line numberDiff line change
@@ -779,14 +779,6 @@ pub(crate) struct IncompatibleFeatures {
779779
pub f2: Symbol,
780780
}
781781

782-
#[derive(Diagnostic)]
783-
#[diag(ast_passes_show_span)]
784-
pub(crate) struct ShowSpan {
785-
#[primary_span]
786-
pub span: Span,
787-
pub msg: &'static str,
788-
}
789-
790782
#[derive(Diagnostic)]
791783
#[diag(ast_passes_negative_bound_not_supported)]
792784
pub(crate) struct NegativeBoundUnsupported {

Diff for: compiler/rustc_ast_passes/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! The `rustc_ast_passes` crate contains passes which validate the AST in `syntax`
22
//! parsed by `rustc_parse` and then lowered, after the passes in this crate,
33
//! by `rustc_ast_lowering`.
4-
//!
5-
//! The crate also contains other misc AST visitors, e.g. `node_count` and `show_span`.
64
75
// tidy-alphabetical-start
86
#![allow(internal_features)]
@@ -18,6 +16,5 @@
1816
pub mod ast_validation;
1917
mod errors;
2018
pub mod feature_gate;
21-
pub mod show_span;
2219

2320
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }

Diff for: compiler/rustc_ast_passes/src/show_span.rs

-68
This file was deleted.

Diff for: compiler/rustc_driver_impl/src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,7 @@ fn run_compiler(
418418
return early_exit();
419419
}
420420

421-
if sess.opts.unstable_opts.parse_crate_root_only
422-
|| sess.opts.unstable_opts.show_span.is_some()
423-
{
421+
if sess.opts.unstable_opts.parse_crate_root_only {
424422
return early_exit();
425423
}
426424

Diff for: compiler/rustc_interface/src/passes.rs

-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ pub(crate) fn parse<'a>(sess: &'a Session) -> Result<ast::Crate> {
5454
})
5555
.map_err(|parse_error| parse_error.emit())?;
5656

57-
if let Some(ref s) = sess.opts.unstable_opts.show_span {
58-
rustc_ast_passes::show_span::run(sess.dcx(), s, &krate);
59-
}
60-
6157
if sess.opts.unstable_opts.input_stats {
6258
input_stats::print_ast_stats(&krate, "PRE EXPANSION AST STATS", "ast-stats-1");
6359
}

Diff for: compiler/rustc_interface/src/tests.rs

-1
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,6 @@ fn test_unstable_options_tracking_hash() {
843843
tracked!(sanitizer_recover, SanitizerSet::ADDRESS);
844844
tracked!(saturating_float_casts, Some(true));
845845
tracked!(share_generics, Some(true));
846-
tracked!(show_span, Some(String::from("abc")));
847846
tracked!(simulate_remapped_rust_src_base, Some(PathBuf::from("/rustc/abc")));
848847
tracked!(small_data_threshold, Some(16));
849848
tracked!(split_lto_unit, Some(true));

Diff for: compiler/rustc_session/src/options.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2036,8 +2036,6 @@ written to standard error output)"),
20362036
"make the current crate share its generic instantiations"),
20372037
shell_argfiles: bool = (false, parse_bool, [UNTRACKED],
20382038
"allow argument files to be specified with POSIX \"shell-style\" argument quoting"),
2039-
show_span: Option<String> = (None, parse_opt_string, [TRACKED],
2040-
"show spans in the crate root file, for compiler debugging (expr|pat|ty)"),
20412039
simulate_remapped_rust_src_base: Option<PathBuf> = (None, parse_opt_pathbuf, [TRACKED],
20422040
"simulate the effect of remap-debuginfo = true at bootstrapping by remapping path \
20432041
to rust's source base directory. only meant for testing purposes"),

0 commit comments

Comments
 (0)