From a14e25c76832b16e48f293e8dcdd6c889e4f6402 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 19 May 2025 13:27:49 +0200 Subject: [PATCH] windows: document that we rely on an undocumented property of GetUserProfileDirectoryW --- library/std/src/sys/pal/windows/os.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/std/src/sys/pal/windows/os.rs b/library/std/src/sys/pal/windows/os.rs index f331282d2d72a..1ebbbec9e914f 100644 --- a/library/std/src/sys/pal/windows/os.rs +++ b/library/std/src/sys/pal/windows/os.rs @@ -202,6 +202,8 @@ fn home_dir_crt() -> Option { |buf, mut sz| { // GetUserProfileDirectoryW does not quite use the usual protocol for // negotiating the buffer size, so we have to translate. + // FIXME(#141254): We rely on the *undocumented* property that this function will + // always set the size, not just on failure. match c::GetUserProfileDirectoryW( ptr::without_provenance_mut(CURRENT_PROCESS_TOKEN), buf,