1
Fork 0

Only store a LocalDefId in hir::TraitItem.

This commit is contained in:
Camille GILLOT 2021-01-30 20:46:50 +01:00
parent 2dc65397ee
commit fc9bc33bba
9 changed files with 15 additions and 19 deletions

View file

@ -159,10 +159,7 @@ fn check_trait_items(cx: &LateContext<'_>, visited_trait: &Item<'_>, trait_items
fn is_named_self(cx: &LateContext<'_>, item: &TraitItemRef, name: &str) -> bool {
item.ident.name.as_str() == name
&& if let AssocItemKind::Fn { has_self } = item.kind {
has_self && {
let did = cx.tcx.hir().local_def_id(item.id.hir_id);
cx.tcx.fn_sig(did).inputs().skip_binder().len() == 1
}
has_self && { cx.tcx.fn_sig(item.id.def_id).inputs().skip_binder().len() == 1 }
} else {
false
}