@@ -206,6 +206,11 @@ mod submodule {
206206}
207207```
208208
209+ If you have a local module or item with the same name as an external crate, a
210+ path begining with that name will be taken to refer to the local module or
211+ item. To explicitly refer to the external crate, use the ` ::name ` form.
212+
213+
209214### No more ` mod.rs `
210215
211216In Rust 2015, if you have a submodule:
@@ -272,7 +277,7 @@ enough to have submodules.
272277In Rust 2018, paths in ` use ` declarations and in other code work the same way,
273278both in the top-level module and in any submodule. You can use a relative path
274279from the current scope, a path starting from an external crate name, or a path
275- starting with ` crate ` , ` super ` , or ` self ` .
280+ starting with ` :: ` , ` crate ` , ` super ` , or ` self ` .
276281
277282Code that looked like this:
278283
@@ -371,9 +376,3 @@ mod submodule {
371376
372377This makes it easy to move code around in a project, and avoids introducing
373378additional complexity to multi-module projects.
374-
375- If a path is ambiguous, such as if you have an external crate and a local
376- module or item with the same name, you'll get an error, and you'll need to
377- either rename one of the conflicting names or explicitly disambiguate the path.
378- To explicitly disambiguate a path, use ` ::name ` for an external crate name, or
379- ` self::name ` for a local module or item.
0 commit comments