]> git.lizzy.rs Git - rust.git/blob - tests/ui/associated-types/issue-22560.stderr
Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt
[rust.git] / tests / ui / associated-types / issue-22560.stderr
1 error[E0225]: only auto traits can be used as additional traits in a trait object
2   --> $DIR/issue-22560.rs:9:23
3    |
4 LL | type Test = dyn Add + Sub;
5    |                 ---   ^^^ additional non-auto trait
6    |                 |
7    |                 first non-auto trait
8    |
9    = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Add + Sub {}`
10    = 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>
11
12 error[E0191]: the value of the associated types `Output` (from trait `Add`), `Output` (from trait `Sub`) must be specified
13   --> $DIR/issue-22560.rs:9:17
14    |
15 LL |     type Output;
16    |     ----------- `Output` defined here
17 ...
18 LL |     type Output;
19    |     ----------- `Output` defined here
20 ...
21 LL | type Test = dyn Add + Sub;
22    |                 ^^^   ^^^ associated type `Output` must be specified
23    |                 |
24    |                 associated type `Output` must be specified
25    |
26 help: specify the associated types
27    |
28 LL | type Test = dyn Add<Output = Type> + Sub<Output = Type>;
29    |                 ~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~
30
31 error[E0393]: the type parameter `Rhs` must be explicitly specified
32   --> $DIR/issue-22560.rs:9:17
33    |
34 LL | trait Add<Rhs=Self> {
35    | ------------------- type parameter `Rhs` must be specified for this
36 ...
37 LL | type Test = dyn Add + Sub;
38    |                 ^^^ help: set the type parameter to the desired type: `Add<Rhs>`
39    |
40    = note: because of the default `Self` reference, type parameters must be specified on object types
41
42 error[E0393]: the type parameter `Rhs` must be explicitly specified
43   --> $DIR/issue-22560.rs:9:23
44    |
45 LL | trait Sub<Rhs=Self> {
46    | ------------------- type parameter `Rhs` must be specified for this
47 ...
48 LL | type Test = dyn Add + Sub;
49    |                       ^^^ help: set the type parameter to the desired type: `Sub<Rhs>`
50    |
51    = note: because of the default `Self` reference, type parameters must be specified on object types
52
53 error: aborting due to 4 previous errors
54
55 Some errors have detailed explanations: E0191, E0225, E0393.
56 For more information about an error, try `rustc --explain E0191`.