1
Fork 0

diagnostics: do not suggest type name tweaks on type-inferred closure args

Fixes #111932
This commit is contained in:
Michael Howell 2023-06-05 15:28:50 -07:00
parent 408bbd0406
commit 467bc9ffd5
6 changed files with 62 additions and 8 deletions

View file

@ -2807,8 +2807,8 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
err.help("unsized locals are gated as an unstable feature");
}
}
ObligationCauseCode::SizedArgumentType(sp) => {
if let Some(span) = sp {
ObligationCauseCode::SizedArgumentType(ty_span) => {
if let Some(span) = ty_span {
if let ty::PredicateKind::Clause(clause) = predicate.kind().skip_binder()
&& let ty::Clause::Trait(trait_pred) = clause
&& let ty::Dynamic(..) = trait_pred.self_ty().kind()