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

Suggest calling method if fn does not exist #102694

Merged
merged 3 commits into from
Oct 6, 2022

Conversation

compiler-errors
Copy link
Member

I tried to split this up into two commits, the first where we stash the resolution error until typeck (which causes a bunch of diagnostics changes because the ordering of error messages change), then the second commit is the actual logic that actually implements the suggestion.

I am not in love with the presentation of the suggestion, so I could use some advice for how to format the actual messaging.

r? diagnostics

Fixes #102518

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 5, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 5, 2022
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, I don't have much in the way of suggestions for alternate wording. r=me unless you want to make changes to the wording first.

Co-authored-by: nils <48135649+Nilstrieb@users.noreply.github.com>
@compiler-errors
Copy link
Member Author

alrighty, this can just land as is. worst case, someone will complain about the wording in a follow-up issue 😁

@bors r=davidtwco

@bors
Copy link
Contributor

bors commented Oct 5, 2022

📌 Commit ea38370 has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 5, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 6, 2022
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#102672 (rustdoc: remove unused CSS class `in-band`)
 - rust-lang#102693 (Revert "Use getentropy when possible on all Apple platforms")
 - rust-lang#102694 (Suggest calling method if fn does not exist)
 - rust-lang#102708 (Suggest `==` to wrong assign expr)
 - rust-lang#102710 (Add test for issue 82633)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Oct 6, 2022

☔ The latest upstream changes (presumably #102726) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 6, 2022
@bors bors merged commit a9b3441 into rust-lang:master Oct 6, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 6, 2022
@compiler-errors compiler-errors deleted the fn-to-method branch November 2, 2022 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When calling a function that is actually a method, mention it
6 participants