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

Prefer explict closure sig types over expected ones #101753

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Sep 13, 2022

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.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 13, 2022
@rust-highfive
Copy link
Collaborator

r? @compiler-errors

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 13, 2022
Copy link
Member

@compiler-errors compiler-errors left a 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.

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Sep 13, 2022

📌 Commit 831f0de2e12023f82fe7d7d2ce7296c69f45f9ad has been approved by compiler-errors

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 Sep 13, 2022
@bors
Copy link
Contributor

bors commented Sep 13, 2022

☔ The latest upstream changes (presumably #101086) 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 Sep 13, 2022
@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 14, 2022

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Sep 14, 2022

📌 Commit 7794ea5 has been approved by compiler-errors

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 14, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 15, 2022
…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.
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 15, 2022
…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.
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2022
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
@bors bors merged commit edf9e5e into rust-lang:master Sep 16, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Explicitly stated argument-type of a closure gets overwritten by its type alias
5 participants