diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 68137fbbf2a..b9dd9359c66 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -133,8 +133,12 @@ pub fn in_external_macro<T: LintContext>(cx: &T, span: Span) -> bool {
 /// ```
 pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[&str]) -> bool {
     cx.tcx.with_path(def_id, |iter| {
-        iter.zip(path)
+        let mut len = 0;
+
+        iter.inspect(|_| len += 1)
+            .zip(path)
             .all(|(nm, p)| nm.name().as_str() == *p)
+        && len == path.len()
     })
 }
 
diff --git a/tests/run-pass/ice-700.rs b/tests/run-pass/ice-700.rs
new file mode 100755
index 00000000000..a7ff78eac14
--- /dev/null
+++ b/tests/run-pass/ice-700.rs
@@ -0,0 +1,9 @@
+#![feature(plugin)]
+#![plugin(clippy)]
+#![deny(clippy)]
+
+fn core() {}
+
+fn main() {
+    core();
+}