Don't suggest associated function call for associated const #104801
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Follow-up from this comment: #104422 (comment)
Given the following code:
The current output is:
Ideally the output should not mention
i32::MAX()
, since that is an associated constant and not an associated function. However, it seems like some parts of method probing don't consider the associate item's kind when collecting candidates for diagnostics.This should be investigated and fixed. While investigating, similar code should also be inspected and fixed if this can be triggered in other ways, for example.
The text was updated successfully, but these errors were encountered: