From: bors Date: Fri, 27 Mar 2020 19:38:41 +0000 (+0000) Subject: Auto merge of #1225 - JOE1994:rw_widestr, r=RalfJung X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=01bc08a3720f0d046af3f098fc70c4fae99cb01e;p=rust.git Auto merge of #1225 - JOE1994:rw_widestr, r=RalfJung Add shims for env var emulation in Windows This PR attempts to implement the final step of the instructions laid out in https://github.com/rust-lang/miri/issues/707#issuecomment-561564057 , and is yet a work in progress. ### STATUS - [x] Add general **_target_** methods for **read_str/alloc_str** that dispatch to either **c_str** or **wide_str** variants (**helpers.rs**) - [x] Implement shims `fn getenvironmentvariablew`/`fn setenvironmentvariablew` (`std::env::var()`, `std::env::set_var()`) - [x] Implement shim `GetEnvironmentStringsW` (`std::env::vars()`) - [x] Implement shim `FreeEnvironmentStringsW` ### ISSUES (updated on 03/21/2020) - MIRI errors while running `std::env::remove_var()` in Windows. MIRI complaining about raw pointer usage in Rust standard library [*src/libstd/sys/windows/os.rs*](https://github.com/rust-lang/miri/pull/1225#issuecomment-602100146). ### TODO (probably on a separate PR) - Move string helpers into a new file to avoid bloating **src/helpers.rs** too much. (**shims/os_str.rs**) --- 01bc08a3720f0d046af3f098fc70c4fae99cb01e