Skip to content

Commit 7f132e8

Browse files
committed
Auto merge of rust-lang#116144 - lcnr:subst-less, r=oli-obk
subst -> instantiate continues rust-lang#110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
2 parents 772296c + f2efdba commit 7f132e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/methods/unnecessary_to_owned.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
401401
= get_callee_generic_args_and_args(cx, parent_expr)
402402
{
403403
// FIXME: the `instantiate_identity()` below seems incorrect, since we eventually
404-
// call `tcx.try_subst_and_normalize_erasing_regions` further down
404+
// call `tcx.try_instantiate_and_normalize_erasing_regions` further down
405405
// (i.e., we are explicitly not in the identity context).
406406
let fn_sig = cx.tcx.fn_sig(callee_def_id).instantiate_identity().skip_binder();
407407
if let Some(arg_index) = recv.into_iter().chain(call_args).position(|arg| arg.hir_id == expr.hir_id)
@@ -452,7 +452,7 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
452452

453453
let output_ty = fn_sig.output();
454454
if output_ty.contains(*param_ty) {
455-
if let Ok(new_ty) = cx.tcx.try_subst_and_normalize_erasing_regions(
455+
if let Ok(new_ty) = cx.tcx.try_instantiate_and_normalize_erasing_regions(
456456
new_subst, cx.param_env, EarlyBinder::bind(output_ty)) {
457457
expr = parent_expr;
458458
ty = new_ty;

0 commit comments

Comments
 (0)