1
Fork 0

Auto merge of #94711 - ouz-a:master3, r=oli-obk

Return early to fix ICE

This fixes #94627, ICE happens because compiler tries to suggest constraining type parameter but the only constraint is implicit `std::Sized` one, so it gets removed and there is nothing to suggest resulting in ICE.
This commit is contained in:
bors 2022-03-12 16:37:07 +00:00
commit 22a20e3f0f
3 changed files with 93 additions and 1 deletions

View file

@ -512,7 +512,7 @@ pub fn suggest_constraining_type_params<'a>(
};
err.span_suggestion_verbose(span, msg, suggestion, applicability);
} else {
} else if suggestions.len() > 1 {
err.multipart_suggestion_verbose(
"consider restricting type parameters",
suggestions.into_iter().map(|(span, suggestion, _)| (span, suggestion)).collect(),