]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/attr-cfg.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / proc-macro / attr-cfg.rs
1 // run-pass
2 // aux-build:attr-cfg.rs
3 // revisions: foo bar
4
5 extern crate attr_cfg;
6 use attr_cfg::attr_cfg;
7
8 #[attr_cfg]
9 fn outer() -> u8 {
10     #[cfg(foo)]
11     fn inner() -> u8 { 1 }
12
13     #[cfg(bar)]
14     fn inner() -> u8 { 2 }
15
16     inner()
17 }
18
19 #[cfg(foo)]
20 fn main() {
21     assert_eq!(outer(), 1);
22 }
23
24 #[cfg(bar)]
25 fn main() {
26     assert_eq!(outer(), 2);
27 }