1 // Check that we are refusing to match on complex nonterminals for which tokens are
2 // unavailable and we'd have to go through AST comparisons.
4 #![feature(decl_macro)]
6 macro simple_nonterminal($nt_ident: ident, $nt_lifetime: lifetime, $nt_tt: tt) {
7 macro n(a $nt_ident b $nt_lifetime c $nt_tt d) {
11 n!(a $nt_ident b $nt_lifetime c $nt_tt d);
14 macro complex_nonterminal($nt_item: item) {
15 macro n(a $nt_item b) {
19 n!(a $nt_item b); //~ ERROR no rules expected the token `enum E {}`
22 simple_nonterminal!(a, 'a, (x, y, z)); // OK
24 complex_nonterminal!(enum E {});