fn get_rustc_linker() -> Result<PathBuf> {
    // `RUSTC_LINKER` is set if the linker has been overridden anywhere.
    if let Ok(link) = std::env::var("RUSTC_LINKER") {
        return Ok(link.into());
    }

    let link = cc::windows_registry::find_tool(
        &std::env::var("TARGET").context("`TARGET` environment variable not set")?,
        "link.exe",
    )
    .context("Failed to retrieve linker tool")?;
    Ok(link.path().to_owned())
}
Returns the path to rustc's linker.
windows_build.rs