Skip to content

Commit b69895b

Browse files
committed
Update Clippy
1 parent 66da51a commit b69895b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+457
-388
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ matrix:
104104
allow_failures:
105105
- os: windows
106106
env: CARGO_INCREMENTAL=0 OS_WINDOWS=true
107+
# FIXME: Remove this once rls gets rustup
108+
- env: INTEGRATION=rust-lang/rls
107109

108110
before_script:
109111
- |

clippy_lints/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ use rustc::lint::{
1515
use rustc::ty;
1616
use rustc_errors::Applicability;
1717
use rustc_session::declare_tool_lint;
18+
use rustc_span::symbol::Symbol;
1819
use semver::Version;
1920
use syntax::ast::{AttrKind, AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem};
2021
use syntax::source_map::Span;
2122
use syntax::util::lev_distance::find_best_match_for_name;
22-
use syntax_pos::symbol::Symbol;
2323

2424
declare_clippy_lint! {
2525
/// **What it does:** Checks for items annotated with `#[inline(always)]`,

clippy_lints/src/booleans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonminimalBool {
6060
&mut self,
6161
cx: &LateContext<'a, 'tcx>,
6262
_: intravisit::FnKind<'tcx>,
63-
_: &'tcx FnDecl,
63+
_: &'tcx FnDecl<'_>,
6464
body: &'tcx Body<'_>,
6565
_: Span,
6666
_: HirId,

clippy_lints/src/checked_conversions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ fn get_types_from_cast<'a>(expr: &'a Expr<'_>, func: &'a str, types: &'a [&str])
287287
}
288288

289289
/// Gets the type which implements the called function
290-
fn get_implementing_type<'a>(path: &QPath, candidates: &'a [&str], function: &str) -> Option<&'a str> {
290+
fn get_implementing_type<'a>(path: &QPath<'_>, candidates: &'a [&str], function: &str) -> Option<&'a str> {
291291
if_chain! {
292292
if let QPath::TypeRelative(ref ty, ref path) = &path;
293293
if path.ident.name.as_str() == function;
@@ -304,7 +304,7 @@ fn get_implementing_type<'a>(path: &QPath, candidates: &'a [&str], function: &st
304304
}
305305

306306
/// Gets the type as a string, if it is a supported integer
307-
fn int_ty_to_sym(path: &QPath) -> Option<&str> {
307+
fn int_ty_to_sym<'tcx>(path: &QPath<'_>) -> Option<&'tcx str> {
308308
if_chain! {
309309
if let QPath::Resolved(_, ref path) = *path;
310310
if let [ty] = &*path.segments;

clippy_lints/src/cognitive_complexity.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use rustc::hir::*;
55
use rustc::impl_lint_pass;
66
use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
77
use rustc_session::declare_tool_lint;
8+
use rustc_span::BytePos;
89
use syntax::ast::Attribute;
910
use syntax::source_map::Span;
10-
use syntax_pos::BytePos;
1111

1212
use crate::utils::{match_type, paths, snippet_opt, span_help_and_lint, LimitStack};
1313

@@ -47,7 +47,7 @@ impl CognitiveComplexity {
4747
&mut self,
4848
cx: &'a LateContext<'a, 'tcx>,
4949
kind: FnKind<'tcx>,
50-
decl: &'tcx FnDecl,
50+
decl: &'tcx FnDecl<'_>,
5151
body: &'tcx Body<'_>,
5252
body_span: Span,
5353
) {
@@ -116,7 +116,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CognitiveComplexity {
116116
&mut self,
117117
cx: &LateContext<'a, 'tcx>,
118118
kind: FnKind<'tcx>,
119-
decl: &'tcx FnDecl,
119+
decl: &'tcx FnDecl<'_>,
120120
body: &'tcx Body<'_>,
121121
span: Span,
122122
hir_id: HirId,

clippy_lints/src/consts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ use rustc::ty::subst::{Subst, SubstsRef};
99
use rustc::ty::{self, Ty, TyCtxt};
1010
use rustc::{bug, span_bug};
1111
use rustc_data_structures::sync::Lrc;
12+
use rustc_span::symbol::Symbol;
1213
use std::cmp::Ordering::{self, Equal};
1314
use std::cmp::PartialOrd;
1415
use std::convert::TryInto;
1516
use std::hash::{Hash, Hasher};
1617
use syntax::ast::{FloatTy, LitKind};
17-
use syntax_pos::symbol::Symbol;
1818

1919
/// A `LitKind`-like enum to fold constant `Expr`s into.
2020
#[derive(Debug, Clone)]
@@ -320,7 +320,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
320320
}
321321

322322
/// Lookup a possibly constant expression from a `ExprKind::Path`.
323-
fn fetch_path(&mut self, qpath: &QPath, id: HirId) -> Option<Constant> {
323+
fn fetch_path(&mut self, qpath: &QPath<'_>, id: HirId) -> Option<Constant> {
324324
let res = self.tables.qpath_res(qpath, id);
325325
match res {
326326
Res::Def(DefKind::Const, def_id) | Res::Def(DefKind::AssocConst, def_id) => {

clippy_lints/src/derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Derive {
8484
fn check_hash_peq<'a, 'tcx>(
8585
cx: &LateContext<'a, 'tcx>,
8686
span: Span,
87-
trait_ref: &TraitRef,
87+
trait_ref: &TraitRef<'_>,
8888
ty: Ty<'tcx>,
8989
hash_is_automatically_derived: bool,
9090
) {
@@ -130,7 +130,7 @@ fn check_hash_peq<'a, 'tcx>(
130130
}
131131

132132
/// Implementation of the `EXPL_IMPL_CLONE_ON_COPY` lint.
133-
fn check_copy_clone<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, item: &Item<'_>, trait_ref: &TraitRef, ty: Ty<'tcx>) {
133+
fn check_copy_clone<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, item: &Item<'_>, trait_ref: &TraitRef<'_>, ty: Ty<'tcx>) {
134134
if match_path(&trait_ref.path, &paths::CLONE_TRAIT) {
135135
if !is_copy(cx, ty) {
136136
return;

clippy_lints/src/doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use rustc::impl_lint_pass;
55
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
66
use rustc_data_structures::fx::FxHashSet;
77
use rustc_session::declare_tool_lint;
8+
use rustc_span::Pos;
89
use std::ops::Range;
910
use syntax::ast::{AttrKind, Attribute};
1011
use syntax::source_map::{BytePos, MultiSpan, Span};
11-
use syntax_pos::Pos;
1212
use url::Url;
1313

1414
declare_clippy_lint! {
@@ -190,7 +190,7 @@ fn lint_for_missing_headers<'a, 'tcx>(
190190
cx: &LateContext<'a, 'tcx>,
191191
hir_id: hir::HirId,
192192
span: impl Into<MultiSpan> + Copy,
193-
sig: &hir::FnSig,
193+
sig: &hir::FnSig<'_>,
194194
headers: DocHeaders,
195195
) {
196196
if !cx.access_levels.is_exported(hir_id) {

clippy_lints/src/drop_bounds.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ const DROP_BOUNDS_SUMMARY: &str = "Bounds of the form `T: Drop` are useless. \
3939
declare_lint_pass!(DropBounds => [DROP_BOUNDS]);
4040

4141
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DropBounds {
42-
fn check_generic_param(&mut self, cx: &rustc::lint::LateContext<'a, 'tcx>, p: &'tcx GenericParam) {
43-
for bound in &p.bounds {
42+
fn check_generic_param(&mut self, cx: &rustc::lint::LateContext<'a, 'tcx>, p: &'tcx GenericParam<'_>) {
43+
for bound in p.bounds.iter() {
4444
lint_bound(cx, bound);
4545
}
4646
}
47-
fn check_where_predicate(&mut self, cx: &rustc::lint::LateContext<'a, 'tcx>, p: &'tcx WherePredicate) {
47+
fn check_where_predicate(&mut self, cx: &rustc::lint::LateContext<'a, 'tcx>, p: &'tcx WherePredicate<'_>) {
4848
if let WherePredicate::BoundPredicate(WhereBoundPredicate { bounds, .. }) = p {
49-
for bound in bounds {
49+
for bound in *bounds {
5050
lint_bound(cx, bound);
5151
}
5252
}
5353
}
5454
}
5555

56-
fn lint_bound<'a, 'tcx>(cx: &rustc::lint::LateContext<'a, 'tcx>, bound: &'tcx GenericBound) {
56+
fn lint_bound<'a, 'tcx>(cx: &rustc::lint::LateContext<'a, 'tcx>, bound: &'tcx GenericBound<'_>) {
5757
if_chain! {
5858
if let GenericBound::Trait(t, _) = bound;
5959
if let Some(def_id) = t.trait_ref.path.res.opt_def_id();

clippy_lints/src/escape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
5555
&mut self,
5656
cx: &LateContext<'a, 'tcx>,
5757
_: visit::FnKind<'tcx>,
58-
_: &'tcx FnDecl,
58+
_: &'tcx FnDecl<'_>,
5959
body: &'tcx Body<'_>,
6060
_: Span,
6161
hir_id: HirId,

0 commit comments

Comments
 (0)