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 @@ -1822,7 +1822,7 @@ An item usage is ambiguous.
18221822
18231823Erroneous code example:
18241824
1825- ```compile_fail,E0659
1825+ ```compile_fail,edition2018, E0659
18261826pub mod moon {
18271827 pub fn foo() {}
18281828}
@@ -1832,12 +1832,12 @@ pub mod earth {
18321832}
18331833
18341834mod collider {
1835- pub use moon::*;
1836- pub use earth::*;
1835+ pub use crate:: moon::*;
1836+ pub use crate:: earth::*;
18371837}
18381838
18391839fn main() {
1840- collider::foo(); // ERROR: `foo` is ambiguous
1840+ crate:: collider::foo(); // ERROR: `foo` is ambiguous
18411841}
18421842```
18431843
@@ -1849,7 +1849,7 @@ functions collide.
18491849To solve this error, the best solution is generally to keep the path before the
18501850item when using it. Example:
18511851
1852- ```
1852+ ```edition2018
18531853pub mod moon {
18541854 pub fn foo() {}
18551855}
@@ -1859,13 +1859,13 @@ pub mod earth {
18591859}
18601860
18611861mod collider {
1862- pub use moon;
1863- pub use earth;
1862+ pub use crate:: moon;
1863+ pub use crate:: earth;
18641864}
18651865
18661866fn main() {
1867- collider::moon::foo(); // ok!
1868- collider::earth::foo(); // ok!
1867+ crate:: collider::moon::foo(); // ok!
1868+ crate:: collider::earth::foo(); // ok!
18691869}
18701870```
18711871"## ,
You can’t perform that action at this time.
0 commit comments