-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Prefer explict closure sig types over expected ones #101753
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI test changes in src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
are interesting but make sense.
@bors r+ |
📌 Commit 831f0de2e12023f82fe7d7d2ce7296c69f45f9ad has been approved by It is now in the queue for this repository. |
☔ The latest upstream changes (presumably #101086) made this pull request unmergeable. Please resolve the merge conflicts. |
831f0de
to
7794ea5
Compare
@bors r=compiler-errors |
…ler-errors Prefer explict closure sig types over expected ones fixes rust-lang#100800 Previously we only checked that given closure arguments are equal to expected closure arguments, but now we choose the given closure arguments for the signature that is used when type checking the closure body, and keep the other signature for the type of the closure as seen outside of it.
…ler-errors Prefer explict closure sig types over expected ones fixes rust-lang#100800 Previously we only checked that given closure arguments are equal to expected closure arguments, but now we choose the given closure arguments for the signature that is used when type checking the closure body, and keep the other signature for the type of the closure as seen outside of it.
Rollup of 7 pull requests Successful merges: - rust-lang#101722 (Rustdoc-Json: Fix Type docs.) - rust-lang#101738 (Fix `#[link kind="raw-dylib"]` to respect `#[link_name]`) - rust-lang#101753 (Prefer explict closure sig types over expected ones) - rust-lang#101787 (cache `collect_trait_impl_trait_tys`) - rust-lang#101802 (Constify impl Fn* &(mut) Fn*) - rust-lang#101809 (Replace `check_missing_items.py` with `jsondoclint`) - rust-lang#101864 (rustdoc: remove no-op CSS `h1-4 { color: --main-color }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
fixes #100800
Previously we only checked that given closure arguments are equal to expected closure arguments, but now we choose the given closure arguments for the signature that is used when type checking the closure body, and keep the other signature for the type of the closure as seen outside of it.