about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/path.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs
index 4234740b2b1..6b7059eecf4 100644
--- a/compiler/rustc_parse/src/parser/path.rs
+++ b/compiler/rustc_parse/src/parser/path.rs
@@ -133,7 +133,15 @@ impl<'a> Parser<'a> {
         maybe_whole!(self, NtPath, |path| {
             if style == PathStyle::Mod && path.segments.iter().any(|segment| segment.args.is_some())
             {
-                self.struct_span_err(path.span, "unexpected generic arguments in path").emit();
+                self.struct_span_err(
+                    path.segments
+                        .iter()
+                        .filter_map(|segment| segment.args.as_ref())
+                        .map(|arg| arg.span())
+                        .collect::<Vec<_>>(),
+                    "unexpected generic arguments in path",
+                )
+                .emit();
             }
             path
         });