From 5328b5d6670a387a4c0f06404e476570ee739c63 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sun, 9 Feb 2020 15:31:47 +0700 Subject: [PATCH] Rustup "index ReEmpty by universe" --- clippy_lints/src/needless_pass_by_value.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index b23e26b7558..0e844b92071 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -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 @@ -180,8 +181,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue { .skip(1) .cloned() .collect::>(); - 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) + }) + }, ) };