Skip to content

Commit

Permalink
Rustup "index ReEmpty by universe"
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Feb 9, 2020
1 parent 4ad6fb3 commit 5328b5d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions clippy_lints/src/needless_pass_by_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {

(
preds.iter().any(|t| t.def_id() == borrow_trait),
!preds.is_empty()
&& preds.iter().all(|t| {
!preds.is_empty() && {
let ty_empty_region = cx.tcx.mk_imm_ref(&RegionKind::ReEmpty(ty::UniverseIndex::ROOT), ty);
preds.iter().all(|t| {
let ty_params = &t
.skip_binder()
.trait_ref
Expand All @@ -180,8 +181,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
.skip(1)
.cloned()
.collect::<Vec<_>>();
implements_trait(cx, cx.tcx.mk_imm_ref(&RegionKind::ReEmpty, ty), t.def_id(), ty_params)
}),
implements_trait(cx, ty_empty_region, t.def_id(), ty_params)
})
},
)
};

Expand Down

0 comments on commit 5328b5d

Please sign in to comment.