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

Elide unused import errors for failed use statements #60295

Closed
wants to merge 1 commit into from

Conversation

estebank
Copy link
Contributor

Fix #48244

@rust-highfive
Copy link
Collaborator

r? @varkor

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 26, 2019
@petrochenkov petrochenkov self-assigned this Apr 26, 2019
@estebank estebank force-pushed the unused-imports-error branch 2 times, most recently from e49854c to 274b3d2 Compare April 26, 2019 18:15
@rust-highfive

This comment has been minimized.

@estebank
Copy link
Contributor Author

If we don't want to pay the price of iterating over all the spans, we can simply silence all unused import lints if any import errors have been found, but I slightly prefer this more targeted approach.

@petrochenkov
Copy link
Contributor

Unresolved imports are resolved to Def::Err during "import finalization".
Every time we perform such a resolution for an import we need to mark it as used.
I don't quite remember where it's done exactly, will look today.

@petrochenkov
Copy link
Contributor

Superseded by #60359

Centril added a commit to Centril/rust that referenced this pull request Apr 29, 2019
resolve: Consider erroneous imports used to avoid duplicate diagnostics

Supersedes rust-lang#60295
Fixes rust-lang#48244
r? @estebank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"unused imports" lints run too eagerly
5 participants