// `struct S<T>(T);` instead of `struct S<_, T>(T);`.
sugg.push((arg.span, (*type_name).to_string()));
} else {
+ let last = generics.iter().last().unwrap();
sugg.push((
- generics.iter().last().unwrap().span.shrink_to_hi(),
+ // Account for bounds, we want `fn foo<T: E, K>(_: K)` not `fn foo<T, K: E>(_: K)`.
+ last.bounds_span().unwrap_or(last.span).shrink_to_hi(),
format!(", {}", type_name),
));
}
|
help: use type parameters instead
|
-LL | fn foo<X, T: K<T, T>>(x: X) {}
- | ^^^ ^ ^
+LL | fn foo<X: K<T, T>, T>(x: X) {}
+ | ^ ^ ^^^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:52:34
|
help: use type parameters instead
|
-LL | fn baz<F, T: Fn() -> T>(_: F) {}
- | ^^^ ^
+LL | fn baz<F: Fn() -> T, T>(_: F) {}
+ | ^^^^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:58:33