X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=clippy_lints%2Fsrc%2Fneedless_pass_by_value.rs;h=986cd94cfb3cb794f819004ad84003f1effa099b;hb=6d1225981177587fbb68d9c4902c770c3dbaafb0;hp=05894de5cb708bfe00d6e011e615def80089c3fb;hpb=04036877efa2c571a1563ff695141b9d7edae142;p=rust.git diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index 05894de5cb7..986cd94cfb3 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -5,14 +5,15 @@ }; use if_chain::if_chain; use matches::matches; +use rustc::declare_lint_pass; use rustc::hir::intravisit::FnKind; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::traits; use rustc::ty::{self, RegionKind, TypeFoldable}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use rustc_target::spec::abi::Abi; use rustc_typeck::expr_use_visitor as euv; use std::borrow::Cow; @@ -71,7 +72,7 @@ fn check_fn( cx: &LateContext<'a, 'tcx>, kind: FnKind<'tcx>, decl: &'tcx FnDecl, - body: &'tcx Body, + body: &'tcx Body<'_>, span: Span, hir_id: HirId, ) { @@ -143,7 +144,7 @@ fn check_fn( let fn_sig = cx.tcx.fn_sig(fn_def_id); let fn_sig = cx.tcx.erase_late_bound_regions(&fn_sig); - for (idx, ((input, &ty), arg)) in decl.inputs.iter().zip(fn_sig.inputs()).zip(&body.params).enumerate() { + for (idx, ((input, &ty), arg)) in decl.inputs.iter().zip(fn_sig.inputs()).zip(body.params).enumerate() { // All spans generated from a proc-macro invocation are the same... if span == input.span { return;