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 upShould modules with path attribute become directory owners automatically? #32401
Comments
This comment has been minimized.
This comment has been minimized.
|
No matter what we decide here, I think its important that the following variation continue to work: // main.rs
#[path = "foo.rs"]
mod foo;
fn main() {}
// foo.rs
#[path = "bar.rs"]
mod bar;
// bar.rs
// emptyThat is, if the developer cares enough about their existing directory layout that they are willing to add (I don't have a strong opinion about disallowing the second form in the issue description.) |
pnkfelix
added
the
T-lang
label
Mar 21, 2016
This comment has been minimized.
This comment has been minimized.
|
triage: I-nominated |
rust-highfive
added
the
I-nominated
label
Mar 21, 2016
This comment has been minimized.
This comment has been minimized.
|
Why |
This comment has been minimized.
This comment has been minimized.
|
I think the answer is that we should not accept this. If a module has a path attribute, it should be a directory owner if the path is a |
This comment has been minimized.
This comment has been minimized.
|
Discussed in @rust-lang/lang. Note that if we stop allowing out-of-line submodules from arbitrary named files, a warning period would be required. |
This comment has been minimized.
This comment has been minimized.
|
triage: P-medium This doesn't feel super urgent. If we end up keeping the current behavior, we can live with it. |
rust-highfive
added
P-medium
and removed
I-nominated
labels
Mar 24, 2016
This comment has been minimized.
This comment has been minimized.
|
@KalitaAlexey while it should probably be avoided if possible, |
This comment has been minimized.
This comment has been minimized.
|
@Aatch Could you please describe situation when |
This comment has been minimized.
This comment has been minimized.
|
@KalitaAlexey for example stdlib uses path in conjunction with |
brson
added
I-needs-decision
A-parser
E-easy
E-help-wanted
labels
Nov 3, 2016
This comment has been minimized.
This comment has been minimized.
|
Help wanted. Just change the parser to disallow the behavior in the OP, add a compile-fail test. We will need to run it through crater to see if anybody depends on this, and maybe have a deprecation period. If people do depend on it, let's just add a test to the test suite and call it expected behavior. |
This comment has been minimized.
This comment has been minimized.
|
@jseyfried nice papercut |
brson
added
I-papercut
and removed
I-needs-decision
labels
Nov 3, 2016
jseyfried
self-assigned this
Nov 3, 2016
jseyfried
referenced this issue
Nov 5, 2016
Merged
parser: simplify directory ownership semantics #37602
This comment has been minimized.
This comment has been minimized.
|
Fixed in #37602. |
bors
added a commit
that referenced
this issue
Nov 22, 2016
bors
closed this
in
#37602
Nov 22, 2016
This comment has been minimized.
This comment has been minimized.
briansmith
commented
Nov 29, 2016
Now how do you create a module in a file that isn't named |
matklad commentedMar 21, 2016
Consider this layout
It generates
cannot declare a new module at this locationerror formod bar;, which is good.However, If I explicitly specify
#[path = ]formod foo;it compiles:I don't know if this is expected behavior or not, but it looks suspicious to me .