Add and use expect methods to hir.
This commit is contained in:
parent
56ee85274e
commit
70f9d52079
7 changed files with 356 additions and 23 deletions
|
@ -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()?,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue