]> git.lizzy.rs Git - rust.git/blob - src/test/ui/on-unimplemented/sum.stderr
Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
[rust.git] / src / test / ui / on-unimplemented / sum.stderr
1 error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `&()`
2   --> $DIR/sum.rs:4:25
3    |
4 LL |     vec![(), ()].iter().sum::<i32>();
5    |                         ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=&()>`
6    |
7    = help: the trait `Sum<&()>` is not implemented for `i32`
8    = help: the following other types implement trait `Sum<A>`:
9              <i32 as Sum<&'a i32>>
10              <i32 as Sum>
11 note: the method call chain might not have had the expected associated types
12   --> $DIR/sum.rs:4:18
13    |
14 LL |     vec![(), ()].iter().sum::<i32>();
15    |     ------------ ^^^^^^ `Iterator::Item` is `&()` here
16    |     |
17    |     this expression has type `Vec<()>`
18 note: required by a bound in `std::iter::Iterator::sum`
19   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
20
21 error[E0277]: a value of type `i32` cannot be made by multiplying all elements of type `&()` from an iterator
22   --> $DIR/sum.rs:7:25
23    |
24 LL |     vec![(), ()].iter().product::<i32>();
25    |                         ^^^^^^^ value of type `i32` cannot be made by multiplying all elements from a `std::iter::Iterator<Item=&()>`
26    |
27    = help: the trait `Product<&()>` is not implemented for `i32`
28    = help: the following other types implement trait `Product<A>`:
29              <i32 as Product<&'a i32>>
30              <i32 as Product>
31 note: the method call chain might not have had the expected associated types
32   --> $DIR/sum.rs:7:18
33    |
34 LL |     vec![(), ()].iter().product::<i32>();
35    |     ------------ ^^^^^^ `Iterator::Item` is `&()` here
36    |     |
37    |     this expression has type `Vec<()>`
38 note: required by a bound in `std::iter::Iterator::product`
39   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
40
41 error: aborting due to 2 previous errors
42
43 For more information about this error, try `rustc --explain E0277`.