about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-07 01:51:08 +0000
committerbors <bors@rust-lang.org>2018-07-07 01:51:08 +0000
commit99b0ddb88a3e6aa5ddec35961be845ff361d031e (patch)
treebacb0edd7e7d7a33f43b14a12213d16ad0141998 /src/rustllvm/PassWrapper.cpp
parenta178cba9f1be1dc5f9da47a9ed5d291c19821aab (diff)
parent0afc16a03942931254c05846f60f3afa00d147c3 (diff)
downloadrust-99b0ddb88a3e6aa5ddec35961be845ff361d031e.tar.gz
rust-99b0ddb88a3e6aa5ddec35961be845ff361d031e.zip
Auto merge of #51656 - soc:topic/fix-home-dir, r=SimonSapin
Deprecate `std::env::home_dir` and fix incorrect documentation

Compare `std::env::home_dir`s claim:

> Returns the value of the 'HOME' environment variable if it is set and not equal to the empty string.

... with its actual behavior:

```
std::env::set_var("HOME", "");
println!("{:?}", std::env::var_os("HOME")); // Some("")
println!("{:?}", std::env::home_dir());     // Some("")
```

The implementation is incorrect in two cases:
- `$HOME` is set, but empty.
- An entry for the user exists in `/etc/passwd`, but it's `pw_dir` is empty.

In both cases Rust considers an empty string to be a valid home directory. This contradicts the documentation, and is wrong in general.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions