Skip to content

Commit 3c421ac

Browse files
committed
Test diagnostics
1 parent ba8b932 commit 3c421ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/compile-fail/macro-error.rs

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

11-
// Check that we report errors at macro definition, not expansion.
11+
#![feature(type_macros)]
1212

1313
macro_rules! foo {
1414
($a:expr) => $a; //~ ERROR macro rhs must be delimited
1515
}
1616

1717
fn main() {
18-
foo!(0);
18+
foo!(0); // Check that we report errors at macro definition, not expansion.
19+
20+
let _: cfg!(foo) = (); //~ ERROR non-type macro in type position
21+
derive!(); //~ ERROR `derive` can only be used in attributes
1922
}

0 commit comments

Comments
 (0)