Improve type mismatch w/ function signatures#99862
Merged
bors merged 2 commits intorust-lang:masterfrom Jul 30, 2022
Merged
Conversation
This also fixes the argument names in `report_closure_arg_mismatch` (confusing expected/found)
WaffleLapkin
commented
Jul 28, 2022
Member
Author
WaffleLapkin
left a comment
There was a problem hiding this comment.
As usual I'm not sure about the wording, but other than that I think this is an improvement :")
src/test/ui/generator/issue-88653.rs
Outdated
Comment on lines
+12
to
13
Member
Author
There was a problem hiding this comment.
Not sure what's up with these notes, they don't even render in console...
be9642b to
7da578b
Compare
Contributor
|
@WaffleLapkin actually I do prefer mentioning "expected closure signature", since otherwise people may think we're comparing fn ptrs. Sorry for the back and forth 😿 r=me after reverting back to 7da578b @bors delegate+ |
Collaborator
|
✌️ @WaffleLapkin can now approve this pull request |
2e63d78 to
7da578b
Compare
Member
Author
|
@bors r=compiler-errors |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 30, 2022
Rollup of 5 pull requests Successful merges: - rust-lang#99311 (change maybe_body_owned_by to take local def id) - rust-lang#99862 (Improve type mismatch w/ function signatures) - rust-lang#99895 (don't call type ascription "cast") - rust-lang#99900 (remove some manual hash stable impls) - rust-lang#99903 (Add diagnostic when using public instead of pub) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Aug 11, 2022
Rollup of 5 pull requests Successful merges: - rust-lang#99311 (change maybe_body_owned_by to take local def id) - rust-lang#99862 (Improve type mismatch w/ function signatures) - rust-lang#99895 (don't call type ascription "cast") - rust-lang#99900 (remove some manual hash stable impls) - rust-lang#99903 (Add diagnostic when using public instead of pub) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes use of
note: expected/found(instead of labeling types in labels) in type mismatch with function signatures. Pros: it's easier to compare the signatures, cons: the error is a little more verbose now.This is especially nice when
isizevsusize(there is a better chance that the types align)Also this PR fixes the inconsistency in variable names in the edited code (
expectedandfound).A zulip thread from which this pr started: [link].
An example diagnostic:
code
r? @compiler-errors