Skip to content

Commit 3961f2d

Browse files
committed
1 parent 5e8c0c5 commit 3961f2d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

clippy_lints/src/needless_pass_by_value.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
113113

114114
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.to_vec())
115115
.filter(|p| !p.is_global())
116-
.filter_map(|pred| {
117-
if let ty::Predicate::Trait(poly_trait_ref, _) = pred {
116+
.filter_map(|obligation| {
117+
if let ty::Predicate::Trait(poly_trait_ref, _) = obligation.predicate {
118118
if poly_trait_ref.def_id() == sized_trait || poly_trait_ref.skip_binder().has_escaping_bound_vars()
119119
{
120120
return None;

clippy_lints/src/utils/mod.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,13 @@ pub fn fn_has_unsatisfiable_preds(cx: &LateContext<'_, '_>, did: DefId) -> bool
13891389
.iter()
13901390
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None })
13911391
.collect();
1392-
!traits::normalize_and_test_predicates(cx.tcx, traits::elaborate_predicates(cx.tcx, predicates).collect())
1392+
!traits::normalize_and_test_predicates(
1393+
cx.tcx,
1394+
traits::elaborate_predicates(cx.tcx, predicates)
1395+
.into_iter()
1396+
.map(|o| o.predicate)
1397+
.collect::<Vec<_>>(),
1398+
)
13931399
}
13941400

13951401
#[cfg(test)]

0 commit comments

Comments
 (0)