Skip to content

Commit ba9a9eb

Browse files
authored
Rollup merge of rust-lang#65691 - GuillaumeGomez:2018-edition-E0659, r=Dylan-DPC
Update E0659 error code long explanation to 2018 edition Fixes rust-lang#65571 r? @Centril
2 parents a649b16 + ed965f1 commit ba9a9eb

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
@@ -1831,7 +1831,7 @@ An item usage is ambiguous.
18311831
18321832
Erroneous code example:
18331833
1834-
```compile_fail,E0659
1834+
```compile_fail,edition2018,E0659
18351835
pub mod moon {
18361836
pub fn foo() {}
18371837
}
@@ -1841,12 +1841,12 @@ pub mod earth {
18411841
}
18421842
18431843
mod collider {
1844-
pub use moon::*;
1845-
pub use earth::*;
1844+
pub use crate::moon::*;
1845+
pub use crate::earth::*;
18461846
}
18471847
18481848
fn 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.
18581858
To solve this error, the best solution is generally to keep the path before the
18591859
item when using it. Example:
18601860
1861-
```
1861+
```edition2018
18621862
pub mod moon {
18631863
pub fn foo() {}
18641864
}
@@ -1868,13 +1868,13 @@ pub mod earth {
18681868
}
18691869
18701870
mod collider {
1871-
pub use moon;
1872-
pub use earth;
1871+
pub use crate::moon;
1872+
pub use crate::earth;
18731873
}
18741874
18751875
fn 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
"##,

0 commit comments

Comments
 (0)