Skip to content

Commit 68b2f12

Browse files
committed
Merge pull request #791 from Jascha-N/fix-fnkind-pattern
Match attributes in FnKind patterns
2 parents 523c596 + a7f662d commit 68b2f12

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl LintPass for TopLevelRefPass {
3939

4040
impl LateLintPass for TopLevelRefPass {
4141
fn check_fn(&mut self, cx: &LateContext, k: FnKind, decl: &FnDecl, _: &Block, _: Span, _: NodeId) {
42-
if let FnKind::Closure = k {
42+
if let FnKind::Closure(_) = k {
4343
// Does not apply to closures
4444
return;
4545
}

src/new_without_default.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl LateLintPass for NewWithoutDefault {
4646
return;
4747
}
4848

49-
if let FnKind::Method(name, _, _) = kind {
49+
if let FnKind::Method(name, _, _, _) = kind {
5050
if decl.inputs.is_empty() && name.as_str() == "new" {
5151
let self_ty = cx.tcx.lookup_item_type(cx.tcx.map.local_def_id(cx.tcx.map.get_parent(id))).ty;
5252

0 commit comments

Comments
 (0)