Delegation: second attempt to improve perf
This commit is contained in:
parent
595316b400
commit
9b097b2d44
5 changed files with 33 additions and 27 deletions
|
@ -747,18 +747,7 @@ impl<'hir> Map<'hir> {
|
|||
}
|
||||
|
||||
pub fn opt_delegation_sig_id(self, def_id: LocalDefId) -> Option<DefId> {
|
||||
if let Some(ret) = self.get_fn_output(def_id)
|
||||
&& let FnRetTy::Return(ty) = ret
|
||||
&& let TyKind::InferDelegation(sig_id, _) = ty.kind
|
||||
{
|
||||
return Some(sig_id);
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn delegation_sig_id(self, def_id: LocalDefId) -> DefId {
|
||||
self.opt_delegation_sig_id(def_id).unwrap()
|
||||
self.tcx.opt_hir_owner_node(def_id)?.fn_decl()?.opt_delegation_sig_id()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue