Skip to content

Commit bdd680f

Browse files
committed
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).
1 parent e2014e8 commit bdd680f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_session/src/filesearch.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ fn current_dll_path() -> Result<PathBuf, String> {
168168
Ok(OsString::from_wide(&filename).into())
169169
}
170170

171+
#[cfg(target_os = "wasi")]
172+
fn current_dll_path() -> Result<PathBuf, String> {
173+
Err("current_dll_path is not supported on WASI".to_string())
174+
}
175+
171176
pub fn sysroot_candidates() -> SmallVec<[PathBuf; 2]> {
172177
let target = crate::config::host_tuple();
173178
let mut sysroot_candidates: SmallVec<[PathBuf; 2]> = smallvec![get_or_default_sysroot()];

0 commit comments

Comments
 (0)