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

Compiler suggests import it already has as well as mislabels issue #53430

Closed
TheBestJohn opened this issue Aug 16, 2018 · 0 comments · Fixed by #58381
Closed

Compiler suggests import it already has as well as mislabels issue #53430

TheBestJohn opened this issue Aug 16, 2018 · 0 comments · Fixed by #58381
Assignees
Labels
A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@TheBestJohn
Copy link

TheBestJohn commented Aug 16, 2018

Ran into this trying to connect a diesel db to actix_web. Moodgoodboy on rust-beginners helped in making this MCVE

https://play.rust-lang.org/?gist=0caefd3323a4e74a91c7064e05acd7e9&version=stable&mode=debug

error[E0423]: expected function, found struct 'Executor'

@jonas-schievink jonas-schievink added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. labels Jan 27, 2019
@davidtwco davidtwco self-assigned this Feb 11, 2019
Centril added a commit to Centril/rust that referenced this issue Feb 13, 2019
Only suggest imports if not imported.

Fixes rust-lang#42944 and fixes rust-lang#53430.

This commit modifies name resolution error reporting so that if a name
is in scope and has been imported then we do not suggest importing it.

This can occur when we add a label about constructors not being visible
due to private fields. In these cases, we know that the struct/variant
has been imported and we should silence any suggestions to import the
struct/variant.

r? @estebank
Centril added a commit to Centril/rust that referenced this issue Feb 13, 2019
Only suggest imports if not imported.

Fixes rust-lang#42944 and fixes rust-lang#53430.

This commit modifies name resolution error reporting so that if a name
is in scope and has been imported then we do not suggest importing it.

This can occur when we add a label about constructors not being visible
due to private fields. In these cases, we know that the struct/variant
has been imported and we should silence any suggestions to import the
struct/variant.

r? @estebank
Centril added a commit to Centril/rust that referenced this issue Feb 13, 2019
Only suggest imports if not imported.

Fixes rust-lang#42944 and fixes rust-lang#53430.

This commit modifies name resolution error reporting so that if a name
is in scope and has been imported then we do not suggest importing it.

This can occur when we add a label about constructors not being visible
due to private fields. In these cases, we know that the struct/variant
has been imported and we should silence any suggestions to import the
struct/variant.

r? @estebank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants