resolve_callee_impl

Function resolve_callee_impl 

Source
fn resolve_callee_impl<'tcx>(
    tcx: TyCtxt<'tcx>,
    caller_def_id: DefId,
    callee_def_id: DefId,
    callee_args: GenericArgsRef<'tcx>,
) -> Option<DefId>
Expand description

Resolve a (possibly trait-method) callee to the concrete impl method that will actually be dispatched, given the caller context and the callee’s generic arguments.

This matters for contract lookup: #[rapx::requires(...)] annotations are attached to the impl method, but in a generic caller the MIR FnDef refers to the trait method declaration. Resolving to the impl method lets the verifier find those inline contracts. Returns None when the callee cannot be resolved to a distinct concrete item (e.g. still generic/virtual), in which case callers should keep the original DefId.