Rollup merge of #104597 - compiler-errors:need_migrate_deref_output_trait_object-msg, r=eholk
Probe + better error messsage for `need_migrate_deref_output_trait_object` 1. Use `InferCtxt::probe` in `need_migrate_deref_output_trait_object` -- that normalization *could* technically do type inference as a side-effect, and this is a lint, so it should have no side-effects. 2. Return the trait-ref so we format the error message correctly. See the UI test change -- `(dyn A + 'static)` is not a trait.
This commit is contained in:
commit
118ee14dd1
3 changed files with 28 additions and 33 deletions
|
|
@ -18,7 +18,7 @@ fn take_a(_: &dyn A) {}
|
|||
|
||||
fn whoops(b: &dyn B) {
|
||||
take_a(b)
|
||||
//~^ ERROR `dyn B` implements `Deref` with supertrait `(dyn A + 'static)` as output
|
||||
//~^ ERROR `dyn B` implements `Deref` with supertrait `A` as output
|
||||
//~^^ WARN this was previously accepted by the compiler but is being phased out;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error: `dyn B` implements `Deref` with supertrait `(dyn A + 'static)` as output
|
||||
error: `dyn B` implements `Deref` with supertrait `A` as output
|
||||
--> $DIR/migrate-lint-deny.rs:20:12
|
||||
|
|
||||
LL | take_a(b)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue