Skip to content

Commit

Permalink
fix ICE in unnecessary_mut_passed
Browse files Browse the repository at this point in the history
  • Loading branch information
lapla-cogito committed Jan 23, 2025
1 parent 396de57 commit ac87b0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clippy_lints/src/mut_reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryMutPassed {
);
}
},
ExprKind::MethodCall(path, receiver, arguments, _) => {
let def_id = cx.typeck_results().type_dependent_def_id(e.hir_id).unwrap();
ExprKind::MethodCall(path, receiver, arguments, _)
if let Some(def_id) = cx.typeck_results().type_dependent_def_id(e.hir_id) =>
{
let args = cx.typeck_results().node_args(e.hir_id);
let method_type = cx.tcx.type_of(def_id).instantiate(cx.tcx, args);
check_arguments(
Expand Down

0 comments on commit ac87b0c

Please sign in to comment.