diff options
| author | Kyle Matsuda <kyle.yoshio.matsuda@gmail.com> | 2023-05-06 22:56:51 -0600 |
|---|---|---|
| committer | Kyle Matsuda <kyle.yoshio.matsuda@gmail.com> | 2023-05-06 23:36:04 -0600 |
| commit | d27f40175fb7221bc5fa4c19ff75e211947222e8 (patch) | |
| tree | 554cdafa8fb08589596b8e1721c5516e8b5a1c90 /src | |
| parent | e4f6b8b43b6e9c0373ee45aaa7a6f3094c475137 (diff) | |
| download | rust-d27f40175fb7221bc5fa4c19ff75e211947222e8.tar.gz rust-d27f40175fb7221bc5fa4c19ff75e211947222e8.zip | |
changes from review: add FIXME to clippy and change subst_identity to skip_binder in mir subst methods
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs b/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs index 87641c686dc..67b7d3691dc 100644 --- a/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs +++ b/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs @@ -385,6 +385,9 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty< Node::Expr(parent_expr) => { if let Some((callee_def_id, call_substs, recv, call_args)) = get_callee_substs_and_args(cx, parent_expr) { + // FIXME: the `subst_identity()` below seems incorrect, since we eventually + // call `tcx.try_subst_and_normalize_erasing_regions` further down + // (i.e., we are explicitly not in the identity context). let fn_sig = cx.tcx.fn_sig(callee_def_id).subst_identity().skip_binder(); if let Some(arg_index) = recv.into_iter().chain(call_args).position(|arg| arg.hir_id == expr.hir_id) && let Some(param_ty) = fn_sig.inputs().get(arg_index) |
