Skip to content

Commit

Permalink
Fix lint_without_lint_pass internal lint
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 authored and andrehjr committed Apr 15, 2019
1 parent b2fc5ed commit 53e34fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clippy_lints/src/utils/internal_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
output: &mut self.registered_lints,
cx,
};
let body_id = cx.tcx.hir().body_owned_by(impl_item_refs[0].id.hir_id);
let body_id = cx.tcx.hir().body_owned_by(
impl_item_refs
.iter()
.find(|iiref| iiref.ident.as_str() == "get_lints")
.expect("LintPass needs to implement get_lints")
.id.hir_id
);
collector.visit_expr(&cx.tcx.hir().body(body_id).value);
}
}
Expand Down

0 comments on commit 53e34fa

Please sign in to comment.