Skip to content

Commit a4dc963

Browse files
authored
Rollup merge of rust-lang#133847 - nnethercote:rm-Z-show-span, r=compiler-errors
Remove `-Zshow-span`. It's very old (added in rust-lang#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. r? `@estebank`
2 parents e6d7ab2 + e52f5bf commit a4dc963

File tree

8 files changed

+1
-91
lines changed

8 files changed

+1
-91
lines changed

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 =

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 {

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" }

compiler/rustc_ast_passes/src/show_span.rs

-68
This file was deleted.

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

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
}

compiler/rustc_interface/src/tests.rs

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

compiler/rustc_session/src/options.rs

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

0 commit comments

Comments
 (0)