Change:
No response No response No response <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Another variant of this error I came up with using stable Edit Just tested on stable and . Both produced the same output.
claim
This is only tangentially related but just to give more context to anyone stumbling upon this issue: The diagnostic highlighting the entire path instead of only the type argument is tracked in .

Discussion:
this = "the implicit `Sized` requirement on this type parameter"; } if let Some(hir::Node::TraitItem(hir::TraitItem { <del> ident, </del> <ins> generics, </ins> kind: hir::TraitItemKind::Type(bounds, None), .. })) = tcx.hir().get_if_local(item_def_id)

let (span, separator) = if let [.., last] = bounds { (last.span().shrink_to_hi(), " +") } else { <del> (ident.span.shrink_to_hi(), ":") </del> <ins> (generics.span.shrink_to_hi(), ":") </ins> }; err.span_suggestion_verbose( span,

{ (s, " +") } else { <del> (span.shrink_to_hi(), ":") </del> <ins> (param.name.ident().span.shrink_to_hi(), ":") </ins> }; err.span_suggestion_verbose( span,

<ins> // issue: 120878 fn main() { struct StructA<A, B = A> { _marker: std::marker::PhantomData<fn() -> (A, B)>, } struct StructB { a: StructA<isize, [u8]>, //~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277] } trait Trait { type P<X>; } impl Trait for () { type P<X> = [u8]; //~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277] } } </ins>

<ins> error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/suggest-maybe-sized-bound.rs:8:12 | LL |         a: StructA<isize, [u8]>, |            ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` note: required by an implicit `Sized` bound in `StructA` --> $DIR/suggest-maybe-sized-bound.rs:3:23 | LL |     struct StructA<A, B = A> { |                       ^^^^^ required by the implicit `Sized` requirement on this type parameter in `StructA` help: consider relaxing the implicit `Sized` restriction | LL |     struct StructA<A, B: ?Sized = A> { |                        ++++++++ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/suggest-maybe-sized-bound.rs:17:21 | LL |         type P<X> = [u8]; |                     ^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` note: required by a bound in `Trait::P` --> $DIR/suggest-maybe-sized-bound.rs:13:9 | LL |         type P<X>; |         ^^^^^^^^^^ required by this bound in `Trait::P` help: consider relaxing the implicit `Sized` restriction | LL |         type P<X>: ?Sized; |                  ++++++++ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0277`. </ins>

|                              +++++++ help: consider relaxing the implicit `Sized` restriction | <del> LL | pub trait Foo<RHS=Self: ?Sized> { |                       ++++++++ </del> <ins> LL | pub trait Foo<RHS: ?Sized=Self> { |                  ++++++++ </ins> error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/issue-28576.rs:5:16

|       +++++++++++++++++ help: consider relaxing the implicit `Sized` restriction | <del> LL | pub trait Foo<RHS=Self: ?Sized> { |                       ++++++++ </del> <ins> LL | pub trait Foo<RHS: ?Sized=Self> { |                  ++++++++ </ins> error: aborting due to 3 previous errors