about summary refs log tree commit diff
path: root/compiler/rustc_resolve
diff options
context:
space:
mode:
authorBryanskiy <ivakin.kir@gmail.com>2024-06-10 18:02:53 +0300
committerBryanskiy <ivakin.kir@gmail.com>2024-06-10 19:25:34 +0300
commit040791a9c59d2f604060efb75c81f685ceb5f9db (patch)
tree014b094a72c809c60d013e9fd4f0019233e8f8a0 /compiler/rustc_resolve
parent06194cadcd0948a7100b46737f61e82b8c00d632 (diff)
Delegation: fix ICE on late diagnostics
Diffstat (limited to 'compiler/rustc_resolve')
-rw-r--r--compiler/rustc_resolve/src/late/diagnostics.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs
index ec24eac4a9d..9eeb0da7ed2 100644
--- a/compiler/rustc_resolve/src/late/diagnostics.rs
+++ b/compiler/rustc_resolve/src/late/diagnostics.rs
@@ -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 }
                         }