Skip to content

Commit a05a129

Browse files
authored
Rollup merge of #90166 - smmalis37:patch-1, r=joshtriplett
Add comment documenting why we can't use a simpler solution See #90144 for context. r? ```@joshtriplett```
2 parents 1ea34fb + c736c2a commit a05a129

File tree

1 file changed

+4
-0
lines changed
  • library/std/src/sys/windows

1 file changed

+4
-0
lines changed

Diff for: library/std/src/sys/windows/os.rs

+4
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ pub fn temp_dir() -> PathBuf {
281281
#[cfg(not(target_vendor = "uwp"))]
282282
fn home_dir_crt() -> Option<PathBuf> {
283283
unsafe {
284+
// The magic constant -4 can be used as the token passed to GetUserProfileDirectoryW below
285+
// instead of us having to go through these multiple steps to get a token. However this is
286+
// not implemented on Windows 7, only Windows 8 and up. When we drop support for Windows 7
287+
// we can simplify this code. See #90144 for details.
284288
use crate::sys::handle::Handle;
285289

286290
let me = c::GetCurrentProcess();

0 commit comments

Comments
 (0)