Fix whitespace in ?Sized structured suggestion

This commit is contained in:
Esteban Küber 2020-05-16 12:56:21 -07:00
parent 31add7e607
commit 47034db851
2 changed files with 3 additions and 3 deletions

View file

@ -1655,7 +1655,7 @@ fn suggest_unsized_bound_if_applicable(
{
let (span, separator) = match param.bounds {
[] => (span.shrink_to_hi(), ":"),
[.., bound] => (bound.span().shrink_to_hi(), " + "),
[.., bound] => (bound.span().shrink_to_hi(), " +"),
};
err.span_suggestion_verbose(
span,

View file

@ -31,8 +31,8 @@ LL | fn f4<X: T>(x: &X) {
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f4<X: T + ?Sized>(x: &X) {
| ^^^^^^^^^
LL | fn f4<X: T + ?Sized>(x: &X) {
| ^^^^^^^^
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:33:8