about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>2017-06-29 08:40:12 +0000
committerGitHub <noreply@github.com>2017-06-29 08:40:12 +0000
commitb0ed6d11e1a54f2f3afa2ee4f3835e87aa7ee61b (patch)
tree0313bb4a0ab1e6a01ef73e271b53f09db6d23e06 /src/libsyntax/parse
parent4f121542e92b526db18e5f6a4824d4f5c00c5284 (diff)
parent40dec0984ed2040532ac763f104b3bbbc13f514a (diff)
downloadrust-b0ed6d11e1a54f2f3afa2ee4f3835e87aa7ee61b.tar.gz
rust-b0ed6d11e1a54f2f3afa2ee4f3835e87aa7ee61b.zip
Rollup merge of #42955 - matklad:doc-path, r=steveklabnik
Document that `/` works as separator on Windows

Hi Whenever I see code like `Path::new("./src/bin/main.rs")` or `path.ends_with("foo/bar")`, I wonder if it will work on Windows as I expect. Unfortunately, reading the current docs does not help to answer this question, because all examples are Unix-specific.

However, I believe that using `/` is fine, because both Windows itself [and Rust stdlib](https://github.com/rust-lang/rust/blob/47faf1d51952ecd9d4c8a7325332fba34fbe00bd/src/libstd/sys/windows/path.rs#L26) do treat it as a file separator, and because it is [actually used](https://github.com/rust-lang/cargo/blob/abf01e1eddb3145c83f71b469ea7bee37141e5e1/tests/git.rs#L579) in Cargo. So looks like we can just document it?

r? @steveklabnik

cc @retep998 I don't actually program for windows that much, so I might be totally wrong, and perhaps we should advise to always use (allocating) `.join` method to construct paths of more than one component?
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions