File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -1751,7 +1751,13 @@ impl<'a> Parser<'a> {
17511751 fn parse_path_common ( & mut self , mode : PathStyle , parse_generics : bool )
17521752 -> PResult < ' a , ast:: Path >
17531753 {
1754- maybe_whole ! ( self , NtPath , |x| x) ;
1754+ maybe_whole ! ( self , NtPath , |path| {
1755+ if style == PathStyle :: Mod &&
1756+ path. segments. iter( ) . any( |segment| segment. parameters. is_some( ) ) {
1757+ self . diagnostic( ) . span_err( path. span, "unexpected generic arguments in path" ) ;
1758+ }
1759+ path
1760+ } ) ;
17551761
17561762 let lo = self . meta_var_span . unwrap_or ( self . span ) ;
17571763 let is_global = self . eat ( & token:: ModSep ) ;
Original file line number Diff line number Diff line change 1+ // Copyright 2017 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+ #![ allow( unused) ]
12+
13+ macro_rules! m {
14+ ( $attr_path: path) => {
15+ #[ $attr_path]
16+ fn f( ) { }
17+ }
18+ }
19+
20+ m ! ( inline<u8 >) ; //~ ERROR: unexpected generic arguments in path
21+
22+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments