Skip to content

Elide unused import errors for failed use statements - #60295

Closed
estebank wants to merge 1 commit into
rust-lang:masterfrom
estebank:unused-imports-error
Closed

Elide unused import errors for failed use statements#60295
estebank wants to merge 1 commit into
rust-lang:masterfrom
estebank:unused-imports-error

Conversation

@estebank

Copy link
Copy Markdown
Contributor

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @varkor

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 26, 2019
@petrochenkovpetrochenkov self-assigned this Apr 26, 2019
Comment threadsrc/librustc_resolve/check_unused.rs Outdated
@estebank
estebankforce-pushed the unused-imports-error branch 2 times, most recently from e49854c to 274b3d2CompareApril 26, 2019 18:15
@rust-highfive

This comment has been minimized.

@estebank
estebankforce-pushed the unused-imports-error branch from 274b3d2 to f168d97CompareApril 26, 2019 18:50
@estebank

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
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#60295Fixesrust-lang#48244
r? @estebank
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-reviewStatus: 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

@estebank@rust-highfive@petrochenkov@cramertj@varkor