Skip to content

Commit cd60231

Browse files
Instance::resolve -> Instance::try_resolve, and other nits
1 parent b5f9436 commit cd60231

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_lints/src/assigning_clones.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn extract_call<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option<
103103
let args = cx.typeck_results().node_args(expr.hir_id);
104104

105105
// If we could not resolve the method, don't apply the lint
106-
let Ok(Some(resolved_method)) = Instance::resolve(cx.tcx, cx.param_env, fn_def_id, args) else {
106+
let Ok(Some(resolved_method)) = Instance::try_resolve(cx.tcx, cx.param_env, fn_def_id, args) else {
107107
return None;
108108
};
109109
if is_trait_method(cx, expr, sym::Clone) && path.ident.name == sym::clone {
@@ -119,7 +119,7 @@ fn extract_call<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option<
119119

120120
// If we could not resolve the method, don't apply the lint
121121
let Ok(Some(resolved_method)) = (match kind {
122-
ty::FnDef(_, args) => Instance::resolve(cx.tcx, cx.param_env, fn_def_id, args),
122+
ty::FnDef(_, args) => Instance::try_resolve(cx.tcx, cx.param_env, fn_def_id, args),
123123
_ => Ok(None),
124124
}) else {
125125
return None;

clippy_lints/src/non_copy_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ impl<'tcx> NonCopyConst<'tcx> {
293293
ct: ty::UnevaluatedConst<'tcx>,
294294
span: Span,
295295
) -> EvalToValTreeResult<'tcx> {
296-
match ty::Instance::resolve(tcx, param_env, ct.def, ct.args) {
296+
match ty::Instance::try_resolve(tcx, param_env, ct.def, ct.args) {
297297
Ok(Some(instance)) => {
298298
let cid = GlobalId {
299299
instance,

0 commit comments

Comments
 (0)