Skip to content

Commit c782822

Browse files
committed
Allow iterators instead of requiring slices that will get turned into iterators
1 parent 3597ed5 commit c782822

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clippy_lints/src/bool_assert_comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn is_impl_not_trait_with_bool_out(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
5959
)
6060
})
6161
.map_or(false, |assoc_item| {
62-
let proj = cx.tcx.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(ty, &[]));
62+
let proj = cx.tcx.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(ty, []));
6363
let nty = cx.tcx.normalize_erasing_regions(cx.param_env, proj);
6464

6565
nty.is_bool()

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ fn replace_types<'tcx>(
12631263
let item_def_id = projection_predicate.projection_ty.item_def_id;
12641264
let assoc_item = cx.tcx.associated_item(item_def_id);
12651265
let projection = cx.tcx
1266-
.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(new_ty, &[]));
1266+
.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(new_ty, []));
12671267

12681268
if let Ok(projected_ty) = cx.tcx.try_normalize_erasing_regions(cx.param_env, projection)
12691269
&& substs[term_param_ty.index as usize] != ty::GenericArg::from(projected_ty)

clippy_utils/src/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub fn get_associated_type<'tcx>(
7979
.associated_items(trait_id)
8080
.find_by_name_and_kind(cx.tcx, Ident::from_str(name), ty::AssocKind::Type, trait_id)
8181
.and_then(|assoc| {
82-
let proj = cx.tcx.mk_projection(assoc.def_id, cx.tcx.mk_substs_trait(ty, &[]));
82+
let proj = cx.tcx.mk_projection(assoc.def_id, cx.tcx.mk_substs_trait(ty, []));
8383
cx.tcx.try_normalize_erasing_regions(cx.param_env, proj).ok()
8484
})
8585
}

0 commit comments

Comments
 (0)