summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2020-08-14 12:08:49 -0700
committerEsteban Küber <esteban@kuber.com.ar>2020-08-14 12:08:49 -0700
commit0afb9c28bb80467cf2af8e9cd1f1b6af63744004 (patch)
treec07f5a0bcff9ff02cf58b3fca552e78be1ae978b /src/test/ui/error-codes
parent3df25ae186e89c885d9a71cd37fbd7a37e39fc85 (diff)
downloadrust-0afb9c28bb80467cf2af8e9cd1f1b6af63744004.tar.gz
rust-0afb9c28bb80467cf2af8e9cd1f1b6af63744004.zip
Tweak output of E0225
When encountering multiple non-auto trait bounds suggest creating a new
trait and explain what auto-traits are.
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0225.stderr13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/test/ui/error-codes/E0225.stderr b/src/test/ui/error-codes/E0225.stderr
index c7a66c327f1..435a2c93962 100644
--- a/src/test/ui/error-codes/E0225.stderr
+++ b/src/test/ui/error-codes/E0225.stderr
@@ -2,12 +2,12 @@ error[E0225]: only auto traits can be used as additional traits in a trait objec
   --> $DIR/E0225.rs:6:36
    |
 LL |     let _: Box<dyn std::io::Read + std::io::Write>;
-   |                    -------------   ^^^^^^^^^^^^^^
-   |                    |               |
-   |                    |               additional non-auto trait
-   |                    |               trait alias used in trait object type (additional use)
+   |                    -------------   ^^^^^^^^^^^^^^ additional non-auto trait
+   |                    |
    |                    first non-auto trait
-   |                    trait alias used in trait object type (first use)
+   |
+   = help: consider creating a new trait with all of these as super-traits and using that trait here instead: `trait NewTrait: std::io::Read + std::io::Write {}`
+   = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
 
 error[E0225]: only auto traits can be used as additional traits in a trait object
   --> $DIR/E0225.rs:8:20
@@ -22,6 +22,9 @@ LL |     let _: Box<dyn Foo>;
    |                    |
    |                    trait alias used in trait object type (additional use)
    |                    trait alias used in trait object type (first use)
+   |
+   = help: consider creating a new trait with all of these as super-traits and using that trait here instead: `trait NewTrait: std::io::Read + std::io::Write {}`
+   = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
 
 error: aborting due to 2 previous errors