Skip to content

Commit 6145051

Browse files
committed
Replace sys_common::util::dumb_print with rterr!
1 parent 236705f commit 6145051

File tree

4 files changed

+6
-18
lines changed

4 files changed

+6
-18
lines changed

library/std/src/alloc.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ use core::ptr::NonNull;
6363
use core::sync::atomic::{AtomicPtr, Ordering};
6464
use core::{mem, ptr};
6565

66-
use crate::sys_common::util::dumb_print;
67-
6866
#[stable(feature = "alloc_module", since = "1.28.0")]
6967
#[doc(inline)]
7068
pub use alloc_crate::alloc::*;
@@ -317,7 +315,7 @@ pub fn take_alloc_error_hook() -> fn(Layout) {
317315
}
318316

319317
fn default_alloc_error_hook(layout: Layout) {
320-
dumb_print(format_args!("memory allocation of {} bytes failed\n", layout.size()));
318+
rterr!("memory allocation of {} bytes failed\n", layout.size());
321319
}
322320

323321
#[cfg(not(test))]

library/std/src/panicking.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::sync::atomic::{AtomicBool, Ordering};
2020
use crate::sys::stdio::panic_output;
2121
use crate::sys_common::backtrace::{self, RustBacktrace};
2222
use crate::sys_common::rwlock::RWLock;
23-
use crate::sys_common::{thread_info, util};
23+
use crate::sys_common::thread_info;
2424
use crate::thread;
2525

2626
#[cfg(not(test))]
@@ -596,15 +596,15 @@ fn rust_panic_with_hook(
596596
if panics > 2 {
597597
// Don't try to print the message in this case
598598
// - perhaps that is causing the recursive panics.
599-
util::dumb_print(format_args!("thread panicked while processing panic. aborting.\n"));
599+
rterr!("thread panicked while processing panic. aborting.\n");
600600
} else {
601601
// Unfortunately, this does not print a backtrace, because creating
602602
// a `Backtrace` will allocate, which we must to avoid here.
603603
let panicinfo = PanicInfo::internal_constructor(message, location);
604-
util::dumb_print(format_args!(
604+
rterr!(
605605
"{}\npanicked after panic::always_abort(), aborting.\n",
606606
panicinfo
607-
));
607+
);
608608
}
609609
intrinsics::abort()
610610
}
@@ -637,7 +637,7 @@ fn rust_panic_with_hook(
637637
// have limited options. Currently our preference is to
638638
// just abort. In the future we may consider resuming
639639
// unwinding or otherwise exiting the thread cleanly.
640-
util::dumb_print(format_args!("thread panicked while panicking. aborting.\n"));
640+
rterr!("thread panicked while panicking. aborting.\n");
641641
intrinsics::abort()
642642
}
643643

library/std/src/sys_common/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ pub mod thread_info;
4040
pub mod thread_local_dtor;
4141
pub mod thread_local_key;
4242
pub mod thread_parker;
43-
pub mod util;
4443
pub mod wtf8;
4544

4645
cfg_if::cfg_if! {

library/std/src/sys_common/util.rs

-9
This file was deleted.

0 commit comments

Comments
 (0)