@@ -206,6 +206,11 @@ mod submodule {
206
206
}
207
207
```
208
208
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
+
209
214
### No more ` mod.rs `
210
215
211
216
In Rust 2015, if you have a submodule:
@@ -272,7 +277,7 @@ enough to have submodules.
272
277
In Rust 2018, paths in ` use ` declarations and in other code work the same way,
273
278
both in the top-level module and in any submodule. You can use a relative path
274
279
from 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 ` .
276
281
277
282
Code that looked like this:
278
283
@@ -371,9 +376,3 @@ mod submodule {
371
376
372
377
This makes it easy to move code around in a project, and avoids introducing
373
378
additional 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