File tree 5 files changed +29
-12
lines changed
compiler/rustc_parse/src/parser
5 files changed +29
-12
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,15 @@ impl<'a> Parser<'a> {
133
133
maybe_whole ! ( self , NtPath , |path| {
134
134
if style == PathStyle :: Mod && path. segments. iter( ) . any( |segment| segment. args. is_some( ) )
135
135
{
136
- self . struct_span_err( path. span, "unexpected generic arguments in path" ) . emit( ) ;
136
+ self . struct_span_err(
137
+ path. segments
138
+ . iter( )
139
+ . filter_map( |segment| segment. args. as_ref( ) )
140
+ . map( |arg| arg. span( ) )
141
+ . collect:: <Vec <_>>( ) ,
142
+ "unexpected generic arguments in path" ,
143
+ )
144
+ . emit( ) ;
137
145
}
138
146
path
139
147
} ) ;
Original file line number Diff line number Diff line change 1
1
error: unexpected generic arguments in path
2
- --> $DIR/issue-43424.rs:10:4
2
+ --> $DIR/issue-43424.rs:10:10
3
3
|
4
4
LL | m!(inline<u8>);
5
- | ^^^^^^ ^^^^
5
+ | ^^^^
6
6
7
7
error: aborting due to previous error
8
8
Original file line number Diff line number Diff line change @@ -16,5 +16,8 @@ fn f1() {
16
16
fn f2 ( ) {
17
17
import ! { a:: b:: c:: S <> } //~ ERROR unexpected generic arguments in path
18
18
}
19
+ fn f3 ( ) {
20
+ import ! { a:: b<>:: c<u8 >:: S <> } //~ ERROR unexpected generic arguments in path
21
+ }
19
22
20
23
fn main ( ) { }
Original file line number Diff line number Diff line change 1
1
error: unexpected generic arguments in path
2
- --> $DIR/import-ty-params.rs:14:15
2
+ --> $DIR/import-ty-params.rs:14:25
3
3
|
4
4
LL | import! { a::b::c::S<u8> }
5
- | ^^^^^^^^^^ ^^^^
5
+ | ^^^^
6
6
7
7
error: unexpected generic arguments in path
8
- --> $DIR/import-ty-params.rs:17:15
8
+ --> $DIR/import-ty-params.rs:17:25
9
9
|
10
10
LL | import! { a::b::c::S<> }
11
- | ^^^^^^^^^^ ^^
11
+ | ^^
12
12
13
- error: aborting due to 2 previous errors
13
+ error: unexpected generic arguments in path
14
+ --> $DIR/import-ty-params.rs:20:19
15
+ |
16
+ LL | import! { a::b<>::c<u8>::S<> }
17
+ | ^^ ^^^^ ^^
18
+
19
+ error: aborting due to 3 previous errors
14
20
Original file line number Diff line number Diff line change 1
1
error: unexpected generic arguments in path
2
- --> $DIR/visibility-ty-params.rs:6:5
2
+ --> $DIR/visibility-ty-params.rs:6:6
3
3
|
4
4
LL | m!{ S<u8> }
5
- | ^ ^^^^
5
+ | ^^^^
6
6
7
7
error[E0577]: expected module, found struct `S`
8
8
--> $DIR/visibility-ty-params.rs:6:5
@@ -11,10 +11,10 @@ LL | m!{ S<u8> }
11
11
| ^^^^^ not a module
12
12
13
13
error: unexpected generic arguments in path
14
- --> $DIR/visibility-ty-params.rs:10:9
14
+ --> $DIR/visibility-ty-params.rs:10:10
15
15
|
16
16
LL | m!{ m<> }
17
- | ^ ^^
17
+ | ^^
18
18
19
19
error: aborting due to 3 previous errors
20
20
You can’t perform that action at this time.
0 commit comments