-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Description
Consider the following library (with hello
and aleph
externs provided):
extern crate hello;
extern crate aleph as hello;
rustc
will reasonably identify a problem:
error[E0259]: the name `hello` is defined multiple times
--> lib.rs:2:1
|
1 | extern crate hello;
| ------------------- previous import of the extern crate `hello` here
2 | extern crate aleph as hello;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `hello` reimported here
|
= note: `hello` must be defined only once in the type namespace of this module
but will then go on to suggest a rather unhelpful solution that isn't even valid Rust code:
help: You can use `as` to change the binding name of the import
|
2 | extern crate aleph as hello; as Otherhello
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kennytm, Seadragon91 and CldfireCldfire
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.