Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update E0659 error code long explanation to 2018 edition #65691

Merged
merged 1 commit into from
Oct 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/librustc_resolve/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ An item usage is ambiguous.

Erroneous code example:

```compile_fail,E0659
```compile_fail,edition2018,E0659
pub mod moon {
pub fn foo() {}
}
Expand All @@ -1832,12 +1832,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 @@ -1849,7 +1849,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 @@ -1859,13 +1859,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