From 305177d9cc4e4e75d98d031e38b492e5c394f26d Mon Sep 17 00:00:00 2001 From: csmoe Date: Mon, 27 Apr 2020 21:56:20 +0800 Subject: [PATCH] rustup: rust-lang/rust#71628 --- clippy_lints/src/needless_pass_by_value.rs | 2 +- clippy_lints/src/utils/mod.rs | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index 653ab44e1..200fd5656 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -111,7 +111,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue { let fn_def_id = cx.tcx.hir().local_def_id(hir_id); - let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.to_vec()) + let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.iter().copied()) .filter(|p| !p.is_global()) .filter_map(|obligation| { if let ty::Predicate::Trait(poly_trait_ref, _) = obligation.predicate { diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 0d37932dd..1b21eaeb1 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -1384,13 +1384,12 @@ pub fn is_trait_impl_item(cx: &LateContext<'_, '_>, hir_id: HirId) -> bool { /// ``` pub fn fn_has_unsatisfiable_preds(cx: &LateContext<'_, '_>, did: DefId) -> bool { use rustc_trait_selection::traits; - let predicates = cx - .tcx - .predicates_of(did) - .predicates - .iter() - .filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None }) - .collect(); + let predicates = + cx.tcx + .predicates_of(did) + .predicates + .iter() + .filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None }); !traits::normalize_and_test_predicates( cx.tcx, traits::elaborate_predicates(cx.tcx, predicates)