Use pred not binder

This commit is contained in:
Jack Huey 2021-01-04 15:30:22 -05:00
parent f06eeaf982
commit 7c3b6a63ad

View file

@ -117,7 +117,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
// Note that we do not want to deal with qualified predicates here.
let binder = obligation.predicate.bound_atom();
match binder.skip_binder() {
ty::PredicateAtom::Trait(pred, _) if !binder.has_escaping_bound_vars() => {
ty::PredicateAtom::Trait(pred, _) if !pred.has_escaping_bound_vars() => {
if pred.def_id() == sized_trait {
return None;
}