diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-06-07 18:59:31 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-06-07 18:59:31 +0000 |
| commit | fbe3a475f290c0847623357c732caa62b29389f3 (patch) | |
| tree | 3fdb3a35bdcc1fa0b97222d8551eca0f9287b15f /compiler/rustc_driver_impl/src | |
| parent | e94bda3bf13303671427363d1cd93ac5e089f090 (diff) | |
| download | rust-fbe3a475f290c0847623357c732caa62b29389f3.tar.gz rust-fbe3a475f290c0847623357c732caa62b29389f3.zip | |
Don't `use compile_error as print`
Diffstat (limited to 'compiler/rustc_driver_impl/src')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 14888cf4d75..c503a44c196 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -58,11 +58,18 @@ use std::str; use std::sync::OnceLock; 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 // below. Please use `safe_print` and `safe_println` to avoid ICE when // encountering an I/O error during print. #[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 pretty; |
