Skip to content

Commit 18f6cc6

Browse files
committed
Reduce tab formatting assertions to debug only
The tab replacement for diagnostics added in #79757 included a few assertions to ensure all tab characters are handled appropriately. We've started getting reports of these assertions firing (#81614). Since it's only a cosmetic issue, this downgrades the assertions to debug only, so we at least continue compiling even if the diagnostics might be a tad wonky. Fixes #81614
1 parent 6ad11e2 commit 18f6cc6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_errors/src/emitter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ impl EmitterWriter {
645645
margin: Margin,
646646
) {
647647
// Tabs are assumed to have been replaced by spaces in calling code.
648-
assert!(!source_string.contains('\t'));
648+
debug_assert!(!source_string.contains('\t'));
649649
let line_len = source_string.len();
650650
// Create the source line we will highlight.
651651
let left = margin.left(line_len);

compiler/rustc_errors/src/styled_buffer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl StyledBuffer {
1515

1616
pub fn render(&self) -> Vec<Vec<StyledString>> {
1717
// Tabs are assumed to have been replaced by spaces in calling code.
18-
assert!(self.text.iter().all(|r| !r.contains(&'\t')));
18+
debug_assert!(self.text.iter().all(|r| !r.contains(&'\t')));
1919

2020
let mut output: Vec<Vec<StyledString>> = vec![];
2121
let mut styled_vec: Vec<StyledString> = vec![];

0 commit comments

Comments
 (0)