]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/missing-bounds.stderr
Rollup merge of #105526 - Xiretza:iter-from-generator-derive, r=scottmcm
[rust.git] / tests / ui / generic-associated-types / missing-bounds.stderr
1 error: equality constraints are not yet supported in `where` clauses
2   --> $DIR/missing-bounds.rs:37:33
3    |
4 LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
5    |                                 ^^^^^^^^^^^^^^^^^^^^^^ not supported
6    |
7    = note: see issue #20041 <https://github.com/rust-lang/rust/issues/20041> for more information
8 help: if `Output` is an associated type you're trying to set, use the associated type binding syntax
9    |
10 LL | impl<B: Add> Add for E<B> where B: Add<Output = B> {
11    |                                 ~~~~~~~~~~~~~~~~~~
12
13 error[E0308]: mismatched types
14   --> $DIR/missing-bounds.rs:11:11
15    |
16 LL | impl<B> Add for A<B> where B: Add {
17    |      - this type parameter
18 ...
19 LL |         A(self.0 + rhs.0)
20    |         - ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
21    |         |
22    |         arguments to this struct are incorrect
23    |
24    = note: expected type parameter `B`
25              found associated type `<B as Add>::Output`
26 help: the type constructed contains `<B as Add>::Output` due to the type of the argument passed
27   --> $DIR/missing-bounds.rs:11:9
28    |
29 LL |         A(self.0 + rhs.0)
30    |         ^^--------------^
31    |           |
32    |           this argument influences the type of `A`
33 note: tuple struct defined here
34   --> $DIR/missing-bounds.rs:5:8
35    |
36 LL | struct A<B>(B);
37    |        ^
38 help: consider further restricting this bound
39    |
40 LL | impl<B> Add for A<B> where B: Add + Add<Output = B> {
41    |                                   +++++++++++++++++
42
43 error[E0308]: mismatched types
44   --> $DIR/missing-bounds.rs:21:14
45    |
46 LL | impl<B: Add> Add for C<B> {
47    |      - this type parameter
48 ...
49 LL |         Self(self.0 + rhs.0)
50    |         ---- ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
51    |         |
52    |         arguments to this function are incorrect
53    |
54    = note: expected type parameter `B`
55              found associated type `<B as Add>::Output`
56 note: tuple struct defined here
57   --> $DIR/missing-bounds.rs:15:8
58    |
59 LL | struct C<B>(B);
60    |        ^
61 help: consider further restricting this bound
62    |
63 LL | impl<B: Add + Add<Output = B>> Add for C<B> {
64    |             +++++++++++++++++
65
66 error[E0369]: cannot add `B` to `B`
67   --> $DIR/missing-bounds.rs:31:21
68    |
69 LL |         Self(self.0 + rhs.0)
70    |              ------ ^ ----- B
71    |              |
72    |              B
73    |
74 help: consider restricting type parameter `B`
75    |
76 LL | impl<B: std::ops::Add<Output = B>> Add for D<B> {
77    |       +++++++++++++++++++++++++++
78
79 error[E0308]: mismatched types
80   --> $DIR/missing-bounds.rs:42:14
81    |
82 LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
83    |      - this type parameter
84 ...
85 LL |         Self(self.0 + rhs.0)
86    |         ---- ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
87    |         |
88    |         arguments to this function are incorrect
89    |
90    = note: expected type parameter `B`
91              found associated type `<B as Add>::Output`
92 note: tuple struct defined here
93   --> $DIR/missing-bounds.rs:35:8
94    |
95 LL | struct E<B>(B);
96    |        ^
97 help: consider further restricting this bound
98    |
99 LL | impl<B: Add + Add<Output = B>> Add for E<B> where <B as Add>::Output = B {
100    |             +++++++++++++++++
101
102 error: aborting due to 5 previous errors
103
104 Some errors have detailed explanations: E0308, E0369.
105 For more information about an error, try `rustc --explain E0308`.