On 13-08-05 08:06 PM, Brendan Zabarauskas wrote:
> That was my understanding. Without knowing much about the compiler, `mod`
> seems to declare an item. It would be weird to allow imports between item
> declarations.
Yes. 'mod foo' is a definition just like 'mod foo { ... }' and will
shadow any 'use' directive. As a result of this shadowing relationship,
we decided to mandate that the definitions come after the
things-they-shadow. It used to be possible to mix them freely and it was
confusing to see a definition _before_ a 'use' still shadowing it.
(People have spatial / order intuitions about shadowing, when it exists)
-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev