Skip to content

Commit c529b70

Browse files
authored
Fix ICE in unnecessary_mut_passed (#14065)
fix #12171 changelog: none
2 parents 33394d2 + ac87b0c commit c529b70

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_lints/src/mut_reference.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryMutPassed {
5454
);
5555
}
5656
},
57-
ExprKind::MethodCall(path, receiver, arguments, _) => {
58-
let def_id = cx.typeck_results().type_dependent_def_id(e.hir_id).unwrap();
57+
ExprKind::MethodCall(path, receiver, arguments, _)
58+
if let Some(def_id) = cx.typeck_results().type_dependent_def_id(e.hir_id) =>
59+
{
5960
let args = cx.typeck_results().node_args(e.hir_id);
6061
let method_type = cx.tcx.type_of(def_id).instantiate(cx.tcx, args);
6162
check_arguments(

0 commit comments

Comments
 (0)