Skip to content

Commit 5328b5d

Browse files
committed
Rustup "index ReEmpty by universe"
1 parent 4ad6fb3 commit 5328b5d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clippy_lints/src/needless_pass_by_value.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
170170

171171
(
172172
preds.iter().any(|t| t.def_id() == borrow_trait),
173-
!preds.is_empty()
174-
&& preds.iter().all(|t| {
173+
!preds.is_empty() && {
174+
let ty_empty_region = cx.tcx.mk_imm_ref(&RegionKind::ReEmpty(ty::UniverseIndex::ROOT), ty);
175+
preds.iter().all(|t| {
175176
let ty_params = &t
176177
.skip_binder()
177178
.trait_ref
@@ -180,8 +181,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
180181
.skip(1)
181182
.cloned()
182183
.collect::<Vec<_>>();
183-
implements_trait(cx, cx.tcx.mk_imm_ref(&RegionKind::ReEmpty, ty), t.def_id(), ty_params)
184-
}),
184+
implements_trait(cx, ty_empty_region, t.def_id(), ty_params)
185+
})
186+
},
185187
)
186188
};
187189

0 commit comments

Comments
 (0)