about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTim Hutt <tdhutt@gmail.com>2025-03-22 22:24:08 +0000
committerTim Hutt <tdhutt@gmail.com>2025-06-01 09:20:05 +0100
commitbdd680ffd15e5e9672d0a82e363d8193e575a132 (patch)
treeff17208ead488e236354ee1d03818515200583e3
parente2014e876e3efaa69bf51c19579adb16c3df5f81 (diff)
downloadrust-bdd680ffd15e5e9672d0a82e363d8193e575a132.tar.gz
rust-bdd680ffd15e5e9672d0a82e363d8193e575a132.zip
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).
-rw-r--r--compiler/rustc_session/src/filesearch.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/filesearch.rs b/compiler/rustc_session/src/filesearch.rs
index bdeca91eb64..cd994f2fccb 100644
--- a/compiler/rustc_session/src/filesearch.rs
+++ b/compiler/rustc_session/src/filesearch.rs
@@ -168,6 +168,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()];