File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -2702,7 +2702,10 @@ impl<'a> Parser<'a> {
2702
2702
return Ok ( TokenTree :: Token ( sp, SpecialVarNt ( SpecialMacroVar :: CrateMacroVar ) ) ) ;
2703
2703
} else {
2704
2704
sp = mk_sp ( sp. lo , self . span . hi ) ;
2705
- self . parse_ident ( ) ?
2705
+ self . parse_ident ( ) . unwrap_or_else ( |mut e| {
2706
+ e. emit ( ) ;
2707
+ keywords:: Invalid . ident ( )
2708
+ } )
2706
2709
}
2707
2710
}
2708
2711
token:: SubstNt ( name) => {
@@ -2845,7 +2848,7 @@ impl<'a> Parser<'a> {
2845
2848
// and an error emitted then. Thus we don't pop from
2846
2849
// self.open_braces here.
2847
2850
} ,
2848
- _ => unreachable ! ( ) ,
2851
+ _ => { }
2849
2852
}
2850
2853
2851
2854
Ok ( TokenTree :: Delimited ( span, Rc :: new ( Delimited {
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // compile-flags: -Z no-analysis
12
+
13
+ macro_rules! foo {
14
+ { $+ } => { //~ ERROR expected identifier, found `+`
15
+ $( x) (y) //~ ERROR expected `* ` or `+`
16
+ //~^ ERROR no rules expected the token `y`
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments