Skip to content

Commit ed1305d

Browse files
committed
fix fn read_path_from_wide_str
1 parent a458cf3 commit ed1305d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shims/os_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
237237
let this = self.eval_context_ref();
238238
let os_str = this.read_os_str_from_wide_str(scalar)?;
239239

240-
Ok(PathBuf::from(&convert_path_separator(Cow::Borrowed(&os_str), &this.tcx.sess.target.target.target_os, Pathconversion::TargetToHost)))
240+
Ok(convert_path_separator(Cow::Owned(os_str), &this.tcx.sess.target.target.target_os, Pathconversion::TargetToHost).into_owned().into())
241241
}
242242

243243
/// Write a Path to the machine memory (as a null-terminated sequence of bytes),

0 commit comments

Comments
 (0)