Skip to content

Commit

Permalink
Replace more mk_foo calls with infer_foo.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Feb 17, 2023
1 parent ae12b72 commit a3837c6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions clippy_lints/src/redundant_slicing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ use rustc_middle::ty::adjustment::{Adjust, AutoBorrow, AutoBorrowMutability};
use rustc_middle::ty::subst::GenericArg;
use rustc_session::{declare_lint_pass, declare_tool_lint};

use std::iter;

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

0 comments on commit a3837c6

Please sign in to comment.