1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! Standard library macros
13 //! This modules contains a set of macros which are exported from the standard
14 //! library. Each macro is available for use when linking against the standard
17 /// The entry point for panic of Rust threads.
19 /// This allows a program to to terminate immediately and provide feedback
20 /// to the caller of the program. `panic!` should be used when a program reaches
21 /// an unrecoverable problem.
23 /// This macro is the perfect way to assert conditions in example code and in
24 /// tests. `panic!` is closely tied with the `unwrap` method of both [`Option`]
25 /// and [`Result`][runwrap] enums. Both implementations call `panic!` when they are set
26 /// to None or Err variants.
28 /// This macro is used to inject panic into a Rust thread, causing the thread to
29 /// panic entirely. Each thread's panic can be reaped as the `Box<Any>` type,
30 /// and the single-argument form of the `panic!` macro will be the value which
33 /// [`Result`] enum is often a better solution for recovering from errors than
34 /// using the `panic!` macro. This macro should be used to avoid proceeding using
35 /// incorrect values, such as from external sources. Detailed information about
36 /// error handling is found in the [book].
38 /// The multi-argument form of this macro panics with a string and has the
39 /// [`format!`] syntax for building a string.
41 /// [runwrap]: ../std/result/enum.Result.html#method.unwrap
42 /// [`Option`]: ../std/option/enum.Option.html#method.unwrap
43 /// [`Result`]: ../std/result/enum.Result.html
44 /// [`format!`]: ../std/macro.format.html
45 /// [book]: ../book/second-edition/ch09-01-unrecoverable-errors-with-panic.html
47 /// # Current implementation
49 /// If the main thread panics it will terminate all your threads and end your
50 /// program with code `101`.
55 /// # #![allow(unreachable_code)]
57 /// panic!("this is a terrible mistake!");
58 /// panic!(4); // panic with the value of 4 to be collected elsewhere
59 /// panic!("this is a {} {message}", "fancy", message = "message");
62 #[stable(feature = "rust1", since = "1.0.0")]
63 #[allow_internal_unstable]
66 panic
!("explicit panic")
69 $
crate::rt
::begin_panic($msg
, &(file
!(), line
!(), __rust_unstable_column
!()))
74 ($fmt
:expr
, $
($arg
:tt
)+) => ({
75 $
crate::rt
::begin_panic_fmt(&format_args
!($fmt
, $
($arg
)+),
76 &(file
!(), line
!(), __rust_unstable_column
!()))
80 /// Macro for printing to the standard output.
82 /// Equivalent to the [`println!`] macro except that a newline is not printed at
83 /// the end of the message.
85 /// Note that stdout is frequently line-buffered by default so it may be
86 /// necessary to use [`io::stdout().flush()`][flush] to ensure the output is emitted
89 /// Use `print!` only for the primary output of your program. Use
90 /// [`eprint!`] instead to print error and progress messages.
92 /// [`println!`]: ../std/macro.println.html
93 /// [flush]: ../std/io/trait.Write.html#tymethod.flush
94 /// [`eprint!`]: ../std/macro.eprint.html
98 /// Panics if writing to `io::stdout()` fails.
103 /// use std::io::{self, Write};
113 /// io::stdout().flush().unwrap();
115 /// print!("this string has a newline, why not choose println! instead?\n");
117 /// io::stdout().flush().unwrap();
120 #[stable(feature = "rust1", since = "1.0.0")]
121 #[allow_internal_unstable]
123 ($
($arg
:tt
)*) => ($
crate::io
::_print(format_args
!($
($arg
)*)));
126 /// Macro for printing to the standard output, with a newline.
128 /// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone
129 /// (no additional CARRIAGE RETURN (`\r`/`U+000D`).
131 /// Use the [`format!`] syntax to write data to the standard output.
132 /// See [`std::fmt`] for more information.
134 /// Use `println!` only for the primary output of your program. Use
135 /// [`eprintln!`] instead to print error and progress messages.
137 /// [`format!`]: ../std/macro.format.html
138 /// [`std::fmt`]: ../std/fmt/index.html
139 /// [`eprintln!`]: ../std/macro.eprint.html
142 /// Panics if writing to `io::stdout` fails.
147 /// println!(); // prints just a newline
148 /// println!("hello there!");
149 /// println!("format {} arguments", "some");
152 #[stable(feature = "rust1", since = "1.0.0")]
153 macro_rules
! println
{
154 () => (print
!("\n"));
155 ($fmt
:expr
) => (print
!(concat
!($fmt
, "\n")));
156 ($fmt
:expr
, $
($arg
:tt
)*) => (print
!(concat
!($fmt
, "\n"), $
($arg
)*));
159 /// Macro for printing to the standard error.
161 /// Equivalent to the [`print!`] macro, except that output goes to
162 /// [`io::stderr`] instead of `io::stdout`. See [`print!`] for
165 /// Use `eprint!` only for error and progress messages. Use `print!`
166 /// instead for the primary output of your program.
168 /// [`io::stderr`]: ../std/io/struct.Stderr.html
169 /// [`print!`]: ../std/macro.print.html
173 /// Panics if writing to `io::stderr` fails.
178 /// eprint!("Error: Could not complete task");
181 #[stable(feature = "eprint", since = "1.19.0")]
182 #[allow_internal_unstable]
183 macro_rules
! eprint
{
184 ($
($arg
:tt
)*) => ($
crate::io
::_eprint(format_args
!($
($arg
)*)));
187 /// Macro for printing to the standard error, with a newline.
189 /// Equivalent to the [`println!`] macro, except that output goes to
190 /// [`io::stderr`] instead of `io::stdout`. See [`println!`] for
193 /// Use `eprintln!` only for error and progress messages. Use `println!`
194 /// instead for the primary output of your program.
196 /// [`io::stderr`]: ../std/io/struct.Stderr.html
197 /// [`println!`]: ../std/macro.println.html
201 /// Panics if writing to `io::stderr` fails.
206 /// eprintln!("Error: Could not complete task");
209 #[stable(feature = "eprint", since = "1.19.0")]
210 macro_rules
! eprintln
{
211 () => (eprint
!("\n"));
212 ($fmt
:expr
) => (eprint
!(concat
!($fmt
, "\n")));
213 ($fmt
:expr
, $
($arg
:tt
)*) => (eprint
!(concat
!($fmt
, "\n"), $
($arg
)*));
216 /// A macro to select an event from a number of receivers.
218 /// This macro is used to wait for the first event to occur on a number of
219 /// receivers. It places no restrictions on the types of receivers given to
220 /// this macro, this can be viewed as a heterogeneous select.
225 /// #![feature(mpsc_select)]
228 /// use std::sync::mpsc;
230 /// // two placeholder functions for now
231 /// fn long_running_thread() {}
232 /// fn calculate_the_answer() -> u32 { 42 }
234 /// let (tx1, rx1) = mpsc::channel();
235 /// let (tx2, rx2) = mpsc::channel();
237 /// thread::spawn(move|| { long_running_thread(); tx1.send(()).unwrap(); });
238 /// thread::spawn(move|| { tx2.send(calculate_the_answer()).unwrap(); });
241 /// _ = rx1.recv() => println!("the long running thread finished first"),
242 /// answer = rx2.recv() => {
243 /// println!("the answer was: {}", answer.unwrap());
246 /// # drop(rx1.recv());
247 /// # drop(rx2.recv());
250 /// For more information about select, see the `std::sync::mpsc::Select` structure.
252 #[unstable(feature = "mpsc_select", issue = "27800")]
253 macro_rules
! select
{
255 $
($name
:pat
= $rx
:ident
.$meth
:ident() => $code
:expr
),+
257 use $
crate::sync
::mpsc
::Select
;
258 let sel
= Select
::new();
259 $
( let mut $rx
= sel
.handle(&$rx
); )+
263 let ret
= sel
.wait();
264 $
( if ret
== $rx
.id() { let $name = $rx.$meth(); $code }
else )+
270 macro_rules
! assert_approx_eq
{
271 ($a
:expr
, $b
:expr
) => ({
272 let (a
, b
) = (&$a
, &$b
);
273 assert
!((*a
- *b
).abs() < 1.0e-6,
274 "{} is not approximately equal to {}", *a
, *b
);
278 /// Built-in macros to the compiler itself.
280 /// These macros do not have any corresponding definition with a `macro_rules!`
281 /// macro, but are documented here. Their implementations can be found hardcoded
282 /// into libsyntax itself.
286 /// Unconditionally causes compilation to fail with the given error message when encountered.
288 /// This macro should be used when a crate uses a conditional compilation strategy to provide
289 /// better error messages for erroneous conditions.
293 /// Two such examples are macros and `#[cfg]` environments.
295 /// Emit better compiler error if a macro is passed invalid values.
298 /// macro_rules! give_me_foo_or_bar {
302 /// compile_error!("This macro only accepts `foo` or `bar`");
306 /// give_me_foo_or_bar!(neither);
307 /// // ^ will fail at compile time with message "This macro only accepts `foo` or `bar`"
310 /// Emit compiler error if one of a number of features isn't available.
313 /// #[cfg(not(any(feature = "foo", feature = "bar")))]
314 /// compile_error!("Either feature \"foo\" or \"bar\" must be enabled for this crate.")
316 #[stable(feature = "compile_error_macro", since = "1.20.0")]
318 macro_rules
! compile_error
{
319 ($msg
:expr
) => ({ /* compiler built-in */ }
);
320 ($msg
:expr
,) => ({ /* compiler built-in */ }
);
323 /// The core macro for formatted string creation & output.
325 /// This macro functions by taking a formatting string literal containing
326 /// `{}` for each additional argument passed. `format_args!` prepares the
327 /// additional parameters to ensure the output can be interpreted as a string
328 /// and canonicalizes the arguments into a single type. Any value that implements
329 /// the [`Display`] trait can be passed to `format_args!`, as can any
330 /// [`Debug`] implementation be passed to a `{:?}` within the formatting string.
332 /// This macro produces a value of type [`fmt::Arguments`]. This value can be
333 /// passed to the macros within [`std::fmt`] for performing useful redirection.
334 /// All other formatting macros ([`format!`], [`write!`], [`println!`], etc) are
335 /// proxied through this one. `format_args!`, unlike its derived macros, avoids
336 /// heap allocations.
338 /// You can use the [`fmt::Arguments`] value that `format_args!` returns
339 /// in `Debug` and `Display` contexts as seen below. The example also shows
340 /// that `Debug` and `Display` format to the same thing: the interpolated
341 /// format string in `format_args!`.
344 /// let debug = format!("{:?}", format_args!("{} foo {:?}", 1, 2));
345 /// let display = format!("{}", format_args!("{} foo {:?}", 1, 2));
346 /// assert_eq!("1 foo 2", display);
347 /// assert_eq!(display, debug);
350 /// For more information, see the documentation in [`std::fmt`].
352 /// [`Display`]: ../std/fmt/trait.Display.html
353 /// [`Debug`]: ../std/fmt/trait.Debug.html
354 /// [`fmt::Arguments`]: ../std/fmt/struct.Arguments.html
355 /// [`std::fmt`]: ../std/fmt/index.html
356 /// [`format!`]: ../std/macro.format.html
357 /// [`write!`]: ../std/macro.write.html
358 /// [`println!`]: ../std/macro.println.html
365 /// let s = fmt::format(format_args!("hello {}", "world"));
366 /// assert_eq!(s, format!("hello {}", "world"));
368 #[stable(feature = "rust1", since = "1.0.0")]
370 macro_rules
! format_args
{
371 ($fmt
:expr
) => ({ /* compiler built-in */ }
);
372 ($fmt
:expr
, $
($args
:tt
)*) => ({ /* compiler built-in */ }
);
375 /// Inspect an environment variable at compile time.
377 /// This macro will expand to the value of the named environment variable at
378 /// compile time, yielding an expression of type `&'static str`.
380 /// If the environment variable is not defined, then a compilation error
381 /// will be emitted. To not emit a compile error, use the [`option_env!`]
384 /// [`option_env!`]: ../std/macro.option_env.html
389 /// let path: &'static str = env!("PATH");
390 /// println!("the $PATH variable at the time of compiling was: {}", path);
393 /// You can customize the error message by passing a string as the second
397 /// let doc: &'static str = env!("documentation", "what's that?!");
400 /// If the `documentation` environment variable is not defined, you'll get
401 /// the following error:
404 /// error: what's that?!
406 #[stable(feature = "rust1", since = "1.0.0")]
409 ($name
:expr
) => ({ /* compiler built-in */ }
);
410 ($name
:expr
,) => ({ /* compiler built-in */ }
);
413 /// Optionally inspect an environment variable at compile time.
415 /// If the named environment variable is present at compile time, this will
416 /// expand into an expression of type `Option<&'static str>` whose value is
417 /// `Some` of the value of the environment variable. If the environment
418 /// variable is not present, then this will expand to `None`. See
419 /// [`Option<T>`][option] for more information on this type.
421 /// A compile time error is never emitted when using this macro regardless
422 /// of whether the environment variable is present or not.
424 /// [option]: ../std/option/enum.Option.html
429 /// let key: Option<&'static str> = option_env!("SECRET_KEY");
430 /// println!("the secret key might be: {:?}", key);
432 #[stable(feature = "rust1", since = "1.0.0")]
434 macro_rules
! option_env
{
435 ($name
:expr
) => ({ /* compiler built-in */ }
);
436 ($name
:expr
,) => ({ /* compiler built-in */ }
);
439 /// Concatenate identifiers into one identifier.
441 /// This macro takes any number of comma-separated identifiers, and
442 /// concatenates them all into one, yielding an expression which is a new
443 /// identifier. Note that hygiene makes it such that this macro cannot
444 /// capture local variables. Also, as a general rule, macros are only
445 /// allowed in item, statement or expression position. That means while
446 /// you may use this macro for referring to existing variables, functions or
447 /// modules etc, you cannot define a new one with it.
452 /// #![feature(concat_idents)]
455 /// fn foobar() -> u32 { 23 }
457 /// let f = concat_idents!(foo, bar);
458 /// println!("{}", f());
460 /// // fn concat_idents!(new, fun, name) { } // not usable in this way!
463 #[unstable(feature = "concat_idents_macro", issue = "29599")]
465 macro_rules
! concat_idents
{
466 ($
($e
:ident
),+) => ({ /* compiler built-in */ }
);
467 ($
($e
:ident
,)+) => ({ /* compiler built-in */ }
);
470 /// Concatenates literals into a static string slice.
472 /// This macro takes any number of comma-separated literals, yielding an
473 /// expression of type `&'static str` which represents all of the literals
474 /// concatenated left-to-right.
476 /// Integer and floating point literals are stringified in order to be
482 /// let s = concat!("test", 10, 'b', true);
483 /// assert_eq!(s, "test10btrue");
485 #[stable(feature = "rust1", since = "1.0.0")]
487 macro_rules
! concat
{
488 ($
($e
:expr
),*) => ({ /* compiler built-in */ }
);
489 ($
($e
:expr
,)*) => ({ /* compiler built-in */ }
);
492 /// A macro which expands to the line number on which it was invoked.
494 /// With [`column!`] and [`file!`], these macros provide debugging information for
495 /// developers about the location within the source.
497 /// The expanded expression has type `u32` and is 1-based, so the first line
498 /// in each file evaluates to 1, the second to 2, etc. This is consistent
499 /// with error messages by common compilers or popular editors.
500 /// The returned line is *not necessarily* the line of the `line!` invocation itself,
501 /// but rather the first macro invocation leading up to the invocation
502 /// of the `line!` macro.
504 /// [`column!`]: macro.column.html
505 /// [`file!`]: macro.file.html
510 /// let current_line = line!();
511 /// println!("defined on line: {}", current_line);
513 #[stable(feature = "rust1", since = "1.0.0")]
515 macro_rules
! line { () => ({ /* compiler built-in */ }
) }
517 /// A macro which expands to the column number on which it was invoked.
519 /// With [`line!`] and [`file!`], these macros provide debugging information for
520 /// developers about the location within the source.
522 /// The expanded expression has type `u32` and is 1-based, so the first column
523 /// in each line evaluates to 1, the second to 2, etc. This is consistent
524 /// with error messages by common compilers or popular editors.
525 /// The returned column is *not necessarily* the line of the `column!` invocation itself,
526 /// but rather the first macro invocation leading up to the invocation
527 /// of the `column!` macro.
529 /// [`line!`]: macro.line.html
530 /// [`file!`]: macro.file.html
535 /// let current_col = column!();
536 /// println!("defined on column: {}", current_col);
538 #[stable(feature = "rust1", since = "1.0.0")]
540 macro_rules
! column { () => ({ /* compiler built-in */ }
) }
542 /// A macro which expands to the file name from which it was invoked.
544 /// With [`line!`] and [`column!`], these macros provide debugging information for
545 /// developers about the location within the source.
548 /// The expanded expression has type `&'static str`, and the returned file
549 /// is not the invocation of the `file!` macro itself, but rather the
550 /// first macro invocation leading up to the invocation of the `file!`
553 /// [`line!`]: macro.line.html
554 /// [`column!`]: macro.column.html
559 /// let this_file = file!();
560 /// println!("defined in file: {}", this_file);
562 #[stable(feature = "rust1", since = "1.0.0")]
564 macro_rules
! file { () => ({ /* compiler built-in */ }
) }
566 /// A macro which stringifies its arguments.
568 /// This macro will yield an expression of type `&'static str` which is the
569 /// stringification of all the tokens passed to the macro. No restrictions
570 /// are placed on the syntax of the macro invocation itself.
572 /// Note that the expanded results of the input tokens may change in the
573 /// future. You should be careful if you rely on the output.
578 /// let one_plus_one = stringify!(1 + 1);
579 /// assert_eq!(one_plus_one, "1 + 1");
581 #[stable(feature = "rust1", since = "1.0.0")]
583 macro_rules
! stringify { ($($t:tt)*) => ({ /* compiler built-in */ }
) }
585 /// Includes a utf8-encoded file as a string.
587 /// The file is located relative to the current file. (similarly to how
588 /// modules are found)
590 /// This macro will yield an expression of type `&'static str` which is the
591 /// contents of the file.
595 /// Assume there are two files in the same directory with the following
598 /// File 'spanish.in':
606 /// ```ignore (cannot-doctest-external-file-dependency)
608 /// let my_str = include_str!("spanish.in");
609 /// assert_eq!(my_str, "adiรณs\n");
610 /// print!("{}", my_str);
614 /// Compiling 'main.rs' and running the resulting binary will print "adiรณs".
615 #[stable(feature = "rust1", since = "1.0.0")]
617 macro_rules
! include_str
{
618 ($file
:expr
) => ({ /* compiler built-in */ }
);
619 ($file
:expr
,) => ({ /* compiler built-in */ }
);
622 /// Includes a file as a reference to a byte array.
624 /// The file is located relative to the current file. (similarly to how
625 /// modules are found)
627 /// This macro will yield an expression of type `&'static [u8; N]` which is
628 /// the contents of the file.
632 /// Assume there are two files in the same directory with the following
635 /// File 'spanish.in':
643 /// ```ignore (cannot-doctest-external-file-dependency)
645 /// let bytes = include_bytes!("spanish.in");
646 /// assert_eq!(bytes, b"adi\xc3\xb3s\n");
647 /// print!("{}", String::from_utf8_lossy(bytes));
651 /// Compiling 'main.rs' and running the resulting binary will print "adiรณs".
652 #[stable(feature = "rust1", since = "1.0.0")]
654 macro_rules
! include_bytes
{
655 ($file
:expr
) => ({ /* compiler built-in */ }
);
656 ($file
:expr
,) => ({ /* compiler built-in */ }
);
659 /// Expands to a string that represents the current module path.
661 /// The current module path can be thought of as the hierarchy of modules
662 /// leading back up to the crate root. The first component of the path
663 /// returned is the name of the crate currently being compiled.
670 /// assert!(module_path!().ends_with("test"));
676 #[stable(feature = "rust1", since = "1.0.0")]
678 macro_rules
! module_path { () => ({ /* compiler built-in */ }
) }
680 /// Boolean evaluation of configuration flags, at compile-time.
682 /// In addition to the `#[cfg]` attribute, this macro is provided to allow
683 /// boolean expression evaluation of configuration flags. This frequently
684 /// leads to less duplicated code.
686 /// The syntax given to this macro is the same syntax as [the `cfg`
687 /// attribute](../book/first-edition/conditional-compilation.html).
692 /// let my_directory = if cfg!(windows) {
693 /// "windows-specific-directory"
698 #[stable(feature = "rust1", since = "1.0.0")]
700 macro_rules
! cfg { ($($cfg:tt)*) => ({ /* compiler built-in */ }
) }
702 /// Parse a file as an expression or an item according to the context.
704 /// The file is located relative to the current file (similarly to how
705 /// modules are found).
707 /// Using this macro is often a bad idea, because if the file is
708 /// parsed as an expression, it is going to be placed in the
709 /// surrounding code unhygienically. This could result in variables
710 /// or functions being different from what the file expected if
711 /// there are variables or functions that have the same name in
712 /// the current file.
716 /// Assume there are two files in the same directory with the following
719 /// File 'monkeys.in':
721 /// ```ignore (only-for-syntax-highlight)
722 /// ['๐', '๐', '๐']
726 /// .collect::<String>()
731 /// ```ignore (cannot-doctest-external-file-dependency)
733 /// let my_string = include!("monkeys.in");
734 /// assert_eq!("๐๐๐๐๐๐", my_string);
735 /// println!("{}", my_string);
739 /// Compiling 'main.rs' and running the resulting binary will print
740 /// "๐๐๐๐๐๐".
741 #[stable(feature = "rust1", since = "1.0.0")]
743 macro_rules
! include
{
744 ($file
:expr
) => ({ /* compiler built-in */ }
);
745 ($file
:expr
,) => ({ /* compiler built-in */ }
);
748 /// Ensure that a boolean expression is `true` at runtime.
750 /// This will invoke the [`panic!`] macro if the provided expression cannot be
751 /// evaluated to `true` at runtime.
755 /// Assertions are always checked in both debug and release builds, and cannot
756 /// be disabled. See [`debug_assert!`] for assertions that are not enabled in
757 /// release builds by default.
759 /// Unsafe code relies on `assert!` to enforce run-time invariants that, if
760 /// violated could lead to unsafety.
762 /// Other use-cases of `assert!` include [testing] and enforcing run-time
763 /// invariants in safe code (whose violation cannot result in unsafety).
765 /// # Custom Messages
767 /// This macro has a second form, where a custom panic message can
768 /// be provided with or without arguments for formatting. See [`std::fmt`]
769 /// for syntax for this form.
771 /// [`panic!`]: macro.panic.html
772 /// [`debug_assert!`]: macro.debug_assert.html
773 /// [testing]: ../book/second-edition/ch11-01-writing-tests.html#checking-results-with-the-assert-macro
774 /// [`std::fmt`]: ../std/fmt/index.html
779 /// // the panic message for these assertions is the stringified value of the
780 /// // expression given.
783 /// fn some_computation() -> bool { true } // a very simple function
785 /// assert!(some_computation());
787 /// // assert with a custom message
789 /// assert!(x, "x wasn't true!");
791 /// let a = 3; let b = 27;
792 /// assert!(a + b == 30, "a = {}, b = {}", a, b);
794 #[stable(feature = "rust1", since = "1.0.0")]
796 macro_rules
! assert
{
797 ($cond
:expr
) => ({ /* compiler built-in */ }
);
798 ($cond
:expr
,) => ({ /* compiler built-in */ }
);
799 ($cond
:expr
, $
($arg
:tt
)+) => ({ /* compiler built-in */ }
);
803 /// A macro for defining `#[cfg]` if-else statements.
805 /// This is similar to the `if/elif` C preprocessor macro by allowing definition
806 /// of a cascade of `#[cfg]` cases, emitting the implementation which matches
809 /// This allows you to conveniently provide a long list `#[cfg]`'d blocks of code
810 /// without having to rewrite each clause multiple times.
811 macro_rules
! cfg_if
{
813 if #[cfg($($meta:meta),*)] { $($it:item)* }
819 $
( ( ($
($meta
),*) ($
($it
)*) ), )*
825 macro_rules
! __cfg_if_items
{
826 (($
($not
:meta
,)*) ; ) => {}
;
827 (($
($not
:meta
,)*) ; ( ($
($m
:meta
),*) ($
($it
:item
)*) ), $
($rest
:tt
)*) => {
828 __cfg_if_apply
! { cfg(all(not(any($($not),*)), $($m,)*)), $($it)* }
829 __cfg_if_items
! { ($($not,)* $($m,)*) ; $($rest)* }
833 macro_rules
! __cfg_if_apply
{
834 ($m
:meta
, $
($it
:item
)*) => {