Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up[RFC 2126] permit `foo.rs` or `foo/mod.rs` to support submodules like `foo/bar.rs` #45385
Comments
nikomatsakis
added
T-compiler
WG-compiler-front
E-needs-mentor
labels
Oct 19, 2017
This comment has been minimized.
This comment has been minimized.
Mentoring instructionsCurrently, when we encounter a The only place where Definition: we currently consider a This notion of ownership isn't quite what we want for Once we have this new notion of directory ownership, we can use it when finding the default path where a (In the case of our example of The only other change that should be needed is to add a feature-gate somewhere. Ordinarily, I believe the feature-gate information is not available until after parsing -- but we can presumably remember somewhere that we encountered a submodule that would previous have been illegal (e.g., (To add a new feature-gate, you can follow the directions at the end of the "So You Want To Implement a Feature" page in the forge).) |
nikomatsakis
added
E-mentor
and removed
E-needs-mentor
labels
Oct 19, 2017
aturon
referenced this issue
Oct 19, 2017
Closed
Tracking issue for RFC 2126: Clarify and streamline paths and visibility #44660
This comment has been minimized.
This comment has been minimized.
|
Hi, I'm going to try to work on this. |
This comment has been minimized.
This comment has been minimized.
|
@slo1 great! Let me know how it goes. =) A word of warning, I do try to keep up with GH comments, but faster responses can be had by sending a ping on gitter. |
This comment has been minimized.
This comment has been minimized.
|
@slo1 just checking in -- everything ok? |
This comment has been minimized.
This comment has been minimized.
|
I'm working on this. |
nikomatsakis commentedOct 19, 2017
•
edited
Ignoring "inline" modules like
mod foo { }, modules currently come in one of two forms:foo.rsfile is forced to be a leaf module. In particular, one cannot make a submodule in a file likefoo/bar.rs.foo/mod.rsfile is a directory module. One can create submodules in files likefoo/bar.rs.As part of #44660, we plan to support either of those two forms. However, the two forms should not be usable for a single module simultaneously: in other words, you can have
foo.rsorfoo/mod.rs, but not both. (One is permitted to intermingle the two forms within a single project, however.)Because the RFC has a number of moving parts, we wanted to feature-gate semi-independent features with distinct names. Therefore,
foo.rsfiles that contain submodules can be gated under the feature namemodule_flexible_submodules.(Note: Please limit discussion on this issue strictly to implementation concerns relative to this particular change. Policy discussion as to whether or not to make this change -- or whether to make other changes to the module system -- belong in #44660.)