Skip to content

Allow inner attributes on external module declarations. #4981

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
brson opened this issue Feb 16, 2013 · 3 comments
Closed

Allow inner attributes on external module declarations. #4981

brson opened this issue Feb 16, 2013 · 3 comments
Labels
A-grammar Area: The grammar of Rust A-parser Area: The lexing & parsing of Rust source code to an AST

Comments

@brson
Copy link
Contributor

brson commented Feb 16, 2013

Directory modules currently require #[path], but the current formatting options when a bunch of these declarations appear together are not good. This is very unfortunate since these subdirectory declarations are often one of the first bits of code in a crate.

This variation is hard to read because the alternation of syntaxes between lines

#[path = "foo/foo.rs"]
mod foo;
#[path = "barkeeper/barkeeper.rs"]
mod barkeepr;
#[path = "baz/baz.rs"]
mod baz;

And this one because the mods don't line up:

#[path = "foo/foo.rs"] mod foo;
#[path = "barkeeper/barkeeper.rs"] mod barkeeper;
#[path = "baz/baz.rs"] mod baz;

This one reads a bit better but isn't possible:

mod foo #[path = "foo/foo.rs"];
mod barkeeper #[path = "barkeeper/barkeeper.rs"];
mod baz #[path = "baz/baz.rs"];

Of course this may just indicate that the way we are dealing with subdirectories is bad.

@catamorphism
Copy link
Contributor

Nominating for milestone 1, well-defined.

@brson
Copy link
Contributor Author

brson commented May 23, 2013

Still not convinced this is a good idea fwiw.

@graydon
Copy link
Contributor

graydon commented May 23, 2013

closing as WONTFIX, #4116 should solve most cases.

@graydon graydon closed this as completed May 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust A-parser Area: The lexing & parsing of Rust source code to an AST
Projects
None yet
Development

No branches or pull requests

3 participants