iterate List by value

This commit is contained in:
Bastian Kauschke 2020-05-23 11:49:24 +02:00
parent b3a690f5a1
commit e820a03d1c

View file

@ -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.iter().copied())
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.iter())
.filter(|p| !p.is_global())
.filter_map(|obligation| {
if let ty::PredicateKind::Trait(poly_trait_ref, _) = obligation.predicate.kind() {
@ -179,7 +179,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
.substs
.iter()
.skip(1)
.cloned()
.collect::<Vec<_>>();
implements_trait(cx, ty_empty_region, t.def_id(), ty_params)
})