rust/tests/ui/impl-trait/issues
bors 94bc9c737e Auto merge of #114811 - estebank:impl-ambiguity, r=wesleywiser
Show more information when multiple `impl`s apply

- When there are `impl`s without type params, show only those (to avoid showing overly generic `impl`s).
```
error[E0283]: type annotations needed
  --> $DIR/multiple-impl-apply.rs:34:9
   |
LL |     let y = x.into();
   |         ^     ---- type must be known at this point
   |
note: multiple `impl`s satisfying `_: From<Baz>` found
  --> $DIR/multiple-impl-apply.rs:14:1
   |
LL | impl From<Baz> for Bar {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL | impl From<Baz> for Foo {
   | ^^^^^^^^^^^^^^^^^^^^^^
   = note: required for `Baz` to implement `Into<_>`
help: consider giving `y` an explicit type
   |
LL |     let y: /* Type */ = x.into();
   |          ++++++++++++
```

- Lower the importance of `T: Sized`, `T: WellFormed` and coercion errors, to prioritize more relevant errors. The pre-existing deduplication logic deals with hiding redundant errors better that way, and we show errors with more metadata that is useful to the user.

- Show `<SelfTy as Trait>::assoc_fn` suggestion in more cases.
```
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
  --> $DIR/cross-return-site-inference.rs:38:16
   |
LL |     return Err(From::from("foo"));
   |                ^^^^^^^^^^ cannot call associated function of trait
   |
help: use a fully-qualified path to a specific available implementation
   |
LL |     return Err(</* self type */ as From>::from("foo"));
   |                +++++++++++++++++++     +
```

Fix #88284.
2023-10-06 18:44:32 +00:00
..
infinite-impl-trait-issue-38064.rs
infinite-impl-trait-issue-38064.stderr
issue-21659-show-relevant-trait-impls-3.rs
issue-21659-show-relevant-trait-impls-3.stderr
issue-42479.rs
issue-49376.rs
issue-52128.rs
issue-53457.rs
issue-54600.rs Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-54600.stderr Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-54840.rs Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-54840.stderr Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-54895.rs
issue-54895.stderr
issue-55608-captures-empty-region.rs
issue-57464-unexpected-regions.rs
issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs
issue-57979-deeply-nested-impl-trait-in-assoc-proj.stderr
issue-57979-impl-trait-in-path.rs
issue-57979-impl-trait-in-path.stderr
issue-57979-nested-impl-trait-in-assoc-proj.rs
issue-57979-nested-impl-trait-in-assoc-proj.stderr
issue-58504.rs Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-58504.stderr Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-58956.rs Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-58956.stderr Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-62742.rs
issue-62742.stderr Point out the actual mismatch error 2023-10-02 23:14:29 +00:00
issue-65581.rs
issue-67830.rs
issue-67830.stderr
issue-70877.rs
issue-70877.stderr
issue-70971.rs Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-70971.stderr Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-74282.rs
issue-74282.stderr
issue-77987.rs
issue-78722-2.rs
issue-78722-2.stderr
issue-78722.rs
issue-78722.stderr
issue-79099.rs Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-79099.stderr Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-82139.rs
issue-82139.stderr
issue-83919.rs
issue-83919.stderr
issue-83929-impl-trait-in-generic-default.rs Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-83929-impl-trait-in-generic-default.stderr Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-84073.rs
issue-84073.stderr Reorder fullfillment errors to keep more interesting ones first 2023-10-04 02:04:14 +00:00
issue-84919.rs Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-84919.stderr Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-86201.rs
issue-86642.rs Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-86642.stderr Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-86719.rs
issue-86719.stderr
issue-86800.rs
issue-86800.stderr
issue-87295.rs Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-87295.stderr Tweak wording of E0562 2023-10-04 19:51:43 +00:00
issue-87340.rs
issue-87340.stderr
issue-88236-2.rs
issue-88236-2.stderr
issue-88236.rs
issue-88236.stderr
issue-89312.rs
issue-92305.rs
issue-92305.stderr
issue-93788.rs
issue-99348-impl-compatibility.rs
issue-99348-impl-compatibility.stderr
issue-104815.rs
issue-105826.rs