diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index 6dc5654862b..3e87ef03832 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -115,8 +115,7 @@ fn check_fn( .filter(|p| !p.is_global()) .filter_map(|obligation| { // Note that we do not want to deal with qualified predicates here. - let binder = obligation.predicate.bound_atom(); - match binder.skip_binder() { + match obligation.predicate.bound_atom().skip_binder() { ty::PredicateAtom::Trait(pred, _) if !pred.has_escaping_bound_vars() => { if pred.def_id() == sized_trait { return None;