set_span_all

Macro set_span_all 

Source
set_span_all!() { /* proc-macro */ }
Expand description

Like set_span!(tt[0], {#set_span{...}})

ยงExample

macro_rules! foo {
    ($t:tt) => {
        foo! { ($t) ($t) }
    };
    ($t:tt (0)) => {
        set_span::set_span_all! {$t[0], {
            compile_error! {"input by zero"}
        }}
    };
    ($_:tt ($lit:literal)) => { /*...*/ };
}
// foo!(0); // test error msg