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

Add E0659 for ambiguous names #47512

Merged
merged 1 commit into from
Jan 22, 2018
Merged

Add E0659 for ambiguous names #47512

merged 1 commit into from
Jan 22, 2018

Conversation

GuillaumeGomez
Copy link
Member

Still on the tracks of the "no error without error code" road.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 17, 2018

📌 Commit e207b0b has been approved by petrochenkov

@kennytm kennytm added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 17, 2018
@kennytm
Copy link
Member

kennytm commented Jan 17, 2018

@bors r-

Travis failed. Please check if the examples will really emit E0659

[01:28:44] failures:
[01:28:44] 
[01:28:44] ---- /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0659 (line 11858) stdout ----
[01:28:44] 	error[E0432]: unresolved import `moon`
[01:28:44]   --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:11868:13
[01:28:44]    |
[01:28:44] 12 |     pub use moon::*;
[01:28:44]    |             ^^^^ Maybe a missing `extern crate moon;`?
[01:28:44] 
[01:28:44] error[E0432]: unresolved import `earth`
[01:28:44]   --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:11869:13
[01:28:44]    |
[01:28:44] 13 |     pub use earth::*;
[01:28:44]    |             ^^^^^ Maybe a missing `extern crate earth;`?
[01:28:44] 
[01:28:44] error[E0425]: cannot find function `foo` in module `collider`
[01:28:44]   --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:11872:11
[01:28:44]    |
[01:28:44] 16 | collider::foo(); // ERROR: `foo` is ambiguous
[01:28:44]    |           ^^^ not found in `collider`
[01:28:44] 
[01:28:44] thread 'rustc' panicked at 'Some expected error codes were not found: ["E0659"]', librustdoc/test.rs:294:9
[01:28:44] 
[01:28:44] ---- /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0659 (line 11884) stdout ----
[01:28:44] 	error[E0432]: unresolved import `moon`
[01:28:44]   --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:11894:13
[01:28:44]    |
[01:28:44] 12 |     pub use moon;
[01:28:44]    |             ^^^^ no `moon` in the root
[01:28:44] 
[01:28:44] error[E0432]: unresolved import `earth`
[01:28:44]   --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:11895:13
[01:28:44]    |
[01:28:44] 13 |     pub use earth;
[01:28:44]    |             ^^^^^ no `earth` in the root
[01:28:44] 
[01:28:44] thread 'rustc' panicked at 'couldn't compile the test', librustdoc/test.rs:289:13
[01:28:44] 
[01:28:44] 
[01:28:44] failures:
[01:28:44]     /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0659 (line 11858)
[01:28:44]     /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0659 (line 11884)
[01:28:44] 
[01:28:44] test result: FAILED. 662 passed; 2 failed; 22 ignored; 0 measured; 0 filtered out

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 17, 2018
@GuillaumeGomez
Copy link
Member Author

I need to add a main function I think so rustdoc won't wrap them.

@kennytm
Copy link
Member

kennytm commented Jan 17, 2018

The pub use moon::*; one is fixed, but the pub use moon; one is still failing with other errors.

[01:38:35] ---- /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0659 (line 11886) stdout ----
[01:38:35] 	error[E0365]: `moon` is private, and cannot be reexported
[01:38:35]   --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:11896:13
[01:38:35]    |
[01:38:35] 11 |     pub use moon;
[01:38:35]    |             ^^^^ reexport of private `moon`
[01:38:35]    |
[01:38:35]    = note: consider declaring type or module `moon` with `pub`
[01:38:35] 
[01:38:35] error[E0365]: `earth` is private, and cannot be reexported
[01:38:35]   --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:11897:13
[01:38:35]    |
[01:38:35] 12 |     pub use earth;
[01:38:35]    |             ^^^^^ reexport of private `earth`
[01:38:35]    |
[01:38:35]    = note: consider declaring type or module `earth` with `pub`
[01:38:35] 
[01:38:35] thread 'rustc' panicked at 'couldn't compile the test', librustdoc/test.rs:289:13

This error generally appears when two items with the same name are imported in a
same module. In here, the `foo` functions are imported and reexported from the
`collider` module and therefore, when we're using `collider::foo()`, both
functions collide.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar nits: "are imported in a same module" is incorrect. "are imported into a module" is better. "In here" should just be "Here".

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 18, 2018

📌 Commit f66e711 has been approved by petrochenkov

@petrochenkov petrochenkov added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 18, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 19, 2018
Add E0659 for ambiguous names

Still on the tracks of the "no error without error code" road.
bors added a commit that referenced this pull request Jan 19, 2018
Rollup of 8 pull requests

- Successful merges: #46938, #47334, #47420, #47508, #47510, #47512, #47535, #47559
- Failed merges:
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 21, 2018
Add E0659 for ambiguous names

Still on the tracks of the "no error without error code" road.
bors added a commit that referenced this pull request Jan 21, 2018
Rollup of 9 pull requests

- Successful merges: #47247, #47334, #47512, #47582, #47595, #47625, #47632, #47633, #47637
- Failed merges:
@bors bors merged commit f66e711 into rust-lang:master Jan 22, 2018
@GuillaumeGomez GuillaumeGomez deleted the e0659 branch January 22, 2018 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants