Remove highlighting of spans on -Zteach

`-Zteach` is perma-unstable, barely used, the highlighting logic buggy and the flag being passed around is tech-debt. We should likely remove `-Zteach` in its entirely.
This commit is contained in:
Esteban Küber 2025-02-27 21:09:45 +00:00
parent 03eb454523
commit d975bd3a67
3 changed files with 0 additions and 13 deletions

View file

@ -616,7 +616,6 @@ pub struct HumanEmitter {
#[setters(skip)] #[setters(skip)]
fallback_bundle: LazyFallbackBundle, fallback_bundle: LazyFallbackBundle,
short_message: bool, short_message: bool,
teach: bool,
ui_testing: bool, ui_testing: bool,
ignored_directories_in_source_blocks: Vec<String>, ignored_directories_in_source_blocks: Vec<String>,
diagnostic_width: Option<usize>, diagnostic_width: Option<usize>,
@ -642,7 +641,6 @@ impl HumanEmitter {
fluent_bundle: None, fluent_bundle: None,
fallback_bundle, fallback_bundle,
short_message: false, short_message: false,
teach: false,
ui_testing: false, ui_testing: false,
ignored_directories_in_source_blocks: Vec::new(), ignored_directories_in_source_blocks: Vec::new(),
diagnostic_width: None, diagnostic_width: None,
@ -1044,15 +1042,6 @@ impl HumanEmitter {
underline.style, underline.style,
); );
} }
_ if self.teach => {
buffer.set_style_range(
line_offset,
(code_offset + annotation.start_col.display).saturating_sub(left),
(code_offset + annotation.end_col.display).saturating_sub(left),
underline.style,
annotation.is_primary,
);
}
_ => {} _ => {}
} }
} }

View file

@ -930,7 +930,6 @@ fn default_emitter(
.fluent_bundle(bundle) .fluent_bundle(bundle)
.sm(source_map) .sm(source_map)
.short_message(short) .short_message(short)
.teach(sopts.unstable_opts.teach)
.diagnostic_width(sopts.diagnostic_width) .diagnostic_width(sopts.diagnostic_width)
.macro_backtrace(macro_backtrace) .macro_backtrace(macro_backtrace)
.track_diagnostics(track_diagnostics) .track_diagnostics(track_diagnostics)

View file

@ -160,7 +160,6 @@ pub(crate) fn new_dcx(
HumanEmitter::new(stderr_destination(color_config), fallback_bundle) HumanEmitter::new(stderr_destination(color_config), fallback_bundle)
.sm(source_map.map(|sm| sm as _)) .sm(source_map.map(|sm| sm as _))
.short_message(short) .short_message(short)
.teach(unstable_opts.teach)
.diagnostic_width(diagnostic_width) .diagnostic_width(diagnostic_width)
.track_diagnostics(unstable_opts.track_diagnostics) .track_diagnostics(unstable_opts.track_diagnostics)
.theme(if let HumanReadableErrorType::Unicode = kind { .theme(if let HumanReadableErrorType::Unicode = kind {