Skip to content

Commit 5734b0d

Browse files
committed
Cleanups
1 parent 481dbb8 commit 5734b0d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

compiler/rustc_hir_typeck/src/callee.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
642642
);
643643
};
644644

645-
let Some(scope) = self.try_get_scope_for_call_adjustments(call_expr, arg_exprs) else {
645+
let Some(scope) = self.get_scope_for_method_call_adjustments(call_expr, arg_exprs) else {
646646
return do_check();
647647
};
648648

@@ -687,7 +687,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
687687
results.node_types_mut().insert(first_expr.hir_id, first_arg_type);
688688
}
689689

690-
fn try_get_scope_for_call_adjustments(
690+
/// Gets scope for method-call like adjustments for the first argument of the call.
691+
/// Now only delegations are processed this way.
692+
fn get_scope_for_method_call_adjustments(
691693
&self,
692694
call_expr: &'tcx hir::Expr<'tcx>,
693695
arg_exprs: &'tcx [hir::Expr<'tcx>],
@@ -706,7 +708,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
706708
let Some(path_res_id) = info.call_path_res else { return None };
707709

708710
// Check that delegation has first provided arg and that the call path
709-
// resolves to a trait method (inherent methods are not yet supported)
711+
// resolves to a trait method (inherent methods are not yet supported).
710712
if arg_exprs.is_empty()
711713
|| !self.tcx.opt_associated_item(path_res_id).is_some_and(|i| i.is_method())
712714
{

0 commit comments

Comments
 (0)