Rollup merge of #72281 - estebank:fix-ws-sugg, r=Dylan-DPC

Fix whitespace in `?Sized` structured suggestion
This commit is contained in:
Dylan DPC 2020-05-17 01:51:33 +02:00 committed by GitHub
commit 770b1f35de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1655,7 +1655,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
{
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