]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/copy_iterator.rs
MutImmutable -> Immutable, MutMutable -> Mutable, CaptureClause -> CaptureBy
[rust.git] / clippy_lints / src / copy_iterator.rs
index 79e30f1a7d8aad3b993a72ee5a65fd241fcb041b..73de8add32d315e738683b0f47a7a52a174cb8ec 100644 (file)
@@ -13,7 +13,7 @@
     /// **Known problems:** None.
     ///
     /// **Example:**
-    /// ```rust
+    /// ```rust,ignore
     /// #[derive(Copy, Clone)]
     /// struct Countdown(u8);
     ///
@@ -33,8 +33,8 @@
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CopyIterator {
     fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
-        if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) = item.node {
-            let ty = cx.tcx.type_of(cx.tcx.hir().local_def_id_from_hir_id(item.hir_id));
+        if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) = item.kind {
+            let ty = cx.tcx.type_of(cx.tcx.hir().local_def_id(item.hir_id));
 
             if is_copy(cx, ty) && match_path(&trait_ref.path, &paths::ITERATOR) {
                 span_note_and_lint(