-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Suggest renaming import if names clash #45660
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Looks great! Could you add a test for it? Just create an Otherwise, r=me. |
Added a stripped-down version of the example from the issue as the test. |
@bors r+ rollup |
📌 Commit 61396a8 has been approved by |
…tebank Suggest renaming import if names clash Closes rust-lang#32354. The output for the example in the issue looks like this: ``` ~/p/local-rust-dev-testing ❯❯❯ cargo +local-s1 build Compiling local-rust-dev-testing v0.1.0 (file:///home/cldfire/programming_projects/local-rust-dev-testing) error[E0252]: the name `ConstructorExtension` is defined multiple times --> src/main.rs:49:5 | 48 | use extension1::ConstructorExtension; | -------------------------------- previous import of the trait `ConstructorExtension` here 49 | use extension2::ConstructorExtension; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ConstructorExtension` reimported here | = note: `ConstructorExtension` must be defined only once in the type namespace of this module help: You can use `as` to change the binding name of the import | 49 | use extension2::ConstructorExtension as OtherConstructorExtension; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... ``` This is my first PR that touches the compiler in any way, so if there's something else I need to do here (e.g. add a test), please let me know :).
Closes #32354.
The output for the example in the issue looks like this:
This is my first PR that touches the compiler in any way, so if there's something else I need to do here (e.g. add a test), please let me know :).