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

Suggest extern crate foo when failing to resolve use foo #97264

Conversation

TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented May 22, 2022

closes #97095

r? @estebank

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 22, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 22, 2022
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@TaKO8Ki TaKO8Ki force-pushed the suggest-extern-crate-when-failing-to-resolve-use-crate branch from b3ff096 to 938f0a4 Compare May 22, 2022 04:27
@estebank
Copy link
Contributor

Ideally we could provide a structured suggestion (we already look around for a span for use suggestions) so that people that don't know where the crate root is are helped (although the diagnostic machinery assumes that every change is in the local file so it doesn't print out the file path... maybe we should change that too).

Would you have the time to squash your commits? r=me either way.

@TaKO8Ki TaKO8Ki force-pushed the suggest-extern-crate-when-failing-to-resolve-use-crate branch from 938f0a4 to b2480a0 Compare May 25, 2022 00:59
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented May 26, 2022

@estebank
I squashed my commits!

@TaKO8Ki TaKO8Ki requested a review from estebank May 31, 2022 05:20
@estebank
Copy link
Contributor

estebank commented Jun 1, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jun 1, 2022

📌 Commit b2480a0 has been approved by estebank

@bors bors 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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 1, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 1, 2022
…ailing-to-resolve-use-crate, r=estebank

Suggest `extern crate foo` when failing to resolve `use foo`

closes rust-lang#97095

r? `@estebank`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 1, 2022
…askrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#96271 (suggest `?` when method is missing on `Result<T, _>` but found on `T`)
 - rust-lang#97264 (Suggest `extern crate foo` when failing to resolve `use foo`)
 - rust-lang#97592 (rustdoc: also index impl trait and raw pointers)
 - rust-lang#97621 (update Miri)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit daedae7 into rust-lang:master Jun 1, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 1, 2022
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In 2015 edition, mention the need for extern crate foo when failing to resolve use foo
6 participants