Skip to content

Commit

Permalink
Rollup merge of #90166 - smmalis37:patch-1, r=joshtriplett
Browse files Browse the repository at this point in the history
Add comment documenting why we can't use a simpler solution

See #90144 for context.

r? ```@joshtriplett```
  • Loading branch information
matthiaskrgr committed Oct 23, 2021
2 parents 1ea34fb + c736c2a commit a05a129
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/std/src/sys/windows/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ pub fn temp_dir() -> PathBuf {
#[cfg(not(target_vendor = "uwp"))]
fn home_dir_crt() -> Option<PathBuf> {
unsafe {
// The magic constant -4 can be used as the token passed to GetUserProfileDirectoryW below
// instead of us having to go through these multiple steps to get a token. However this is
// not implemented on Windows 7, only Windows 8 and up. When we drop support for Windows 7
// we can simplify this code. See #90144 for details.
use crate::sys::handle::Handle;

let me = c::GetCurrentProcess();
Expand Down

0 comments on commit a05a129

Please sign in to comment.