mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Check for eprintln on CI
This commit is contained in:
parent
2603a9e628
commit
bf569f8b29
7 changed files with 38 additions and 12 deletions
|
@ -2,6 +2,21 @@
|
|||
|
||||
use std::{cell::Cell, fmt};
|
||||
|
||||
#[inline(always)]
|
||||
pub fn is_ci() -> bool {
|
||||
option_env!("CI").is_some()
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! eprintln {
|
||||
($($tt:tt)*) => {{
|
||||
if $crate::is_ci() {
|
||||
panic!("Forgot to remove debug-print?")
|
||||
}
|
||||
std::eprintln!($($tt)*)
|
||||
}}
|
||||
}
|
||||
|
||||
/// Appends formatted string to a `String`.
|
||||
#[macro_export]
|
||||
macro_rules! format_to {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue