rust/tests
Esteban Küber 5c414094ac Account for non-overlapping unmet trait bounds in suggestion
When a method not found on a type parameter could have been provided by any
of multiple traits, suggest each trait individually, instead of a single
suggestion to restrict the type parameter with *all* of them.

Before:

```
error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
  --> $DIR/method-on-unbounded-type-param.rs:5:10
   |
LL |     (&a).cmp(&b)
   |          ^^^ method cannot be called on `&T` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `T: Ord`
           which is required by `&T: Ord`
           `&T: Iterator`
           which is required by `&mut &T: Iterator`
           `T: Iterator`
           which is required by `&mut T: Iterator`
help: consider restricting the type parameters to satisfy the trait bounds
   |
LL | fn g<T>(a: T, b: T) -> std::cmp::Ordering where T: Iterator, T: Ord {
   |                                           +++++++++++++++++++++++++
```

After:

```
error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
  --> $DIR/method-on-unbounded-type-param.rs:5:10
   |
LL |     (&a).cmp(&b)
   |          ^^^ method cannot be called on `&T` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `T: Ord`
           which is required by `&T: Ord`
           `&T: Iterator`
           which is required by `&mut &T: Iterator`
           `T: Iterator`
           which is required by `&mut T: Iterator`
   = help: items from traits can only be used if the type parameter is bounded by the trait
help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
   |
LL | fn g<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
   |       +++++
LL | fn g<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
   |       ++++++++++
```

Fix #108428.
2024-01-30 19:26:13 +00:00
..
assembly Split assembly tests for ELF and MachO 2024-01-25 16:17:35 +01:00
auxiliary
codegen Update codegen test for LLVM 18 2024-01-26 15:03:23 +01:00
codegen-units Adjust compiler tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
coverage Rollup merge of #120185 - Zalathar:auto-derived, r=wesleywiser 2024-01-24 15:43:12 +01:00
coverage-run-rustdoc coverage: Don't instrument #[automatically_derived] functions 2024-01-22 12:18:57 +11:00
debuginfo Update tests. 2024-01-27 16:38:57 +01:00
incremental Track verbose and verbose_internals 2024-01-20 08:00:09 -05:00
mir-opt Rollup merge of #120424 - RalfJung:raw-ptr-meta, r=Nilstrieb 2024-01-30 11:19:16 +01:00
pretty Add #[coverage(off)] to closures introduced by #[test]/#[bench] 2024-01-21 23:17:00 +11:00
run-make Auto merge of #120062 - davidtwco:llvm-data-layout-check, r=wesleywiser 2024-01-27 12:19:41 +00:00
run-make-fulldeps Auto merge of #118899 - veera-sivarajan:fix-makefile, r=Mark-Simulacrum 2024-01-05 07:42:03 +00:00
run-pass-valgrind
rustdoc Add regression test for #100638 2024-01-29 14:14:03 +01:00
rustdoc-gui Rollup merge of #119746 - notriddle:notriddle/resize-close-modals, r=fmease 2024-01-22 07:56:42 +01:00
rustdoc-js Rollup merge of #118194 - notriddle:notriddle/tuple-unit, r=GuillaumeGomez 2024-01-06 16:07:46 +01:00
rustdoc-js-std Rollup merge of #118194 - notriddle:notriddle/tuple-unit, r=GuillaumeGomez 2024-01-06 16:07:46 +01:00
rustdoc-json
rustdoc-ui Rollup merge of #119730 - vuittont60:master, r=GuillaumeGomez 2024-01-18 20:56:19 +01:00
ui Account for non-overlapping unmet trait bounds in suggestion 2024-01-30 19:26:13 +00:00
ui-fulldeps Stop using String for error codes. 2024-01-29 07:41:41 +11:00
COMPILER_TESTS.md