diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-11-22 00:01:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-22 00:01:09 +0100 |
| commit | 118ee14dd161e91c42de1aebcbf5a72acee79cd5 (patch) | |
| tree | a46832c8dc08c333a6132e4789b90731f6f297ef /src/test | |
| parent | 589d843bd0ff72fd5a720bce63c2e6baa241550b (diff) | |
| parent | 5384af01e3aa5c840cffb0e4f2cb4b1ce6a9ac4e (diff) | |
| download | rust-118ee14dd161e91c42de1aebcbf5a72acee79cd5.tar.gz rust-118ee14dd161e91c42de1aebcbf5a72acee79cd5.zip | |
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.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/traits/trait-upcasting/migrate-lint-deny.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ui/traits/trait-upcasting/migrate-lint-deny.rs b/src/test/ui/traits/trait-upcasting/migrate-lint-deny.rs index c6725101858..5f5a2574bab 100644 --- a/src/test/ui/traits/trait-upcasting/migrate-lint-deny.rs +++ b/src/test/ui/traits/trait-upcasting/migrate-lint-deny.rs @@ -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; } diff --git a/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr b/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr index 6c359b69836..41381a3ffd1 100644 --- a/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr +++ b/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr @@ -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) |
