diff options
| author | bors <bors@rust-lang.org> | 2023-10-06 18:44:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-06 18:44:32 +0000 |
| commit | 94bc9c737ea97d56f9b4076553ac37c05c1e3931 (patch) | |
| tree | e125a8548eccd22fa30fd8aca6675b7a5af806cd /compiler/rustc_mir_transform/src/coverage/graph.rs | |
| parent | 31be8cc41148983e742fea8f559aacca0f6647db (diff) | |
| parent | 4483ac2206dd6ed1f80a9d1769a5635b1980d288 (diff) | |
| download | rust-94bc9c737ea97d56f9b4076553ac37c05c1e3931.tar.gz rust-94bc9c737ea97d56f9b4076553ac37c05c1e3931.zip | |
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.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions
