Skip to content

Commit 5b25588

Browse files
committed
Auto merge of #4972 - JohnTitor:rustup, r=llogiq
Rustup to rust-lang/rust#66942 changelog: none
2 parents c807fbc + 790012a commit 5b25588

37 files changed

+141
-131
lines changed

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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,

clippy_lints/src/fallible_impl_from.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FallibleImplFrom {
4646
}
4747
}
4848

49-
fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_items: &[hir::ImplItemRef]) {
49+
fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_items: &[hir::ImplItemRef<'_>]) {
5050
use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
5151
use rustc::hir::*;
5252

clippy_lints/src/functions.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
187187
&mut self,
188188
cx: &LateContext<'a, 'tcx>,
189189
kind: intravisit::FnKind<'tcx>,
190-
decl: &'tcx hir::FnDecl,
190+
decl: &'tcx hir::FnDecl<'_>,
191191
body: &'tcx hir::Body<'_>,
192192
span: Span,
193193
hir_id: hir::HirId,
@@ -306,7 +306,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
306306
}
307307

308308
impl<'a, 'tcx> Functions {
309-
fn check_arg_number(self, cx: &LateContext<'_, '_>, decl: &hir::FnDecl, fn_span: Span) {
309+
fn check_arg_number(self, cx: &LateContext<'_, '_>, decl: &hir::FnDecl<'_>, fn_span: Span) {
310310
let args = decl.inputs.len() as u64;
311311
if args > self.threshold {
312312
span_lint(
@@ -375,7 +375,7 @@ impl<'a, 'tcx> Functions {
375375
fn check_raw_ptr(
376376
cx: &LateContext<'a, 'tcx>,
377377
unsafety: hir::Unsafety,
378-
decl: &'tcx hir::FnDecl,
378+
decl: &'tcx hir::FnDecl<'_>,
379379
body: &'tcx hir::Body<'_>,
380380
hir_id: hir::HirId,
381381
) {
@@ -402,7 +402,7 @@ impl<'a, 'tcx> Functions {
402402

403403
fn check_needless_must_use(
404404
cx: &LateContext<'_, '_>,
405-
decl: &hir::FnDecl,
405+
decl: &hir::FnDecl<'_>,
406406
item_id: hir::HirId,
407407
item_span: Span,
408408
fn_header_span: Span,
@@ -439,7 +439,7 @@ fn check_needless_must_use(
439439

440440
fn check_must_use_candidate<'a, 'tcx>(
441441
cx: &LateContext<'a, 'tcx>,
442-
decl: &'tcx hir::FnDecl,
442+
decl: &'tcx hir::FnDecl<'_>,
443443
body: &'tcx hir::Body<'_>,
444444
item_span: Span,
445445
item_id: hir::HirId,
@@ -467,7 +467,7 @@ fn check_must_use_candidate<'a, 'tcx>(
467467
});
468468
}
469469

470-
fn returns_unit(decl: &hir::FnDecl) -> bool {
470+
fn returns_unit(decl: &hir::FnDecl<'_>) -> bool {
471471
match decl.output {
472472
hir::FunctionRetTy::DefaultReturn(_) => true,
473473
hir::FunctionRetTy::Return(ref ty) => match ty.kind {
@@ -518,7 +518,7 @@ fn is_mutable_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>, span: Span,
518518
}
519519
}
520520

521-
fn raw_ptr_arg(arg: &hir::Param<'_>, ty: &hir::Ty) -> Option<hir::HirId> {
521+
fn raw_ptr_arg(arg: &hir::Param<'_>, ty: &hir::Ty<'_>) -> Option<hir::HirId> {
522522
if let (&hir::PatKind::Binding(_, id, _, _), &hir::TyKind::Ptr(_)) = (&arg.pat.kind, &ty.kind) {
523523
Some(id)
524524
} else {

0 commit comments

Comments
 (0)