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 @@ -1831,7 +1831,7 @@ An item usage is ambiguous.
1831
1831
1832
1832
Erroneous code example:
1833
1833
1834
- ```compile_fail,E0659
1834
+ ```compile_fail,edition2018, E0659
1835
1835
pub mod moon {
1836
1836
pub fn foo() {}
1837
1837
}
@@ -1841,12 +1841,12 @@ pub mod earth {
1841
1841
}
1842
1842
1843
1843
mod collider {
1844
- pub use moon::*;
1845
- pub use earth::*;
1844
+ pub use crate:: moon::*;
1845
+ pub use crate:: earth::*;
1846
1846
}
1847
1847
1848
1848
fn main() {
1849
- collider::foo(); // ERROR: `foo` is ambiguous
1849
+ crate:: collider::foo(); // ERROR: `foo` is ambiguous
1850
1850
}
1851
1851
```
1852
1852
@@ -1858,7 +1858,7 @@ functions collide.
1858
1858
To solve this error, the best solution is generally to keep the path before the
1859
1859
item when using it. Example:
1860
1860
1861
- ```
1861
+ ```edition2018
1862
1862
pub mod moon {
1863
1863
pub fn foo() {}
1864
1864
}
@@ -1868,13 +1868,13 @@ pub mod earth {
1868
1868
}
1869
1869
1870
1870
mod collider {
1871
- pub use moon;
1872
- pub use earth;
1871
+ pub use crate:: moon;
1872
+ pub use crate:: earth;
1873
1873
}
1874
1874
1875
1875
fn main() {
1876
- collider::moon::foo(); // ok!
1877
- collider::earth::foo(); // ok!
1876
+ crate:: collider::moon::foo(); // ok!
1877
+ crate:: collider::earth::foo(); // ok!
1878
1878
}
1879
1879
```
1880
1880
"## ,
You can’t perform that action at this time.
0 commit comments