-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #707 (comment) , 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*](#1225 (comment)). ### 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**)
- Loading branch information
Showing
7 changed files
with
141 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
//ignore-windows: TODO env var emulation stubbed out on Windows | ||
|
||
use std::env; | ||
|
||
fn main() { | ||
|