Skip to content

Commit b6e3247

Browse files
committed
Test that unconfigured macro-expanded macro definitions are not invokable,
test that unconfigured macro-expanded macro invocations are not expanded, and test that feature gated cfg variables on macro-expanded macro definitions are errors.
1 parent ddc1d7f commit b6e3247

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/test/compile-fail/expanded-cfg.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(custom_attribute, rustc_attrs)]
11+
#![feature(custom_attribute)]
1212

1313
macro_rules! mac {
1414
{} => {
@@ -19,11 +19,18 @@ macro_rules! mac {
1919

2020
#[cfg_attr(target_thread_local, custom)]
2121
fn g() {}
22+
23+
unconfigured_invocation!();
2224
}
25+
26+
#[cfg(target_thread_local)] //~ ERROR experimental and subject to change
27+
macro_rules! foo { () => {} }
28+
29+
#[cfg(attr)]
30+
macro_rules! foo { () => { compile error } }
31+
32+
foo!();
2333
}
2434
}
2535

2636
mac! {}
27-
28-
#[rustc_error]
29-
fn main() {} //~ ERROR compilation successful

0 commit comments

Comments
 (0)