1
Fork 0

Rollup merge of #112325 - notriddle:notriddle/issue-111932, r=compiler-errors

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

Fixes #111932
This commit is contained in:
Matthias Krüger 2023-06-06 12:00:34 +02:00 committed by GitHub
commit 38c92cca65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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()