We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e6320f commit 4eea02eCopy full SHA for 4eea02e
tests/run-pass/fs.rs
@@ -29,7 +29,19 @@ fn main() {
29
}
30
31
fn tmp() -> PathBuf {
32
- std::env::var("MIRI_TEMP").map(PathBuf::from).unwrap_or_else(|_| std::env::temp_dir())
+ std::env::var("MIRI_TEMP")
33
+ .map(|tmp| {
34
+ // MIRI_TEMP is set outside of our emulated
35
+ // program, so it may have path separators that don't
36
+ // correspond to our target platform. We normalize them here
37
+ // before constructing a `PathBuf`
38
+
39
+ #[cfg(windows)]
40
+ return PathBuf::from(tmp.replace("/", "\\"));
41
42
+ #[cfg(not(windows))]
43
+ return PathBuf::from(tmp.replace("\\", "/"));
44
+ }).unwrap_or_else(|_| std::env::temp_dir())
45
46
47
/// Prepare: compute filename and make sure the file does not exist.
0 commit comments