Skip to content

Commit 3fc1155

Browse files
committed
changes from review: add FIXME to clippy and change subst_identity to skip_binder in mir subst methods
1 parent 39db64e commit 3fc1155

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clippy_lints/src/methods/unnecessary_to_owned.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
385385
Node::Expr(parent_expr) => {
386386
if let Some((callee_def_id, call_substs, recv, call_args)) = get_callee_substs_and_args(cx, parent_expr)
387387
{
388+
// FIXME: the `subst_identity()` below seems incorrect, since we eventually
389+
// call `tcx.try_subst_and_normalize_erasing_regions` further down
390+
// (i.e., we are explicitly not in the identity context).
388391
let fn_sig = cx.tcx.fn_sig(callee_def_id).subst_identity().skip_binder();
389392
if let Some(arg_index) = recv.into_iter().chain(call_args).position(|arg| arg.hir_id == expr.hir_id)
390393
&& let Some(param_ty) = fn_sig.inputs().get(arg_index)

0 commit comments

Comments
 (0)