@@ -608,20 +608,16 @@ impl Error for JoinPathsError {
608
608
///
609
609
/// # Windows
610
610
///
611
- /// - Returns the value of the 'HOME' environment variable if it is set
612
- /// (including to an empty string).
613
- /// - Otherwise, returns the value of the 'USERPROFILE' environment variable if it is set
614
- /// (including to an empty string).
615
- /// - If both do not exist, [`GetUserProfileDirectory`][msdn] is used to return the path.
611
+ /// - Returns the value of the 'USERPROFILE' environment variable if it is set, and is not an empty string.
612
+ /// - Otherwise, [`GetUserProfileDirectory`][msdn] is used to return the path. This may change in the future.
616
613
///
617
614
/// [msdn]: https://docs.microsoft.com/en-us/windows/win32/api/userenv/nf-userenv-getuserprofiledirectorya
618
615
///
619
- /// # Deprecation
616
+ /// In UWP (Universal Windows Platform) targets this function is unimplemented and always returns `None`.
620
617
///
621
- /// This function is deprecated because the behavior on Windows is not correct.
622
- /// The 'HOME' environment variable is not standard on Windows, and may not produce
623
- /// desired results; for instance, under Cygwin or Mingw it will return `/home/you`
624
- /// when it should return `C:\Users\you`.
618
+ /// Before Rust CURRENT_RUSTC_VERSION, this function used to return the value of the 'HOME' environment variable
619
+ /// on Windows, which in Cygwin or Mingw environments could return non-standard paths like `/home/you`
620
+ /// instead of `C:\Users\you`.
625
621
///
626
622
/// # Examples
627
623
///
@@ -633,11 +629,6 @@ impl Error for JoinPathsError {
633
629
/// None => println!("Impossible to get your home dir!"),
634
630
/// }
635
631
/// ```
636
- #[ deprecated(
637
- since = "1.29.0" ,
638
- note = "This function's behavior may be unexpected on Windows. \
639
- Consider using a crate from crates.io instead."
640
- ) ]
641
632
#[ must_use]
642
633
#[ stable( feature = "env" , since = "1.0.0" ) ]
643
634
pub fn home_dir ( ) -> Option < PathBuf > {
0 commit comments