mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
iterate List by value
This commit is contained in:
parent
b3a690f5a1
commit
e820a03d1c
@ -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 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(|p| !p.is_global())
|
||||||
.filter_map(|obligation| {
|
.filter_map(|obligation| {
|
||||||
if let ty::PredicateKind::Trait(poly_trait_ref, _) = obligation.predicate.kind() {
|
if let ty::PredicateKind::Trait(poly_trait_ref, _) = obligation.predicate.kind() {
|
||||||
@ -179,7 +179,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
|
|||||||
.substs
|
.substs
|
||||||
.iter()
|
.iter()
|
||||||
.skip(1)
|
.skip(1)
|
||||||
.cloned()
|
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
implements_trait(cx, ty_empty_region, t.def_id(), ty_params)
|
implements_trait(cx, ty_empty_region, t.def_id(), ty_params)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user