]>
git.proxmox.com Git - rustc.git/blob - vendor/sharded-slab/src/macros.rs
1 macro_rules
! test_println
{
3 if cfg
!(test
) && cfg
!(slab_print
) {
4 if std
::thread
::panicking() {
5 // getting the thread ID while panicking doesn't seem to play super nicely with loom's
7 println
!("[PANIC {:>17}:{:<3}] {}", file
!(), line
!(), format_args
!($
($arg
)*))
9 println
!("[{:?} {:>17}:{:<3}] {}", crate::Tid
::<crate::DefaultConfig
>::current(), file
!(), line
!(), format_args
!($
($arg
)*))
15 #[cfg(all(test, loom))]
16 macro_rules
! test_dbg
{
20 test_println
!("{} = {:?}", stringify
!($e
), &e
);
27 macro_rules
! panic_in_drop
{
29 if !std
::thread
::panicking() {
32 let thread
= std
::thread
::current();
34 "thread '{thread}' attempted to panic at '{msg}', {file}:{line}:{col}\n\
35 note: we were already unwinding due to a previous panic.",
36 thread
= thread
.name().unwrap_or("<unnamed>"),
37 msg
= format_args
!($
($arg
)*),
46 macro_rules
! debug_assert_eq_in_drop
{
47 ($this
:expr
, $that
:expr
) => {
48 debug_assert_eq_in_drop
!(@inner $this
, $that
, "")
50 ($this
:expr
, $that
:expr
, $
($arg
:tt
)+) => {
51 debug_assert_eq_in_drop
!(@inner $this
, $that
, format_args
!(": {}", format_args
!($
($arg
)+)))
53 (@inner $this
:expr
, $that
:expr
, $msg
:expr
) => {
54 if cfg
!(debug_assertions
) {
57 "assertion failed ({} == {})\n left: `{:?}`,\n right: `{:?}`{}",