File tree 1 file changed +9
-9
lines changed
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.
1822
1822
1823
1823
Erroneous code example:
1824
1824
1825
- ```compile_fail,E0659
1825
+ ```compile_fail,edition2018, E0659
1826
1826
pub mod moon {
1827
1827
pub fn foo() {}
1828
1828
}
@@ -1832,12 +1832,12 @@ pub mod earth {
1832
1832
}
1833
1833
1834
1834
mod collider {
1835
- pub use moon::*;
1836
- pub use earth::*;
1835
+ pub use crate:: moon::*;
1836
+ pub use crate:: earth::*;
1837
1837
}
1838
1838
1839
1839
fn main() {
1840
- collider::foo(); // ERROR: `foo` is ambiguous
1840
+ crate:: collider::foo(); // ERROR: `foo` is ambiguous
1841
1841
}
1842
1842
```
1843
1843
@@ -1849,7 +1849,7 @@ functions collide.
1849
1849
To solve this error, the best solution is generally to keep the path before the
1850
1850
item when using it. Example:
1851
1851
1852
- ```
1852
+ ```edition2018
1853
1853
pub mod moon {
1854
1854
pub fn foo() {}
1855
1855
}
@@ -1859,13 +1859,13 @@ pub mod earth {
1859
1859
}
1860
1860
1861
1861
mod collider {
1862
- pub use moon;
1863
- pub use earth;
1862
+ pub use crate:: moon;
1863
+ pub use crate:: earth;
1864
1864
}
1865
1865
1866
1866
fn main() {
1867
- collider::moon::foo(); // ok!
1868
- collider::earth::foo(); // ok!
1867
+ crate:: collider::moon::foo(); // ok!
1868
+ crate:: collider::earth::foo(); // ok!
1869
1869
}
1870
1870
```
1871
1871
"## ,
You can’t perform that action at this time.
0 commit comments