Skip to content

Commit a3837c6

Browse files
committed
Replace more mk_foo calls with infer_foo.
1 parent ae12b72 commit a3837c6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clippy_lints/src/redundant_slicing.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ use rustc_middle::ty::adjustment::{Adjust, AutoBorrow, AutoBorrowMutability};
1111
use rustc_middle::ty::subst::GenericArg;
1212
use rustc_session::{declare_lint_pass, declare_tool_lint};
1313

14-
use std::iter;
15-
1614
declare_clippy_lint! {
1715
/// ### What it does
1816
/// Checks for redundant slicing expressions which use the full range, and
@@ -136,7 +134,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantSlicing {
136134
} else if let Some(target_id) = cx.tcx.lang_items().deref_target() {
137135
if let Ok(deref_ty) = cx.tcx.try_normalize_erasing_regions(
138136
cx.param_env,
139-
cx.tcx.mk_projection(target_id, cx.tcx.mk_substs(iter::once(GenericArg::from(indexed_ty)))),
137+
cx.tcx.mk_projection(target_id, cx.tcx.intern_substs(&[GenericArg::from(indexed_ty)])),
140138
) {
141139
if deref_ty == expr_ty {
142140
let snip = snippet_with_context(cx, indexed.span, ctxt, "..", &mut app).0;

0 commit comments

Comments
 (0)