Relative paths in Rust 2018

This is a trade off. We trade two characters for an ability to see if the path is absolute without context.

As the difference in ergonomics is really small, I think that if ::foo::Bar is rare today (which I think is true), then foo::Bar will be rare as well.

A separate argument against extern crates in prelude: this will make code completion less useful, because it will pollute the global namespace with a lot of lowercase identifiers, which would clash with local variables. In contrast, with explicit :: prefix/imports, code completion has a much better idea of which identifiers are relevant.

13 Likes