Skip to content

Commit 094730a

Browse files
committed
fix: rust-lang#120878 Use param.name.indent().span if type parameter default exists.
change span.hi if exists default. Diagnostic suggests adding : ?Sized in an incorrect place if a type parameter default is present
1 parent dbbef30 commit 094730a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,9 +2994,8 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
29942994
(s, " +")
29952995
} else {
29962996
(
2997-
if let GenericParamKind::Type { default: Some(default), synthetic: _ } = param.kind
2998-
{
2999-
span.data().with_hi(default.span.lo() - rustc_span::BytePos(3))
2997+
if let GenericParamKind::Type { default: Some(_), synthetic: _ } = param.kind {
2998+
param.name.ident().span
30002999
} else {
30013000
span
30023001
}

0 commit comments

Comments
 (0)