Skip to content

Slash (/) in diagnostic's path on Windows #40149

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

Closed
KalitaAlexey opened this issue Feb 28, 2017 · 11 comments
Closed

Slash (/) in diagnostic's path on Windows #40149

KalitaAlexey opened this issue Feb 28, 2017 · 11 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@KalitaAlexey
Copy link
Contributor

cargo new app

src/lib.rs: mod f;

src/f/mod.rs: f

cargo build
error: expected one of `!` or `::`, found `<eof>`
 --> src\f/mod.rs:1:1

It must be src\f \ mod.rs, but it is src\f / mod.rs

src/f/mod.rs: mod g;

src/f/g/mod.rs: g

cargo build
error: expected one of `!` or `::`, found `<eof>`
 --> src\f\g/mod.rs:1:1
@retep998
Copy link
Member

Is some code in rustc somewhere hardcoding / instead of using std::path::MAIN_SEPARATOR (or just joining paths the normal way)?

@KalitaAlexey
Copy link
Contributor Author

@retep998,
Probably it is.

@steveklabnik steveklabnik added the A-diagnostics Area: Messages for errors, warnings, and lints label Mar 1, 2017
@steveklabnik steveklabnik added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 9, 2017
@steveklabnik
Copy link
Member

Seeing this myself.

@retep998
Copy link
Member

retep998 commented Mar 9, 2017

Could it be the fault of this line? https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/parser.rs#L5148

let secondary_path_str = format!("{}/mod.rs", mod_name);

@KalitaAlexey
Copy link
Contributor Author

I suppose we need to add some tests to check it.

@radix
Copy link
Contributor

radix commented Mar 16, 2017

@retep998 it's not just that, since I also see it for non-mod.rs cases.

@adchilds
Copy link

@retep998
Copy link
Member

So now someone just needs to write a PR to fix those two spots!

@retep998 retep998 added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Mar 16, 2017
@laumann
Copy link
Contributor

laumann commented Mar 17, 2017

@retep998
Copy link
Member

@laumann Yes.

@laumann
Copy link
Contributor

laumann commented Mar 18, 2017

@retep998 Included

laumann pushed a commit to laumann/rust that referenced this issue Mar 30, 2017
bors added a commit that referenced this issue Mar 31, 2017
Replace hardcoded forward slash with path::MAIN_SEPARATOR

Fixes #40149
michaelwoerister pushed a commit to michaelwoerister/rust that referenced this issue Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants