]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #76711 - davidtwco:issue-51154-param-closure, r=estebank
authorRalf Jung <post@ralfj.de>
Mon, 28 Sep 2020 16:39:42 +0000 (18:39 +0200)
committerGitHub <noreply@github.com>
Mon, 28 Sep 2020 16:39:42 +0000 (18:39 +0200)
commit88ae20d8aa44f1f0fadddfa5c529784732d7b101
tree494b12c442bb620d75e3266b871d0ca176ab8819
parent6a8cdbd285eca75024809ac12b8badb7f38128b7
parent01f65afa4adff6dfbea84621e6851c028aaa7159
Rollup merge of #76711 - davidtwco:issue-51154-param-closure, r=estebank

diag: improve closure/generic parameter mismatch

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
compiler/rustc_middle/src/ty/error.rs
compiler/rustc_typeck/src/check/demand.rs