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

Fix help for duplicated names: extern crate (...) as (...) #45856

Merged
merged 1 commit into from
Nov 10, 2017

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Nov 8, 2017

On the case of duplicated names caused by an extern crate statement
with a rename, don't include the inline suggestion, instead using a span
label with only the text to avoid incorrect rust code output.

Fix #45829.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

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

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

Seems reasonable.

16 | extern crate m2 as m1;
| ^^^^^^^^^^^^^^^^^^^^^^
| |
| `m1` reimported here
Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, I find this message confusing. I think it's the phrasing "import of the extern crate m1", whereas I see this statement as importing the crate m2 -- but aliasing it to m1. I wonder if some small tweaks to the wording might help. Or maybe it's just fine as is, it's kind of a corner case, and if all goes to plan extern crate is going away anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The same wording issue happens with use.

@nikomatsakis
Copy link
Contributor

@bors r+ -- larger changes seem out of scope

@bors
Copy link
Contributor

bors commented Nov 8, 2017

📌 Commit 3bd7b92 has been approved by nikomatsakis

On the case of duplicated names caused by an `extern crate` statement
with a rename, don't include the inline suggestion, instead using a span
label with only the text to avoid incorrect rust code output.
@estebank
Copy link
Contributor Author

estebank commented Nov 8, 2017

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Nov 8, 2017

📌 Commit d0339c7 has been approved by nikomatsakis

@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 Nov 10, 2017
kennytm added a commit to kennytm/rust that referenced this pull request Nov 10, 2017
Fix help for duplicated names: `extern crate (...) as (...)`

On the case of duplicated names caused by an `extern crate` statement
with a rename, don't include the inline suggestion, instead using a span
label with only the text to avoid incorrect rust code output.

Fix rust-lang#45829.
bors added a commit that referenced this pull request Nov 10, 2017
Rollup of 9 pull requests

- Successful merges: #45783, #45856, #45863, #45869, #45878, #45882, #45887, #45895, #45901
- Failed merges:
@bors bors merged commit d0339c7 into rust-lang:master Nov 10, 2017
@estebank estebank deleted the issue-45829 branch November 9, 2023 05:25
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.

5 participants