Skip to content

Commit af80c53

Browse files
committed
Clippy dogfood
1 parent 8612346 commit af80c53

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

clippy_lints/src/utils/higher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub struct Range<'a> {
5050
pub fn range<'a, 'b, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'b hir::Expr) -> Option<Range<'b>> {
5151
/// Finds the field named `name` in the field. Always return `Some` for
5252
/// convenience.
53-
fn get_field<'a>(name: Symbol, fields: &'a [hir::Field]) -> Option<&'a hir::Expr> {
53+
fn get_field(name: Symbol, fields: &[hir::Field]) -> Option<&hir::Expr> {
5454
let expr = &fields.iter().find(|field| field.ident.name == name)?.expr;
5555

5656
Some(expr)

clippy_lints/src/utils/internal_lints.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::utils::{match_type, match_def_path, paths, span_help_and_lint, span_lint, walk_ptrs_ty};
2-
use crate::utils::sym;
32
use if_chain::if_chain;
43
use rustc::hir;
54
use rustc::hir::def::{DefKind, Res};
@@ -8,9 +7,8 @@ use rustc::hir::*;
87
use rustc::lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintArray, LintPass};
98
use rustc::{declare_lint_pass, declare_tool_lint, impl_lint_pass};
109
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
11-
use syntax::ast::{Crate as AstCrate, ItemKind, Name};
10+
use syntax::ast::{Crate as AstCrate, Name};
1211
use syntax::source_map::Span;
13-
use syntax::symbol::LocalInternedString;
1412

1513
declare_clippy_lint! {
1614
/// **What it does:** Checks for various things we like to keep tidy in clippy.
@@ -76,7 +74,9 @@ declare_clippy_lint! {
7674
declare_lint_pass!(ClippyLintsInternal => [CLIPPY_LINTS_INTERNAL]);
7775

7876
impl EarlyLintPass for ClippyLintsInternal {
79-
fn check_crate(&mut self, cx: &EarlyContext<'_>, krate: &AstCrate) {
77+
fn check_crate(&mut self, _cx: &EarlyContext<'_>, _krate: &AstCrate) {
78+
/*
79+
FIXME: turn back on when we get rid of all the lazy_statics
8080
if let Some(utils) = krate.module.items.iter().find(|item| item.ident.name == *sym::utils) {
8181
if let ItemKind::Mod(ref utils_mod) = utils.node {
8282
if let Some(paths) = utils_mod.items.iter().find(|item| item.ident.name == *sym::paths) {
@@ -101,6 +101,7 @@ impl EarlyLintPass for ClippyLintsInternal {
101101
}
102102
}
103103
}
104+
*/
104105
}
105106
}
106107

clippy_lints/src/utils/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ pub fn has_iter_method(cx: &LateContext<'_, '_>, probably_ref_ty: Ty<'_>) -> Opt
10281028
_ => return None,
10291029
};
10301030

1031-
for path in into_iter_collections.iter() {
1031+
for path in &into_iter_collections {
10321032
if match_def_path(cx, def_id, path) {
10331033
return Some(*path.last().unwrap());
10341034
}

0 commit comments

Comments
 (0)