Tweak type argument after assoc type error
This commit is contained in:
parent
8119017746
commit
de3c4be099
2 changed files with 10 additions and 3 deletions
|
@ -5360,8 +5360,15 @@ impl<'a> Parser<'a> {
|
||||||
// Parse type argument.
|
// Parse type argument.
|
||||||
let ty_param = self.parse_ty()?;
|
let ty_param = self.parse_ty()?;
|
||||||
if seen_binding {
|
if seen_binding {
|
||||||
self.span_err(ty_param.span,
|
self.struct_span_err(
|
||||||
"type parameters must be declared prior to associated type bindings");
|
ty_param.span,
|
||||||
|
"type parameters must be declared prior to associated type bindings"
|
||||||
|
)
|
||||||
|
.span_label(
|
||||||
|
ty_param.span,
|
||||||
|
"must be declared prior to associated type bindings",
|
||||||
|
)
|
||||||
|
.emit();
|
||||||
}
|
}
|
||||||
args.push(GenericArg::Type(ty_param));
|
args.push(GenericArg::Type(ty_param));
|
||||||
seen_type = true;
|
seen_type = true;
|
||||||
|
|
|
@ -2,7 +2,7 @@ error: type parameters must be declared prior to associated type bindings
|
||||||
--> $DIR/issue-32214.rs:5:34
|
--> $DIR/issue-32214.rs:5:34
|
||||||
|
|
|
|
||||||
LL | pub fn test<W, I: Trait<Item=(), W> >() {}
|
LL | pub fn test<W, I: Trait<Item=(), W> >() {}
|
||||||
| ^
|
| ^ must be declared prior to associated type bindings
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue