Skip to content

Commit

Permalink
Rollup merge of rust-lang#65691 - GuillaumeGomez:2018-edition-E0659, …
Browse files Browse the repository at this point in the history
…r=Dylan-DPC

Update E0659 error code long explanation to 2018 edition

Fixes rust-lang#65571

r? @Centril
  • Loading branch information
Centril committed Oct 23, 2019
2 parents a649b16 + ed965f1 commit ba9a9eb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/librustc_resolve/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,7 @@ An item usage is ambiguous.
Erroneous code example:
```compile_fail,E0659
```compile_fail,edition2018,E0659
pub mod moon {
pub fn foo() {}
}
Expand All @@ -1841,12 +1841,12 @@ pub mod earth {
}
mod collider {
pub use moon::*;
pub use earth::*;
pub use crate::moon::*;
pub use crate::earth::*;
}
fn main() {
collider::foo(); // ERROR: `foo` is ambiguous
crate::collider::foo(); // ERROR: `foo` is ambiguous
}
```
Expand All @@ -1858,7 +1858,7 @@ functions collide.
To solve this error, the best solution is generally to keep the path before the
item when using it. Example:
```
```edition2018
pub mod moon {
pub fn foo() {}
}
Expand All @@ -1868,13 +1868,13 @@ pub mod earth {
}
mod collider {
pub use moon;
pub use earth;
pub use crate::moon;
pub use crate::earth;
}
fn main() {
collider::moon::foo(); // ok!
collider::earth::foo(); // ok!
crate::collider::moon::foo(); // ok!
crate::collider::earth::foo(); // ok!
}
```
"##,
Expand Down

0 comments on commit ba9a9eb

Please sign in to comment.