about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-02-16 16:27:05 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-02-17 22:24:34 +1100
commita3837c6bd8476828f92a71366f422f9833ef65a7 (patch)
treee3f8bb2118d8959cb94582e85b70df399f4f4965
parentae12b7238ebb2a0400cee54f91cc9109696dfb30 (diff)
downloadrust-a3837c6bd8476828f92a71366f422f9833ef65a7.tar.gz
rust-a3837c6bd8476828f92a71366f422f9833ef65a7.zip
Replace more `mk_foo` calls with `infer_foo`.
-rw-r--r--clippy_lints/src/redundant_slicing.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/clippy_lints/src/redundant_slicing.rs b/clippy_lints/src/redundant_slicing.rs
index 245a02ea26e..398329e455b 100644
--- a/clippy_lints/src/redundant_slicing.rs
+++ b/clippy_lints/src/redundant_slicing.rs
@@ -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
@@ -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;