1
Fork 0

Rollup merge of #100940 - TaKO8Ki:do-not-suggest-adding-bound-to-opaque-type, r=fee1-dead

Do not suggest adding a bound to a opaque type

fixes #100442
This commit is contained in:
Matthias Krüger 2022-08-24 18:20:20 +02:00 committed by GitHub
commit 75b1b69171
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 0 deletions

View file

@ -281,6 +281,9 @@ impl<'tcx> BorrowExplanation<'tcx> {
span: Span,
region_name: &RegionName,
) {
if !span.is_desugaring(DesugaringKind::OpaqueTy) {
return;
}
if let ConstraintCategory::OpaqueType = category {
let suggestable_name =
if region_name.was_named() { region_name.name } else { kw::UnderscoreLifetime };