]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/missing-bounds.stderr
Rollup merge of #82308 - estebank:issue-82290, r=lcnr
[rust.git] / src / test / ui / generic-associated-types / missing-bounds.stderr
1 error[E0308]: mismatched types
2   --> $DIR/missing-bounds.rs:11:11
3    |
4 LL | impl<B> Add for A<B> where B: Add {
5    |      - this type parameter
6 ...
7 LL |         A(self.0 + rhs.0)
8    |           ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
9    |
10    = note: expected type parameter `B`
11              found associated type `<B as Add>::Output`
12 help: consider further restricting this bound
13    |
14 LL | impl<B> Add for A<B> where B: Add + Add<Output = B> {
15    |                                   ^^^^^^^^^^^^^^^^^
16
17 error[E0308]: mismatched types
18   --> $DIR/missing-bounds.rs:21:14
19    |
20 LL | impl<B: Add> Add for C<B> {
21    |      - this type parameter
22 ...
23 LL |         Self(self.0 + rhs.0)
24    |              ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
25    |
26    = note: expected type parameter `B`
27              found associated type `<B as Add>::Output`
28 help: consider further restricting this bound
29    |
30 LL | impl<B: Add + Add<Output = B>> Add for C<B> {
31    |             ^^^^^^^^^^^^^^^^^
32
33 error[E0369]: cannot add `B` to `B`
34   --> $DIR/missing-bounds.rs:31:21
35    |
36 LL |         Self(self.0 + rhs.0)
37    |              ------ ^ ----- B
38    |              |
39    |              B
40    |
41 help: consider restricting type parameter `B`
42    |
43 LL | impl<B: std::ops::Add<Output = B>> Add for D<B> {
44    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
45
46 error: aborting due to 3 previous errors
47
48 Some errors have detailed explanations: E0308, E0369.
49 For more information about an error, try `rustc --explain E0308`.