rust/compiler/rustc_trait_selection
Stuart Cook 61f53585aa
Rollup merge of #146581 - estebank:issue-146489, r=lcnr
Detect attempt to use var-args in closure

```
error: unexpected `...`
  --> $DIR/no-closure.rs:11:14
   |
LL |     let f = |...| {};
   |              ^^^ not a valid pattern
   |
   = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list

error: unexpected `...`
  --> $DIR/no-closure.rs:16:17
   |
LL |     let f = |_: ...| {};
   |                 ^^^
   |
   = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
```

Fix rust-lang/rust#146489, when trying to use c-style var-args in a closure. We emit a more targeted message. We also silence inference errors when the pattern is `PatKind::Err`.
2025-09-17 14:56:48 +10:00
..