Uh oh!
There was an error while loading. Please reload this page.
Allow foo.rs to be parent to foo/bar.rs - #39702
Conversation
rust-highfive
commented
Feb 9, 2017
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
Not sure if this needs an RFC or not.
#[path="fragments.rs"]mod fragments;
EDIT: Fixed this. |
withoutboats
commented
Feb 9, 2017
Talked with the lang team, we agreed that this needs an RFC. I'll write one. |
88f82fa to
6b276c7Comparewithoutboats
commented
Feb 10, 2017
Question for the RFC - Consider this code: // src/lib.rs#[path="bar.rs"]mod foo;// src/bar.rs (the `foo` module)mod baz;Should the My inclination is to search at |
codyps
commented
Feb 10, 2017
On the paths: unless there is an existing example otherwise, it probably makes sense to keep them as being relative to the directory containing the file which contains the |
KalitaAlexey
commented
Feb 10, 2017
I'd like to say against this feature because it adds complexity without any benefits. |
codyps
commented
Feb 10, 2017
I don't mind it so much: it could make moving from a single-file module ( |
withoutboats
commented
Feb 10, 2017
The way the path attribute is parsed can't change. The question is whether path'd modules have submodules at the subdirectory matching their module name or their path name. |
codyps
commented
Feb 10, 2017
Ah yes, I see what you were getting at. In that case, your suggestion sounds reasonable. |
Prior to this commit, in order for a module to have submodules, it had to be at the `/foo/mod.rs` filepath. After this commit, moudles at the `/foo.rs` filepath have submodules located in the `/foo/` directory.
6b276c7 to
de2070bComparewithoutboats
commented
Feb 11, 2017
After considering all the cases, what this implements (and the RFC will propose) is that a path attribute will contain submodules using these rules:
Again this only applies to modules at |
nagisa
commented
Feb 11, 2017
Take arbitrary stance in the RFC and pose this question in the RFC’s unresolved questions section. |
bors
commented
Feb 21, 2017
☔ The latest upstream changes (presumably #39765) made this pull request unmergeable. Please resolve the merge conflicts. |
pnkfelix
commented
Mar 6, 2017
@withoutboats any update on the status of the RFC being drafted? Should I close this PR in the meantime? |
withoutboats
commented
Mar 6, 2017
Yea I'll close this for now. Hope to get back to the RFC in the next few weeks. |
Prior to this commit, in order for a module to have submodules, it had
to be at the
/foo/mod.rsfilepath. After this commit, modules at the/foo.rsfilepath have submodules located in the/foo/directory.