mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
Rollup merge of #72281 - estebank:fix-ws-sugg, r=Dylan-DPC
Fix whitespace in `?Sized` structured suggestion
This commit is contained in:
commit
770b1f35de
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user