On 01/12/2013 10:53 PM, John Clements wrote:
In the file rust/src/libsyntax/syntax.rc, I see this code:

mod print {
     #[legacy_exports];
     #[legacy_exports]
     mod pp;
     #[legacy_exports]
     mod pprust;
}

Is there any significance to the repetition of the #[legacy_exports] 
declaration before 'mod pp;'?

John Clements

There is! Attributes can be applied either to the outside of elements or the inside. The first `#[legacy_exports];` is applying itself to `mod print`, as indicated by the semicolon, and the second to `mod pp`. These attributes were added by a script - a person probably wouldn't write them that way. This semicolon distinction is oft-maligned.

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to