about summary refs log tree commit diff
path: root/tests/ui/impl-trait
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-11-27 03:34:56 +0000
committerMichael Goulet <michael@errs.io>2024-11-27 03:34:58 +0000
commit4c0ea55f403d319ce7da693483b39090240e2c97 (patch)
tree64b291a5f5b60dc7c42d7348509f1952353f9f00 /tests/ui/impl-trait
parent72cd7ac4f13ff37cb21c2cbdf2dbac6000a11dd9 (diff)
downloadrust-4c0ea55f403d319ce7da693483b39090240e2c97.tar.gz
rust-4c0ea55f403d319ce7da693483b39090240e2c97.zip
Bless tests due to extra error reporting due to normalizing types that are not WF
It's okay though b/c these are duplicated diagnostics.
Diffstat (limited to 'tests/ui/impl-trait')
-rw-r--r--tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr
index 8716088ccbd..9ed3d21c13c 100644
--- a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr
+++ b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr
@@ -261,8 +261,11 @@ error[E0746]: return type cannot have an unboxed trait object
 LL | fn bat() -> dyn Trait {
    |             ^^^^^^^^^ doesn't have a size known at compile-time
    |
-   = help: if there were a single returned type, you could use `impl Trait` instead
-help: box the return type, and wrap all of the returned values in `Box::new`
+help: consider returning an `impl Trait` instead of a `dyn Trait`
+   |
+LL | fn bat() -> impl Trait {
+   |             ~~~~
+help: alternatively, box the return type, and wrap all of the returned values in `Box::new`
    |
 LL ~ fn bat() -> Box<dyn Trait> {
 LL |     if true {
@@ -277,8 +280,11 @@ error[E0746]: return type cannot have an unboxed trait object
 LL | fn bay() -> dyn Trait {
    |             ^^^^^^^^^ doesn't have a size known at compile-time
    |
-   = help: if there were a single returned type, you could use `impl Trait` instead
-help: box the return type, and wrap all of the returned values in `Box::new`
+help: consider returning an `impl Trait` instead of a `dyn Trait`
+   |
+LL | fn bay() -> impl Trait {
+   |             ~~~~
+help: alternatively, box the return type, and wrap all of the returned values in `Box::new`
    |
 LL ~ fn bay() -> Box<dyn Trait> {
 LL |     if true {