about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-11-17 13:00:35 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-11-21 20:33:55 +0000
commitc7828221e3fe88d54be2c2c7d0dda226f6be60c4 (patch)
tree22fa89fa17be992fa2fec9ca906a9e0fd586c869
parent3597ed5a099488aa77caf444106a0550b7e5d2e8 (diff)
downloadrust-c7828221e3fe88d54be2c2c7d0dda226f6be60c4.tar.gz
rust-c7828221e3fe88d54be2c2c7d0dda226f6be60c4.zip
Allow iterators instead of requiring slices that will get turned into iterators
-rw-r--r--clippy_lints/src/bool_assert_comparison.rs2
-rw-r--r--clippy_lints/src/dereference.rs2
-rw-r--r--clippy_utils/src/ty.rs2
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()
         })
 }