From c7828221e3fe88d54be2c2c7d0dda226f6be60c4 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 17 Nov 2022 13:00:35 +0000 Subject: [PATCH] Allow iterators instead of requiring slices that will get turned into iterators --- clippy_lints/src/bool_assert_comparison.rs | 2 +- clippy_lints/src/dereference.rs | 2 +- clippy_utils/src/ty.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/bool_assert_comparison.rs b/clippy_lints/src/bool_assert_comparison.rs index 4bd55c1429c..82d368bb8bc 100644 --- a/clippy_lints/src/bool_assert_comparison.rs +++ b/clippy_lints/src/bool_assert_comparison.rs @@ -59,7 +59,7 @@ fn is_impl_not_trait_with_bool_out(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { ) }) .map_or(false, |assoc_item| { - let proj = cx.tcx.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(ty, &[])); + let proj = cx.tcx.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(ty, [])); let nty = cx.tcx.normalize_erasing_regions(cx.param_env, proj); nty.is_bool() diff --git a/clippy_lints/src/dereference.rs b/clippy_lints/src/dereference.rs index 218dbeaddca..03d865af374 100644 --- a/clippy_lints/src/dereference.rs +++ b/clippy_lints/src/dereference.rs @@ -1263,7 +1263,7 @@ fn replace_types<'tcx>( let item_def_id = projection_predicate.projection_ty.item_def_id; let assoc_item = cx.tcx.associated_item(item_def_id); let projection = cx.tcx - .mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(new_ty, &[])); + .mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(new_ty, [])); if let Ok(projected_ty) = cx.tcx.try_normalize_erasing_regions(cx.param_env, projection) && substs[term_param_ty.index as usize] != ty::GenericArg::from(projected_ty) diff --git a/clippy_utils/src/ty.rs b/clippy_utils/src/ty.rs index 3a144c2bb22..a1698a61e60 100644 --- a/clippy_utils/src/ty.rs +++ b/clippy_utils/src/ty.rs @@ -79,7 +79,7 @@ pub fn get_associated_type<'tcx>( .associated_items(trait_id) .find_by_name_and_kind(cx.tcx, Ident::from_str(name), ty::AssocKind::Type, trait_id) .and_then(|assoc| { - let proj = cx.tcx.mk_projection(assoc.def_id, cx.tcx.mk_substs_trait(ty, &[])); + let proj = cx.tcx.mk_projection(assoc.def_id, cx.tcx.mk_substs_trait(ty, [])); cx.tcx.try_normalize_erasing_regions(cx.param_env, proj).ok() }) }