fn report_const_call_targets(loader: &Loader, report_path: &Path) {
    let const_calls_map: HashMap<_, _> = loader
        .load_terminators_call_const_target()
        .iter()
        .cloned()
        .collect();
    let def_path_resolver = DefPathResolver::new(loader);
    let build_resolver = BuildResolver::new(loader);
    let strings = loader.load_strings();
    let abis = loader.load_abis();
    let unsafe_block_calls = loader.load_unsafe_block_calls();
    let const_calls = unsafe_block_calls.iter().flat_map(
        |(build, block, unsafe_scope, check_mode, call, unsafety, abi, _return_ty)| {
            const_calls_map.get(call).map(|def_path| {
                Some((
                    build,
                    build_resolver.resolve(*build),
                    def_path_resolver.resolve(*def_path),
                    block,
                    unsafe_scope,
                    check_mode.to_string(),
                    call,
                    unsafety.to_string(),
                    strings[abis[*abi]].to_string(),
                ))
            })
        },
    );
    write_csv!(report_path, const_calls);
    info!("reported const_call_targets");
}
/// Find all calls in unsafe functions that call constant targets. The call
/// targets that appear as constants:
///
/// 1. Static function calls.
/// 2. Static method calls.
/// 3. Dynamic calls on trait objects.
/// 4. Calls of closures.
Find all calls in unsafe functions that call constant targets. The call
targets that appear as constants.

1. Static function calls.
2. Static method calls.
3. Dynamic calls on trait objects.
4. Calls of closures.
Find all calls in unsafe functions that call constant targets . The call targets that appear as constants . 1 . Static function calls . 2 . Static method calls . 3 . Dynamic calls on trait objects . 4 . Calls of closures .
fn report_const_call_targets(loader: &Loader, report_path: &Path) {
    let const_calls_map: HashMap<_, _> = loader
        .load_terminators_call_const_target()
        .iter()
        .cloned()
        .collect();
    let def_path_resolver = DefPathResolver::new(loader);
    let build_resolver = BuildResolver::new(loader);
    let strings = loader.load_strings();
    let abis = loader.load_abis();
    let unsafe_block_calls = loader.load_unsafe_block_calls();
    let const_calls = unsafe_block_calls.iter().flat_map(
        |(build, block, unsafe_scope, check_mode, call, unsafety, abi, _return_ty)| {
            const_calls_map.get(call).map(|def_path| {
                Some((
                    build,
                    build_resolver.resolve(*build),
                    def_path_resolver.resolve(*def_path),
                    block,
                    unsafe_scope,
                    check_mode.to_string(),
                    call,
                    unsafety.to_string(),
                    strings[abis[*abi]].to_string(),
                ))
            })
        },
    );
    write_csv!(report_path, const_calls);
    info!("reported const_call_targets");
}
fn report_const_call_targets ( loader : & Loader , report_path : & Path ) { let const_calls_map : HashMap < _ , _ > = loader . load_terminators_call_const_target ( ) . iter ( ) . cloned ( ) . collect ( ) ; let def_path_resolver = DefPathResolver :: new ( loader ) ; let build_resolver = BuildResolver :: new ( loader ) ; let strings = loader . load_strings ( ) ; let abis = loader . load_abis ( ) ; let unsafe_block_calls = loader . load_unsafe_block_calls ( ) ; let const_calls = unsafe_block_calls . iter ( ) . flat_map ( | ( build , block , unsafe_scope , check_mode , call , unsafety , abi , _return_ty ) | { const_calls_map . get ( call ) . map ( | def_path | { Some ( ( build , build_resolver . resolve ( * build ) , def_path_resolver . resolve ( * def_path ) , block , unsafe_scope , check_mode . to_string ( ) , call , unsafety . to_string ( ) , strings [ abis [ * abi ] ] . to_string ( ) , ) ) } ) } , ) ; write_csv ! ( report_path const_calls ) ; info ! ( " " ) ; }
Find all calls in unsafe functions that call constant targets.
Find all calls in unsafe functions that call constant targets .
loader
&Loader
report_path
&Path