Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better documentation for env::home_dir()'s broken behaviour #101648

Merged
merged 2 commits into from
Dec 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion library/std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,13 @@ impl Error for JoinPathsError {
///
/// [msdn]: https://docs.microsoft.com/en-us/windows/win32/api/userenv/nf-userenv-getuserprofiledirectorya
///
/// # Deprecation
///
/// This function is deprecated because the behaviour on Windows is not correct.
/// The 'HOME' environment variable has no meaning on Windows so it should not
/// be checked. This result is that under Cygwin or Mingw it will return `/home/you`
/// when it should return `C:\Users\you`.
Timmmm marked this conversation as resolved.
Show resolved Hide resolved
///
/// # Examples
///
/// ```
Expand All @@ -582,7 +589,7 @@ impl Error for JoinPathsError {
/// ```
#[deprecated(
since = "1.29.0",
note = "This function's behavior is unexpected and probably not what you want. \
note = "This function's behavior may be unexpected on Windows. \
joshtriplett marked this conversation as resolved.
Show resolved Hide resolved
Consider using a crate from crates.io instead."
)]
#[must_use]
Expand Down