diag: improve closure/generic parameter mismatch#76711
Merged
bors merged 1 commit intorust-lang:masterfrom Sep 28, 2020
Merged
Conversation
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>
Contributor
|
@bors r+ rollup |
Collaborator
|
📌 Commit 01f65af has been approved by |
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`
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.
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