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

Doc of std::fs::canonicalize does not correspond to behavior #54056

Closed
marcelmore opened this issue Sep 8, 2018 · 0 comments
Closed

Doc of std::fs::canonicalize does not correspond to behavior #54056

marcelmore opened this issue Sep 8, 2018 · 0 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools

Comments

@marcelmore
Copy link

The doc for canonicalize state that the function will return an error if a component in a path is not a directory.

Using canonicalize on a path with a file component does not return an error for me, e.g.

fs::canonicalize("./src/../Cargo.toml").unwrap();

works without error.

Meta

rustc 1.28.0 (9634041 2018-07-30)
binary: rustc
commit-hash: 9634041
commit-date: 2018-07-30
host: x86_64-apple-darwin
release: 1.28.0
LLVM version: 6.0

@csmoe csmoe added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Sep 8, 2018
tbu- added a commit to tbu-/rust that referenced this issue Dec 15, 2018
Point out that the final component of the path name might be a filename
(and not a directory name). Previously, the doc said that all components
of the path must be directory names, when it actually only ment all but
the final one.

Fixes rust-lang#54056.
Centril added a commit to Centril/rust that referenced this issue Dec 16, 2018
Fix doc of `std::fs::canonicalize`

Point out that the final component of the path name might be a filename
(and not a directory name). Previously, the doc said that all components
of the path must be directory names, when it actually only ment all but
the final one.

Fixes rust-lang#54056.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools
Projects
None yet
Development

No branches or pull requests

2 participants