Skip to content

Commit

Permalink
Auto merge of #5149 - lzutao:rustup-65232, r=flip1995
Browse files Browse the repository at this point in the history
Rustup "index ReEmpty by universe"

cc rust-lang/rust#65232

changelog: none
  • Loading branch information
bors committed Feb 9, 2020
2 parents 4ad6fb3 + 5328b5d commit 2d9ef4e
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 2d9ef4e

Please sign in to comment.