about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-05-17 01:51:33 +0200
committerGitHub <noreply@github.com>2020-05-17 01:51:33 +0200
commit770b1f35de8c552e3737fab0708a9ab1c5eb69e7 (patch)
treecbe8b0ef510770bf16aafed610d27ff3fc3eacb5
parent444f449d10b4f2ff3025644e580c43f039cd08ac (diff)
parent47034db8510ec4ea2a82ce3b8779b3b4816b1134 (diff)
downloadrust-770b1f35de8c552e3737fab0708a9ab1c5eb69e7.tar.gz
rust-770b1f35de8c552e3737fab0708a9ab1c5eb69e7.zip
Rollup merge of #72281 - estebank:fix-ws-sugg, r=Dylan-DPC
Fix whitespace in `?Sized` structured suggestion
-rw-r--r--src/librustc_trait_selection/traits/error_reporting/mod.rs2
-rw-r--r--src/test/ui/unsized3.stderr4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_trait_selection/traits/error_reporting/mod.rs b/src/librustc_trait_selection/traits/error_reporting/mod.rs
index 6bd4455e1e3..0d53df3bf4b 100644
--- a/src/librustc_trait_selection/traits/error_reporting/mod.rs
+++ b/src/librustc_trait_selection/traits/error_reporting/mod.rs
@@ -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,
diff --git a/src/test/ui/unsized3.stderr b/src/test/ui/unsized3.stderr
index cf8459609b6..828e8bc9f4a 100644
--- a/src/test/ui/unsized3.stderr
+++ b/src/test/ui/unsized3.stderr
@@ -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