Skip to content

Commit d975bd3

Browse files
committed
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.
1 parent 03eb454 commit d975bd3

File tree

3 files changed

+0
-13
lines changed

3 files changed

+0
-13
lines changed

compiler/rustc_errors/src/emitter.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,6 @@ pub struct HumanEmitter {
616616
#[setters(skip)]
617617
fallback_bundle: LazyFallbackBundle,
618618
short_message: bool,
619-
teach: bool,
620619
ui_testing: bool,
621620
ignored_directories_in_source_blocks: Vec<String>,
622621
diagnostic_width: Option<usize>,
@@ -642,7 +641,6 @@ impl HumanEmitter {
642641
fluent_bundle: None,
643642
fallback_bundle,
644643
short_message: false,
645-
teach: false,
646644
ui_testing: false,
647645
ignored_directories_in_source_blocks: Vec::new(),
648646
diagnostic_width: None,
@@ -1044,15 +1042,6 @@ impl HumanEmitter {
10441042
underline.style,
10451043
);
10461044
}
1047-
_ if self.teach => {
1048-
buffer.set_style_range(
1049-
line_offset,
1050-
(code_offset + annotation.start_col.display).saturating_sub(left),
1051-
(code_offset + annotation.end_col.display).saturating_sub(left),
1052-
underline.style,
1053-
annotation.is_primary,
1054-
);
1055-
}
10561045
_ => {}
10571046
}
10581047
}

compiler/rustc_session/src/session.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,6 @@ fn default_emitter(
930930
.fluent_bundle(bundle)
931931
.sm(source_map)
932932
.short_message(short)
933-
.teach(sopts.unstable_opts.teach)
934933
.diagnostic_width(sopts.diagnostic_width)
935934
.macro_backtrace(macro_backtrace)
936935
.track_diagnostics(track_diagnostics)

src/librustdoc/core.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ pub(crate) fn new_dcx(
160160
HumanEmitter::new(stderr_destination(color_config), fallback_bundle)
161161
.sm(source_map.map(|sm| sm as _))
162162
.short_message(short)
163-
.teach(unstable_opts.teach)
164163
.diagnostic_width(diagnostic_width)
165164
.track_diagnostics(unstable_opts.track_diagnostics)
166165
.theme(if let HumanReadableErrorType::Unicode = kind {

0 commit comments

Comments
 (0)