about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2020-01-31 16:47:00 -0800
committerEsteban Küber <esteban@kuber.com.ar>2020-02-02 11:53:10 -0800
commit413bfa4b98ac3a59c57ea9fa8cff2d87062fdc23 (patch)
tree877f1b4075dae6f201a8734480da9cd0dbaa5a7a /src/test/ui/impl-trait
parent3ca1c5d5b5e0d19f55570f5d49d97100e9b524b3 (diff)
downloadrust-413bfa4b98ac3a59c57ea9fa8cff2d87062fdc23.tar.gz
rust-413bfa4b98ac3a59c57ea9fa8cff2d87062fdc23.zip
Wording changes to object unsafe trait errors
Stemming from the thread at https://twitter.com/indygreg/status/1223279056398929920
Diffstat (limited to 'src/test/ui/impl-trait')
-rw-r--r--src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr b/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr
index ff4bfc30a4a..1443be0b30e 100644
--- a/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr
+++ b/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr
@@ -1,20 +1,28 @@
 error[E0038]: the trait `NotObjectSafe` cannot be made into an object
   --> $DIR/object-unsafe-trait-in-return-position-dyn-trait.rs:21:13
    |
+LL | trait NotObjectSafe {
+   |       ------------- this trait cannot be made into an object...
 LL |     fn foo() -> Self;
-   |        --- associated function `foo` has no `self` parameter
+   |        --- ...because associated function `foo` has no `self` parameter
 ...
 LL | fn car() -> dyn NotObjectSafe {
    |             ^^^^^^^^^^^^^^^^^ the trait `NotObjectSafe` cannot be made into an object
+   |
+   = help: consider turning `foo` into a method by giving it a `&self` argument or constraining it with `where Self: Sized`
 
 error[E0038]: the trait `NotObjectSafe` cannot be made into an object
   --> $DIR/object-unsafe-trait-in-return-position-dyn-trait.rs:28:13
    |
+LL | trait NotObjectSafe {
+   |       ------------- this trait cannot be made into an object...
 LL |     fn foo() -> Self;
-   |        --- associated function `foo` has no `self` parameter
+   |        --- ...because associated function `foo` has no `self` parameter
 ...
 LL | fn cat() -> Box<dyn NotObjectSafe> {
    |             ^^^^^^^^^^^^^^^^^^^^^^ the trait `NotObjectSafe` cannot be made into an object
+   |
+   = help: consider turning `foo` into a method by giving it a `&self` argument or constraining it with `where Self: Sized`
 
 error: aborting due to 2 previous errors