]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/proc-macro/cfg-eval.rs
2 // compile-flags: -Z span-debug
3 // aux-build:test-macros.rs
6 #![feature(proc_macro_hygiene)]
7 #![feature(stmt_expr_attributes)]
8 #![feature(rustc_attrs)]
9 #![no_std] // Don't load unnecessary hygiene information from std
13 extern crate test_macros
;
21 #[cfg_attr(FALSE, unknown_attr)]
22 #[cfg_attr(all(/*true*/), allow())]
31 // Subtle - we need a trailing comma after the '1' - otherwise, `#[cfg_eval]` will
32 // turn this into `(#[cfg(all())] 1)`, which is a parenthesized expression, not a tuple
33 // expression. `#[cfg]` is not supported inside parenthesized expressions, so this will
34 // produce an error when attribute collection runs.
35 let _
= #[cfg_eval] #[print_attr] #[cfg_attr(not(FALSE), rustc_dummy)]
36 (#[cfg(FALSE)] 0, #[cfg(all(/*true*/))] 1,);