-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
No turbofish suggestion for complex expressions #81816
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
The turbofish suggestions are displayed for single expressions, but not for complex expressions. https://rust.godbolt.org/z/cbn58f
I tried this code:
I expected to see this happen: Turbofish
::<>suggestion for HashMap type.Instead, this happened: Invalid suggestion to use private field to initialize HashMap.
Meta
rustc --version --verbose: rustc 1.51.0-nightly (e708cbd 2021-02-03)@rustbot label A-diagnostics D-confusing D-incorrect T-compiler D-invalid-suggestion
*This issue was detected by an user on Reddit: https://www.reddit.com/r/rust/comments/ld6q8u/bastion_of_the_turbofish_a_brief_tale_lamenting/gm5j0yz/.