Skip to content

Commit 1e9e822

Browse files
committed
Cleanups
1 parent 14041ff commit 1e9e822

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
@@ -643,7 +643,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
643643
);
644644
};
645645

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

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

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

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

0 commit comments

Comments
 (0)