From a03d1d5965fd33cb9f51a034fbfda345ed2ca3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 9 Sep 2020 22:37:42 +0900 Subject: [PATCH] Handle function declaration without body --- src/rules/no_redeclare.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rules/no_redeclare.rs b/src/rules/no_redeclare.rs index b1575386a..30de7ec59 100644 --- a/src/rules/no_redeclare.rs +++ b/src/rules/no_redeclare.rs @@ -55,6 +55,10 @@ impl Visit for NoRedeclareVisitor { noop_visit_type!(); fn visit_fn_decl(&mut self, f: &FnDecl, _: &dyn Node) { + if f.function.body.is_none() { + return; + } + self.declare(&f.ident); f.visit_children_with(self);