Skip to main content

dbg_internal

Macro dbg_internal 

Source
#[doc(hidden)]
pub macro dbg_internal { (($($piece:literal),+) ($($processed:expr => $bound:expr),+) ()) => { ... }, (($($piece:literal),*) ($($processed:expr => $bound:expr),*) ($val:expr $(,$rest:expr)*)) => { ... }, }
🔬This is a nightly-only experimental API. (std_internals)
Expand description

Internal macro that processes a list of expressions and produces a chain of nested matches, one for each expression, before finally calling eprint! with the collected information and returning all the evaluated expressions in a tuple.

E.g. dbg_internal!(() () (1, 2)) expands into

match 1 {
    tmp_1 => match 2 {
        tmp_2 => {
            eprint!("...", &tmp_1, &tmp_2, /* some other arguments */);
            (tmp_1, tmp_2)
        }
    }
}

This is necessary so that dbg! outputs don’t get torn, see #136703.