about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-05-19 13:27:49 +0200
committerRalf Jung <post@ralfj.de>2025-05-19 17:06:02 +0200
commita14e25c76832b16e48f293e8dcdd6c889e4f6402 (patch)
tree197e21b9e9dc0f0477450ebf3a5d9bdbec6b67e3
parent5f292eea6d63abbd26f1e6e00a0b8cf21d828d7d (diff)
downloadrust-a14e25c76832b16e48f293e8dcdd6c889e4f6402.tar.gz
rust-a14e25c76832b16e48f293e8dcdd6c889e4f6402.zip
windows: document that we rely on an undocumented property of GetUserProfileDirectoryW
-rw-r--r--library/std/src/sys/pal/windows/os.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/sys/pal/windows/os.rs b/library/std/src/sys/pal/windows/os.rs
index f331282d2d7..1ebbbec9e91 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<PathBuf> {
             |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,