fn generate_rustc_args(args: &ArgMatches) -> Vec<String> {
    let mut gotoc_args =
        rustc_gotoc_flags(&args.value_of(parser::KANI_LIB).unwrap_or(std::env!("KANI_LIB_PATH")));
    let mut rustc_args = vec![String::from("rustc")];
    if args.is_present(parser::GOTO_C) {
        rustc_args.append(&mut gotoc_args);
    }

    if args.is_present(parser::RUSTC_VERSION) {
        rustc_args.push(String::from("--version"))
    }

    if args.is_present(parser::JSON_OUTPUT) {
        rustc_args.push(String::from("--error-format=json"));
    }

    if let Some(extra_flags) = args.values_of_os(parser::RUSTC_OPTIONS) {
        extra_flags.for_each(|arg| rustc_args.push(convert_arg(arg)));
    }
    let sysroot = sysroot_path(args.value_of(parser::SYSROOT)).expect(
        "[Error] Invalid sysroot. Rebuild Kani or provide the path to rust sysroot using --sysroot option",
    );
    rustc_args.push(String::from("--sysroot"));
    rustc_args.push(convert_arg(sysroot.as_os_str()));
    tracing::debug!(?rustc_args, "Compile");
    rustc_args
}
/// Generate the arguments to pass to rustc_driver.
Generate the arguments to pass to rustc_driver.
Generate the arguments to pass to rustc_driver .
fn generate_rustc_args(args: &ArgMatches) -> Vec<String> {
    let mut gotoc_args =
        rustc_gotoc_flags(&args.value_of(parser::KANI_LIB).unwrap_or(std::env!("KANI_LIB_PATH")));
    let mut rustc_args = vec![String::from("rustc")];
    if args.is_present(parser::GOTO_C) {
        rustc_args.append(&mut gotoc_args);
    }
    if args.is_present(parser::RUSTC_VERSION) {
        rustc_args.push(String::from("--version"))
    }
    if args.is_present(parser::JSON_OUTPUT) {
        rustc_args.push(String::from("--error-format=json"));
    }
    if let Some(extra_flags) = args.values_of_os(parser::RUSTC_OPTIONS) {
        extra_flags.for_each(|arg| rustc_args.push(convert_arg(arg)));
    }
    let sysroot = sysroot_path(args.value_of(parser::SYSROOT)).expect(
        "[Error] Invalid sysroot. Rebuild Kani or provide the path to rust sysroot using --sysroot option",
    );
    rustc_args.push(String::from("--sysroot"));
    rustc_args.push(convert_arg(sysroot.as_os_str()));
    tracing::debug!(?rustc_args, "Compile");
    rustc_args
}
fn generate_rustc_args ( args : & ArgMatches ) -> Vec < String > { let mut gotoc_args = rustc_gotoc_flags ( & args . value_of ( parser :: KANI_LIB ) . unwrap_or ( std :: env ! ( " " ) ) ) ; let mut rustc_args = vec ! [ String from ( " " ) ] ; if args . is_present ( parser :: GOTO_C ) { rustc_args . append ( & mut gotoc_args ) ; } if args . is_present ( parser :: RUSTC_VERSION ) { rustc_args . push ( String :: from ( " " ) ) } if args . is_present ( parser :: JSON_OUTPUT ) { rustc_args . push ( String :: from ( " " ) ) ; } if let Some ( extra_flags ) = args . values_of_os ( parser :: RUSTC_OPTIONS ) { extra_flags . for_each ( | arg | rustc_args . push ( convert_arg ( arg ) ) ) ; } let sysroot = sysroot_path ( args . value_of ( parser :: SYSROOT ) ) . expect ( " " , ) ; rustc_args . push ( String :: from ( " " ) ) ; rustc_args . push ( convert_arg ( sysroot . as_os_str ( ) ) ) ; tracing :: debug ! ( rustc_args " " ) ; rustc_args }
Generate the arguments to pass to rustc_driver.
Generate the arguments to pass to rustc_driver .
args
&ArgMatches