From 0afb9c28bb80467cf2af8e9cd1f1b6af63744004 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Fri, 14 Aug 2020 12:08:49 -0700 Subject: Tweak output of E0225 When encountering multiple non-auto trait bounds suggest creating a new trait and explain what auto-traits are. --- .../ui/parser/trait-object-trait-parens.stderr | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/test/ui/parser') diff --git a/src/test/ui/parser/trait-object-trait-parens.stderr b/src/test/ui/parser/trait-object-trait-parens.stderr index 62da99bc47d..6efbfad8f38 100644 --- a/src/test/ui/parser/trait-object-trait-parens.stderr +++ b/src/test/ui/parser/trait-object-trait-parens.stderr @@ -40,34 +40,34 @@ error[E0225]: only auto traits can be used as additional traits in a trait objec --> $DIR/trait-object-trait-parens.rs:8:35 | LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; - | ----- ^^^^^^^^^^^^^^^^^^^ - | | | - | | 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: Obj + for<'a> Trait<'a> {}` + = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object --> $DIR/trait-object-trait-parens.rs:12:49 | LL | let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Obj)>; - | ------------------- ^^^^^ - | | | - | | 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: for<'a> Trait<'a> + Obj {}` + = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object --> $DIR/trait-object-trait-parens.rs:16:38 | LL | let _: Box<(for<'a> Trait<'a>) + (Obj) + (?Sized)>; - | ----------------- ^^^^^ - | | | - | | 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: for<'a> Trait<'a> + Obj {}` + = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error: aborting due to 6 previous errors; 3 warnings emitted -- cgit 1.4.1-3-g733a5