# Function cargo::core::compiler::build_context::target_info::parse_crate_type

source ·

    fn parse_crate_type(
        crate_type: &CrateType,
        cmd: &ProcessBuilder,
        output: &str,
        error: &str,
        lines: &mut Lines<'_>
    ) -> CargoResult<Option<(String, String)>>

Expand description

Takes rustc output (using specialized command line args), and calculates the file prefix and suffix for the given crate type, or returns `None` if the type is not supported. (e.g., for a Rust library like `libcargo.rlib`, we have prefix “lib” and suffix “rlib”).

The caller needs to ensure that the lines object is at the correct line for the given crate type: this is not checked.

This function can not handle more than one file per type (with wasm32-unknown-emscripten, there are two files for bin (`.wasm` and `.js`)).