diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 00882bb287a..ea62e215230 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -645,7 +645,7 @@ impl EmitterWriter { margin: Margin, ) { // Tabs are assumed to have been replaced by spaces in calling code. - assert!(!source_string.contains('\t')); + debug_assert!(!source_string.contains('\t')); let line_len = source_string.len(); // Create the source line we will highlight. let left = margin.left(line_len); diff --git a/compiler/rustc_errors/src/styled_buffer.rs b/compiler/rustc_errors/src/styled_buffer.rs index a4dd0f391bd..ef71ee36ea3 100644 --- a/compiler/rustc_errors/src/styled_buffer.rs +++ b/compiler/rustc_errors/src/styled_buffer.rs @@ -15,7 +15,7 @@ impl StyledBuffer { pub fn render(&self) -> Vec> { // Tabs are assumed to have been replaced by spaces in calling code. - assert!(self.text.iter().all(|r| !r.contains(&'\t'))); + debug_assert!(self.text.iter().all(|r| !r.contains(&'\t'))); let mut output: Vec> = vec![]; let mut styled_vec: Vec = vec![];