Skip to content

Commit ed965f1

Browse files
Update E0659 error code long explanation to 2018 edition
1 parent 14f0ed6 commit ed965f1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/librustc_resolve/error_codes.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,7 @@ An item usage is ambiguous.
18221822
18231823
Erroneous code example:
18241824
1825-
```compile_fail,E0659
1825+
```compile_fail,edition2018,E0659
18261826
pub mod moon {
18271827
pub fn foo() {}
18281828
}
@@ -1832,12 +1832,12 @@ pub mod earth {
18321832
}
18331833
18341834
mod collider {
1835-
pub use moon::*;
1836-
pub use earth::*;
1835+
pub use crate::moon::*;
1836+
pub use crate::earth::*;
18371837
}
18381838
18391839
fn 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.
18491849
To solve this error, the best solution is generally to keep the path before the
18501850
item when using it. Example:
18511851
1852-
```
1852+
```edition2018
18531853
pub mod moon {
18541854
pub fn foo() {}
18551855
}
@@ -1859,13 +1859,13 @@ pub mod earth {
18591859
}
18601860
18611861
mod collider {
1862-
pub use moon;
1863-
pub use earth;
1862+
pub use crate::moon;
1863+
pub use crate::earth;
18641864
}
18651865
18661866
fn 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
"##,

0 commit comments

Comments
 (0)