Skip to content

Commit f2486b3

Browse files
committed
Auto merge of #5538 - csmoe:rustup, r=phansch
rustup: rust-lang/rust#71628 cc rust-lang/rust#71608 changelog: none
2 parents d13ffbe + 305177d commit f2486b3

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

clippy_lints/src/needless_pass_by_value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
111111

112112
let fn_def_id = cx.tcx.hir().local_def_id(hir_id);
113113

114-
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.to_vec())
114+
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.iter().copied())
115115
.filter(|p| !p.is_global())
116116
.filter_map(|obligation| {
117117
if let ty::Predicate::Trait(poly_trait_ref, _) = obligation.predicate {

clippy_lints/src/utils/mod.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -1384,13 +1384,12 @@ pub fn is_trait_impl_item(cx: &LateContext<'_, '_>, hir_id: HirId) -> bool {
13841384
/// ```
13851385
pub fn fn_has_unsatisfiable_preds(cx: &LateContext<'_, '_>, did: DefId) -> bool {
13861386
use rustc_trait_selection::traits;
1387-
let predicates = cx
1388-
.tcx
1389-
.predicates_of(did)
1390-
.predicates
1391-
.iter()
1392-
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None })
1393-
.collect();
1387+
let predicates =
1388+
cx.tcx
1389+
.predicates_of(did)
1390+
.predicates
1391+
.iter()
1392+
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None });
13941393
!traits::normalize_and_test_predicates(
13951394
cx.tcx,
13961395
traits::elaborate_predicates(cx.tcx, predicates)

0 commit comments

Comments
 (0)