File tree 2 files changed +29
-1
lines changed
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> {
1751
1751
fn parse_path_common ( & mut self , mode : PathStyle , parse_generics : bool )
1752
1752
-> PResult < ' a , ast:: Path >
1753
1753
{
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
+ } ) ;
1755
1761
1756
1762
let lo = self . meta_var_span . unwrap_or ( self . span ) ;
1757
1763
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