about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-06-30 18:25:35 +0200
committerGitHub <noreply@github.com>2024-06-30 18:25:35 +0200
commit6335b83703bb63b303c78ac1773813d6d5b8c87b (patch)
tree5d94b390ca0d4fa36e9755cd619b7a850b05f727 /compiler/rustc_const_eval/src
parentb2aebc1b76dc2173aed72a9b1512e3b367f4b6f2 (diff)
parent8a0e1ab565346491f932612508e57c225ddbb34c (diff)
downloadrust-6335b83703bb63b303c78ac1773813d6d5b8c87b.tar.gz
rust-6335b83703bb63b303c78ac1773813d6d5b8c87b.zip
Rollup merge of #127160 - pacak:123630-test, r=Nadrieril
Add a regression test for #123630

Fixes #123630

compiler should not suggest nonsensical signatures, original suggestion was

```
error[E0308]: mismatched types
 --> src/lib.rs:3:31
  |
3 | fn select<F, I>(filter: F) -> Select<F, I> {
  |    ------                     ^^^^^^^^^^^^ expected `Select<F, I>`, found `()`
  |    |
  |    implicitly returns `()` as its body has no tail or `return` expression
  |
  = note: expected struct `Select<F, I>`
          found unit type `()`

error[E0282]: type annotations needed for `Select<{closure@src/lib.rs:8:22: 8:25}, I>`
 --> src/lib.rs:8:9
  |
8 |     let lit = select(|x| match x {
  |         ^^^
  |
help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified
  |
8 |     let lit: Select<{closure@src/lib.rs:8:22: 8:25}, I> = select(|x| match x {
  |            ++++++++++++++++++++++++++++++++++++++++++++

Some errors have detailed explanations: E0282, E0308. For more information about an error, try `rustc --explain E0282`.
```
Diffstat (limited to 'compiler/rustc_const_eval/src')
0 files changed, 0 insertions, 0 deletions