From a7f662d8f291ebfdd5cbb46a9c96e28f49200d7f Mon Sep 17 00:00:00 2001 From: Jascha Date: Wed, 23 Mar 2016 16:11:24 +0100 Subject: [PATCH] Match attributes in FnKind patterns --- src/misc.rs | 2 +- src/new_without_default.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc.rs b/src/misc.rs index c7aeb7f9a..66771e9a6 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -39,7 +39,7 @@ impl LintPass for TopLevelRefPass { impl LateLintPass for TopLevelRefPass { fn check_fn(&mut self, cx: &LateContext, k: FnKind, decl: &FnDecl, _: &Block, _: Span, _: NodeId) { - if let FnKind::Closure = k { + if let FnKind::Closure(_) = k { // Does not apply to closures return; } diff --git a/src/new_without_default.rs b/src/new_without_default.rs index ff5c09e39..d9b11cc49 100644 --- a/src/new_without_default.rs +++ b/src/new_without_default.rs @@ -46,7 +46,7 @@ impl LateLintPass for NewWithoutDefault { return; } - if let FnKind::Method(name, _, _) = kind { + if let FnKind::Method(name, _, _, _) = kind { if decl.inputs.is_empty() && name.as_str() == "new" { let self_ty = cx.tcx.lookup_item_type(cx.tcx.map.local_def_id(cx.tcx.map.get_parent(id))).ty;