Skip to content

Commit 770b1f3

Browse files
authored
Rollup merge of #72281 - estebank:fix-ws-sugg, r=Dylan-DPC
Fix whitespace in `?Sized` structured suggestion
2 parents 444f449 + 47034db commit 770b1f3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc_trait_selection/traits/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
16551655
{
16561656
let (span, separator) = match param.bounds {
16571657
[] => (span.shrink_to_hi(), ":"),
1658-
[.., bound] => (bound.span().shrink_to_hi(), " + "),
1658+
[.., bound] => (bound.span().shrink_to_hi(), " +"),
16591659
};
16601660
err.span_suggestion_verbose(
16611661
span,

src/test/ui/unsized3.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ LL | fn f4<X: T>(x: &X) {
3131
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
3232
help: consider relaxing the implicit `Sized` restriction
3333
|
34-
LL | fn f4<X: T + ?Sized>(x: &X) {
35-
| ^^^^^^^^^
34+
LL | fn f4<X: T + ?Sized>(x: &X) {
35+
| ^^^^^^^^
3636

3737
error[E0277]: the size for values of type `X` cannot be known at compilation time
3838
--> $DIR/unsized3.rs:33:8

0 commit comments

Comments
 (0)