Skip to content

Commit

Permalink
fix: rust-lang#120878 Use param.name.indent().span if type parameter …
Browse files Browse the repository at this point in the history
…default exists.

change span.hi if exists default.

Diagnostic suggests adding : ?Sized in an incorrect place if a type parameter default is present
  • Loading branch information
OdenShirataki committed Feb 11, 2024
1 parent dbbef30 commit 094730a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2994,9 +2994,8 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
(s, " +")
} else {
(
if let GenericParamKind::Type { default: Some(default), synthetic: _ } = param.kind
{
span.data().with_hi(default.span.lo() - rustc_span::BytePos(3))
if let GenericParamKind::Type { default: Some(_), synthetic: _ } = param.kind {
param.name.ident().span
} else {
span
}
Expand Down

0 comments on commit 094730a

Please sign in to comment.