1
Fork 0

Rollup merge of #126234 - Bryanskiy:delegation-no-entry-ice, r=petrochenkov

Delegation: fix ICE on late diagnostics

fixes https://github.com/rust-lang/rust/issues/124342
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-06-11 09:14:35 +01:00 committed by GitHub
commit 76acf2617c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 8 deletions

View file

@ -2041,8 +2041,11 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
ast::AssocItemKind::Fn(..) => AssocSuggestion::AssocFn { called },
ast::AssocItemKind::Type(..) => AssocSuggestion::AssocType,
ast::AssocItemKind::Delegation(..)
if self.r.delegation_fn_sigs[&self.r.local_def_id(assoc_item.id)]
.has_self =>
if self
.r
.delegation_fn_sigs
.get(&self.r.local_def_id(assoc_item.id))
.map_or(false, |sig| sig.has_self) =>
{
AssocSuggestion::MethodWithSelf { called }
}