emit_wrapper_file in rustc_metadata::fs - Rust
Description: We use a temp directory here to avoid races between concurrent rustc processes, such as builds in the same directory using the same filename for metadata while building an `.rlib` (stomping over one another), or writing an `.rmeta` into a directory being searched for `extern crate` (observing an incomplete file). The returned path is the temporary file containing the complete metadata.

Skip to main content

## emit_wrapper_file

# Function emit_wrapper_file

Source

    pub fn emit_wrapper_file(
        sess: &Session,
        data: &[u8],
        tmpdir: &Path,
        name: &str,
    ) -> PathBuf

Expand description

We use a temp directory here to avoid races between concurrent rustc processes, such as builds in the same directory using the same filename for metadata while building an `.rlib` (stomping over one another), or writing an `.rmeta` into a directory being searched for `extern crate` (observing an incomplete file). The returned path is the temporary file containing the complete metadata.