Skip to content

Commit de3c4be

Browse files
committed
Tweak type argument after assoc type error
1 parent 8119017 commit de3c4be

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5360,8 +5360,15 @@ impl<'a> Parser<'a> {
53605360
// Parse type argument.
53615361
let ty_param = self.parse_ty()?;
53625362
if seen_binding {
5363-
self.span_err(ty_param.span,
5364-
"type parameters must be declared prior to associated type bindings");
5363+
self.struct_span_err(
5364+
ty_param.span,
5365+
"type parameters must be declared prior to associated type bindings"
5366+
)
5367+
.span_label(
5368+
ty_param.span,
5369+
"must be declared prior to associated type bindings",
5370+
)
5371+
.emit();
53655372
}
53665373
args.push(GenericArg::Type(ty_param));
53675374
seen_type = true;

src/test/ui/parser/issue-32214.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: type parameters must be declared prior to associated type bindings
22
--> $DIR/issue-32214.rs:5:34
33
|
44
LL | pub fn test<W, I: Trait<Item=(), W> >() {}
5-
| ^
5+
| ^ must be declared prior to associated type bindings
66

77
error: aborting due to previous error
88

0 commit comments

Comments
 (0)