Rollup merge of #141834 - Timmmm:user/timh/wasi, r=Noratrieb

Add unimplemented `current_dll_path()` for WASI

This is the only change needed to Rust to allow compiling rustfmt for WASI (rustfmt uses some internal rustc crates).
This commit is contained in:
Guillaume Gomez 2025-06-01 19:35:45 +02:00 committed by GitHub
commit fc32992a00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -172,6 +172,11 @@ fn current_dll_path() -> Result<PathBuf, String> {
Ok(OsString::from_wide(&filename).into())
}
#[cfg(target_os = "wasi")]
fn current_dll_path() -> Result<PathBuf, String> {
Err("current_dll_path is not supported on WASI".to_string())
}
pub fn sysroot_candidates() -> SmallVec<[PathBuf; 2]> {
let target = crate::config::host_tuple();
let mut sysroot_candidates: SmallVec<[PathBuf; 2]> = smallvec![get_or_default_sysroot()];