]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/missing-bounds.stderr
Rollup merge of #94019 - hermitcore:target, r=Mark-Simulacrum
[rust.git] / src / test / 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    = note: expected type parameter `B`
23              found associated type `<B as Add>::Output`
24 help: consider further restricting this bound
25    |
26 LL | impl<B> Add for A<B> where B: Add + Add<Output = B> {
27    |                                   +++++++++++++++++
28
29 error[E0308]: mismatched types
30   --> $DIR/missing-bounds.rs:21:14
31    |
32 LL | impl<B: Add> Add for C<B> {
33    |      - this type parameter
34 ...
35 LL |         Self(self.0 + rhs.0)
36    |              ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
37    |
38    = note: expected type parameter `B`
39              found associated type `<B as Add>::Output`
40 help: consider further restricting this bound
41    |
42 LL | impl<B: Add + Add<Output = B>> Add for C<B> {
43    |             +++++++++++++++++
44
45 error[E0369]: cannot add `B` to `B`
46   --> $DIR/missing-bounds.rs:31:21
47    |
48 LL |         Self(self.0 + rhs.0)
49    |              ------ ^ ----- B
50    |              |
51    |              B
52    |
53 help: consider restricting type parameter `B`
54    |
55 LL | impl<B: std::ops::Add<Output = B>> Add for D<B> {
56    |       +++++++++++++++++++++++++++
57
58 error[E0308]: mismatched types
59   --> $DIR/missing-bounds.rs:42:14
60    |
61 LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
62    |      - this type parameter
63 ...
64 LL |         Self(self.0 + rhs.0)
65    |              ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
66    |
67    = note: expected type parameter `B`
68              found associated type `<B as Add>::Output`
69 help: consider further restricting type parameter `B`
70    |
71 LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B, B: Add<Output = B> {
72    |                                                       ++++++++++++++++++++
73
74 error: aborting due to 5 previous errors
75
76 Some errors have detailed explanations: E0308, E0369.
77 For more information about an error, try `rustc --explain E0308`.