resolve_chain_contracts

Function resolve_chain_contracts 

Source
fn resolve_chain_contracts<'tcx>(
    tcx: TyCtxt<'tcx>,
    callee_def_id: DefId,
    max_depth: usize,
    std_contracts: fn(TyCtxt<'tcx>, DefId) -> &'static [PropertyEntry],
) -> FnContracts<'tcx>
Expand description

Follow an unsafe callee’s call chain to find inherited safety contracts.

When an unsafe callee (e.g. B) lacks its own contracts, look into its MIR body for the unsafe callees it calls (e.g. C, D). If one of those has contracts (e.g. D), inherit them. The chain A -> B -> C -> D means A’s checkpoint on B is verified using D’s contracts.

max_depth limits recursion to avoid cycles or infinite chains.