about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-08 10:31:52 +0000
committerbors <bors@rust-lang.org>2023-06-08 10:31:52 +0000
commite7409258db4a43f23dcc66e10061dee91c316055 (patch)
treeee63a261821600f4669877e5f2dbad2e812584e7 /compiler/rustc_driver_impl/src
parenta0df04c0f2b9c0415c53e3cee8c4f9fa394a37b2 (diff)
parentcf5e0b06183dabee960e4c7f7afd73355b8c3f89 (diff)
downloadrust-e7409258db4a43f23dcc66e10061dee91c316055.tar.gz
rust-e7409258db4a43f23dcc66e10061dee91c316055.zip
Auto merge of #112415 - GuillaumeGomez:rollup-5pa9frd, r=GuillaumeGomez
Rollup of 9 pull requests

Successful merges:

 - #112034 (Migrate `item_opaque_ty` to Askama)
 - #112179 (Avoid passing --cpu-features when empty)
 - #112309 (bootstrap: remove dependency `is-terminal`)
 - #112388 (Migrate GUI colors test to original CSS color format)
 - #112389 (Add a test for #105709)
 - #112392 (Fix ICE for while loop with assignment condition with LHS place expr)
 - #112394 (Remove accidental comment)
 - #112396 (Track more diagnostics in `rustc_expand`)
 - #112401 (Don't `use compile_error as print`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_driver_impl/src')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs9
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;