1
Fork 0

Add and use expect methods to hir.

This commit is contained in:
Maybe Waffle 2023-01-20 15:59:56 +00:00
parent 56ee85274e
commit 70f9d52079
7 changed files with 356 additions and 23 deletions

View file

@ -3124,8 +3124,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
let hir::Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Fn(..), ident, .. }) =
hir.get(fn_hir_id) else { return None };
let hir::Node::Item(hir::Item { kind: hir::ItemKind::Impl(i), .. }) =
hir.get_parent(fn_hir_id) else { bug!("ImplItem should have Impl parent") };
let i = hir.get_parent(fn_hir_id).expect_item().expect_impl();
let trait_ref = self.instantiate_mono_trait_ref(
i.of_trait.as_ref()?,