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

diag: improve closure/generic parameter mismatch #76711

Merged
merged 1 commit into from
Sep 28, 2020

Conversation

davidtwco
Copy link
Member

@davidtwco davidtwco commented Sep 14, 2020

Fixes #51154.

This PR improves the diagnostic when a type parameter is expected and a closure is found, noting that each closure has a distinct type and therefore could not always match the caller-chosen type of the parameter.

r? @estebank

This commit improves the diagnostic when a type parameter is expected
and a closure is found, noting that each closure has a distinct type and
therefore could not always match the caller-chosen type of the
parameter.

Signed-off-by: David Wood <david@davidtw.co>
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 14, 2020
@estebank
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 28, 2020

📌 Commit 01f65af has been approved by estebank

@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 28, 2020
RalfJung added a commit to RalfJung/rust that referenced this pull request Sep 28, 2020
…, r=estebank

diag: improve closure/generic parameter mismatch

Fixes rust-lang#51154.

This PR improves the diagnostic when a type parameter is expected and a closure is found, noting that each closure has a distinct type and therefore could not always match the caller-chosen type of the parameter.

r? @estebank
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 28, 2020
…, r=estebank

diag: improve closure/generic parameter mismatch

Fixes rust-lang#51154.

This PR improves the diagnostic when a type parameter is expected and a closure is found, noting that each closure has a distinct type and therefore could not always match the caller-chosen type of the parameter.

r? @estebank
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 28, 2020
Rollup of 7 pull requests

Successful merges:

 - rust-lang#76454 (UI to unit test for those using Cell/RefCell/UnsafeCell)
 - rust-lang#76474 (Add option to pass a custom codegen backend from a driver)
 - rust-lang#76711 (diag: improve closure/generic parameter mismatch)
 - rust-lang#77170 (Remove `#[rustc_allow_const_fn_ptr]` and add `#![feature(const_fn_fn_ptr_basics)]`)
 - rust-lang#77194 (Add doc alias for iterator fold)
 - rust-lang#77288 (fix building libstd for Miri on macOS)
 - rust-lang#77295 (Update unstable-book: Fix ABNF in inline assembly docs)

Failed merges:

r? `@ghost`
@bors bors merged commit 88ae20d into rust-lang:master Sep 28, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 28, 2020
@davidtwco davidtwco deleted the issue-51154-param-closure branch October 12, 2020 14:11
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing error "expected type parameter, found closure"
5 participants