diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2024-11-30 12:57:33 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-30 12:57:33 +0800 |
| commit | 9eeae42de250ab0d6e880e0b04d6b348b803b41e (patch) | |
| tree | c161c8ae2fd0100ffde6500b949a44946dad9e99 /tests/coverage/branch/lazy-boolean.rs | |
| parent | 1aa01927d3b8eeec06db1cd72e23b08983aa3104 (diff) | |
| parent | 4b7f56ac9dd3db6163f26ab7b5e28b55756fef79 (diff) | |
| download | rust-9eeae42de250ab0d6e880e0b04d6b348b803b41e.tar.gz rust-9eeae42de250ab0d6e880e0b04d6b348b803b41e.zip | |
Rollup merge of #132515 - kornelski:home_fix, r=jhpratt
Fix and undeprecate home_dir() `home_dir()` has been deprecated for 6 years due to using `HOME` env var on Windows. It's been a long time, and having a perpetually buggy and deprecated function in the standard library is not useful. I propose fixing and undeprecating it. 6 years seems more than long enough to warn users against relying on this function. The change in behavior is minor, and it's more of a bug fix than breakage. The old behavior is unlikely to be useful, and even if anybody actually needed to specifically use the non-standard `HOME` on Windows, they can trivially mitigate this change by reading the env var themselves. ---- Use of `USERPROFILE` is in line with the `home` crate: https://github.com/rust-lang/cargo/blob/37bc5f0232a0bb72dedd2c14149614fd8cdae649/crates/home/src/windows.rs#L12 The `home` crate uses `SHGetKnownFolderPath` instead of `GetUserProfileDirectoryW`. AFAIK it doesn't make any difference in practice, because `SHGetKnownFolderPath` merely adds support for more kinds of folders, including virtual (non-filesystem) folders identified by a GUID, but the specific case of [`FOLDERID_Profile`](https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid#FOLDERID_Profile) is documented as a FIXED folder (a regular filesystem path). Just in case, I've added a note to documentation that the use of `GetUserProfileDirectoryW` can change. I've used `CURRENT_RUSTC_VERSION` in a doccomment. `replace-version-placeholder` tool seems to perform a simple string replacement, so hopefully it'll get updated.
Diffstat (limited to 'tests/coverage/branch/lazy-boolean.rs')
0 files changed, 0 insertions, 0 deletions
