Skip to content

Please reconsider endorsing dirs and deprecating std::env::home_dir #71684

Closed
@Xaeroxe

Description

@Xaeroxe

(Link for convenience: https://doc.rust-lang.org/std/env/fn.home_dir.html)

Recommending a user library in favor of the standard library is not an action without precedent.

However in this instance I think it's unwise. The author of dirs has made it clear they are not interested in providing the level and variety of support expected by users of the Rust std library.

What I, and I suspect most of the Rust community, would prefer is fixing the behavior of std::env::home_dir, and bringing it back from deprecation. Choosing to deprecate it and recommend another crate implies that someone could be relying on the current incorrect behavior of std::env::home_dir. Do we have any reason to believe someone is relying on that behavior? Is there room for disagreement as to what correct behavior is? My own review of the discussion surrounding this didn't seem to ask those questions and just deprecated it seemingly without questioning that.

If nothing else, at this point it seems wise to remove the recommendation of the dirs crate, even if rust-lang wants to leave the deprecation intact. EDIT: Removing the recommendation has been done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-processArea: `std::process` and `std::env`C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions