Don't use compile_error as print
This commit is contained in:
parent
e94bda3bf1
commit
fbe3a475f2
1 changed files with 8 additions and 1 deletions
|
@ -58,11 +58,18 @@ use std::str;
|
||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
|
#[allow(unused_macros)]
|
||||||
|
macro do_not_use_print($($t:tt)*) {
|
||||||
|
std::compile_error!(
|
||||||
|
"Don't use `print` or `println` here, use `safe_print` or `safe_println` instead"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// This import blocks the use of panicking `print` and `println` in all the code
|
// This import blocks the use of panicking `print` and `println` in all the code
|
||||||
// below. Please use `safe_print` and `safe_println` to avoid ICE when
|
// below. Please use `safe_print` and `safe_println` to avoid ICE when
|
||||||
// encountering an I/O error during print.
|
// encountering an I/O error during print.
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use std::{compile_error as print, compile_error as println};
|
use {do_not_use_print as print, do_not_use_print as println};
|
||||||
|
|
||||||
pub mod args;
|
pub mod args;
|
||||||
pub mod pretty;
|
pub mod pretty;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue