File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -1831,7 +1831,7 @@ An item usage is ambiguous.
18311831
18321832Erroneous code example:
18331833
1834- ```compile_fail,E0659
1834+ ```compile_fail,edition2018, E0659
18351835pub mod moon {
18361836 pub fn foo() {}
18371837}
@@ -1841,12 +1841,12 @@ pub mod earth {
18411841}
18421842
18431843mod collider {
1844- pub use moon::*;
1845- pub use earth::*;
1844+ pub use crate:: moon::*;
1845+ pub use crate:: earth::*;
18461846}
18471847
18481848fn main() {
1849- collider::foo(); // ERROR: `foo` is ambiguous
1849+ crate:: collider::foo(); // ERROR: `foo` is ambiguous
18501850}
18511851```
18521852
@@ -1858,7 +1858,7 @@ functions collide.
18581858To solve this error, the best solution is generally to keep the path before the
18591859item when using it. Example:
18601860
1861- ```
1861+ ```edition2018
18621862pub mod moon {
18631863 pub fn foo() {}
18641864}
@@ -1868,13 +1868,13 @@ pub mod earth {
18681868}
18691869
18701870mod collider {
1871- pub use moon;
1872- pub use earth;
1871+ pub use crate:: moon;
1872+ pub use crate:: earth;
18731873}
18741874
18751875fn main() {
1876- collider::moon::foo(); // ok!
1877- collider::earth::foo(); // ok!
1876+ crate:: collider::moon::foo(); // ok!
1877+ crate:: collider::earth::foo(); // ok!
18781878}
18791879```
18801880"## ,
You can’t perform that action at this time.
0 commit comments