@@ -7,13 +7,19 @@ This provides the definition of `home_dir` used by Cargo and rustup,
7
7
as well functions to find the correct value of ` CARGO_HOME ` and
8
8
` RUSTUP_HOME ` .
9
9
10
- The definition of ` home_dir ` provided by the standard library is
10
+ The definition of [ ` home_dir ` ] provided by the standard library is
11
11
incorrect because it considers the ` HOME ` environment variable on
12
12
Windows. This causes surprising situations where a Rust program will
13
13
behave differently depending on whether it is run under a Unix
14
14
emulation environment like Cygwin or MinGW. Neither Cargo nor rustup
15
15
use the standard library's definition - they use the definition here.
16
16
17
+ ** Note:** This has been fixed in Rust 1.85 to no longer use the ` HOME `
18
+ environment variable on Windows. If you are still using this crate for the
19
+ purpose of getting a home directory, you are strongly encouraged to switch to
20
+ using the standard library's [ ` home_dir ` ] instead. It is planned to have the
21
+ deprecation notice removed in 1.86.
22
+
17
23
This crate further provides two functions, ` cargo_home ` and
18
24
` rustup_home ` , which are the canonical way to determine the location
19
25
that Cargo and rustup store their data.
@@ -25,6 +31,7 @@ See [rust-lang/rust#43321].
25
31
> crate may make major changes to its APIs or be deprecated without warning.
26
32
27
33
[ rust-lang/rust#43321 ] : https://github.com/rust-lang/rust/issues/43321
34
+ [ `home_dir` ] : https://doc.rust-lang.org/nightly/std/env/fn.home_dir.html
28
35
29
36
## License
30
37
0 commit comments