mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 08:30:45 +00:00
Rustup "index ReEmpty by universe"
This commit is contained in:
parent
4ad6fb3fb0
commit
5328b5d667
1 changed files with 6 additions and 4 deletions
|
@ -170,8 +170,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
|
||||||
|
|
||||||
(
|
(
|
||||||
preds.iter().any(|t| t.def_id() == borrow_trait),
|
preds.iter().any(|t| t.def_id() == borrow_trait),
|
||||||
!preds.is_empty()
|
!preds.is_empty() && {
|
||||||
&& preds.iter().all(|t| {
|
let ty_empty_region = cx.tcx.mk_imm_ref(&RegionKind::ReEmpty(ty::UniverseIndex::ROOT), ty);
|
||||||
|
preds.iter().all(|t| {
|
||||||
let ty_params = &t
|
let ty_params = &t
|
||||||
.skip_binder()
|
.skip_binder()
|
||||||
.trait_ref
|
.trait_ref
|
||||||
|
@ -180,8 +181,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
|
||||||
.skip(1)
|
.skip(1)
|
||||||
.cloned()
|
.cloned()
|
||||||
.collect::<Vec<_>>();
|
.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)
|
||||||
}),
|
})
|
||||||
|
},
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue