rust/tests
Guillaume Gomez 0e5e04b89a
Rollup merge of #116250 - estebank:closure-arg-inference-span, r=petrochenkov
On type error of closure call argument, point at earlier calls that affected inference

Mitigate part of  https://github.com/rust-lang/rust/issues/71209.

When we encounter a type error on a specific argument of a closure call argument, where the closure's definition doesn't have a type specified, look for other calls of the closure to try and find the specific call that cased that argument to be inferred of the expected type.

```
error[E0308]: mismatched types
  --> $DIR/unboxed-closures-type-mismatch.rs:30:18
   |
LL |         identity(1u16);
   |         -------- ^^^^ expected `u8`, found `u16`
   |         |
   |         arguments to this function are incorrect
   |
note: expected because the closure was earlier called with an argument of type `u8`
  --> $DIR/unboxed-closures-type-mismatch.rs:29:18
   |
LL |         identity(1u8);
   |         -------- ^^^ expected because this argument is of type `u8`
   |         |
   |         in this closure call
note: closure parameter defined here
  --> $DIR/unboxed-closures-type-mismatch.rs:28:25
   |
LL |         let identity = |x| x;
   |                         ^
help: change the type of the numeric literal from `u16` to `u8`
   |
LL |         identity(1u8);
   |                   ~~
```
2023-10-10 18:44:44 +02:00
..
assembly Limit to LLVM 17.0.2 to work around WinEH codegen bug 2023-10-02 11:06:38 +02:00
auxiliary
codegen Ignore MSVC in test. 2023-10-08 16:45:45 +00:00
codegen-units
coverage-map coverage: Store each BCB's code regions in one coverage statement 2023-10-03 13:03:39 +11:00
debuginfo
incremental Bless incremental tests. 2023-10-06 15:46:11 +00:00
mir-opt Preserve DebugInfo in DeadStoreElimination. 2023-10-06 15:46:11 +00:00
pretty
run-coverage coverage: Regression test for functions with unreachable bodies 2023-10-01 14:44:27 +11:00
run-coverage-rustdoc
run-make Auto merge of #116514 - petrochenkov:nogccld, r=lqd 2023-10-08 09:04:57 +00:00
run-make-fulldeps
run-pass-valgrind
rustdoc Rollup merge of #109422 - notriddle:notriddle/impl-disambiguate-search, r=GuillaumeGomez 2023-10-10 18:44:43 +02:00
rustdoc-gui Rollup merge of #109422 - notriddle:notriddle/impl-disambiguate-search, r=GuillaumeGomez 2023-10-10 18:44:43 +02:00
rustdoc-js Rollup merge of #109422 - notriddle:notriddle/impl-disambiguate-search, r=GuillaumeGomez 2023-10-10 18:44:43 +02:00
rustdoc-js-std
rustdoc-json
rustdoc-ui Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
ui Rollup merge of #116250 - estebank:closure-arg-inference-span, r=petrochenkov 2023-10-10 18:44:44 +02:00
ui-fulldeps return crates instead of a crate 2023-10-09 10:33:23 +03:00
COMPILER_TESTS.md