"functions taking small copyable arguments by reference"
}
+#[derive(Copy, Clone)]
pub struct TriviallyCopyPassByRef {
limit: u64,
}
}
if_chain! {
- if let ty::Ref(input_lt, ty, Mutability::MutImmutable) = ty.kind;
+ if let ty::Ref(input_lt, ty, Mutability::Immutable) = ty.kind;
if !output_lts.contains(&input_lt);
if is_copy(cx, ty);
if let Some(size) = cx.layout_of(ty).ok().map(|l| l.size.bytes());
if size <= self.limit;
- if let hir::TyKind::Rptr(_, MutTy { ty: ref decl_ty, .. }) = input.node;
+ if let hir::TyKind::Rptr(_, MutTy { ty: ref decl_ty, .. }) = input.kind;
then {
let value_type = if is_self_ty(decl_ty) {
"self".into()
return;
}
- if let hir::TraitItemKind::Method(method_sig, _) = &item.node {
+ if let hir::TraitItemKind::Method(method_sig, _) = &item.kind {
self.check_poly_fn(cx, item.hir_id, &*method_sig.decl, None);
}
}
// Exclude non-inherent impls
if let Some(Node::Item(item)) = cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
- if matches!(item.node, ItemKind::Impl(_, _, _, _, Some(_), _, _) |
+ if matches!(item.kind, ItemKind::Impl(_, _, _, _, Some(_), _, _) |
ItemKind::Trait(..))
{
return;