I really like this because this achieves 1path and is very close to what I’ve proposed in The Great Module Adventure Continues, + ambiguity rules
!
Technical questions/points:
-
Am I correct that
fooandself::fooare almost equivalent?self::foowon’t work, butfooworkwill only iffoois in prelude/extern crate. -
Looks like an alternative formulation is “we add extern crates to prelude, overriding existing prelude items”.
-
After this proposal, you’ll almost never write
self::,::foo, which feels like a nice simplifications? -
Behavior with respect to
::*imports should be specified. Currently, they shadow prelude and are shadowed by anything else. -
Ambiguity rules are an interesting solution! I think it even might help with IDE performance, because you’ll be able to stop early during transitive imports resolution. However, we must specify how they work with type/value/macro namespaces? Is it an error to
use regexwhen you havefn regex()in scope as well as an theregexextern crate?