core_extensions/macros/
internal.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#[allow(unused_macros)]
macro_rules! cfg_if {
    (($meta:meta) $then:block else $else:block) => {{
        #[cfg($meta)] 
        let ret = $then;

        #[cfg(not($meta))] 
        let ret = $else;

        ret
    }};
}

#[allow(unused_macros)]
#[cfg(not(feature = "rust_1_46"))]
macro_rules! if_rust_1_46 {
    ($(#[$attr:meta])* => ($($before_1_46:tt)*)  ($($since_1_46:tt)*)  ) => {
        $(#[$attr])*
        $($before_1_46)*
    };
}

#[allow(unused_macros)]
#[cfg(feature = "rust_1_46")]
macro_rules! if_rust_1_46 {
    ($(#[$attr:meta])* => ($($before_1_46:tt)*)  ($($since_1_46:tt)*)  ) => {
        $(#[$attr])*
        $($since_1_46)*
    };
}



#[doc(hidden)]
#[macro_export]
macro_rules! __coerce_item {
    ($item:item) => {
        $item
    }
}

#[doc(hidden)]
#[macro_export]
macro_rules! __validate_macro_then_parentheses {
    (
        (
            $(::)? $($path:ident)::* ! $prefix:tt
            ($($tokens:tt)*)
        )
        $($expansion:tt)*
    ) => {
        $($expansion)*
    };
    (
        ($($anything:tt)*)
        $($expansion:tt)*
    ) => {
        $crate::__::compile_error!{$crate::__::concat!{
            "expected arguments to be a macro invocation followed by `()`-delimited arguments"
        }}
    };
}