|
| 1 | +error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `&()` |
| 2 | + --> $DIR/sum.rs:4:5 |
| 3 | + | |
| 4 | +LL | vec![(), ()].iter().sum::<i32>(); |
| 5 | + | ^^^^^^^^^^^^^^^^^^^ --- required by a bound introduced by this call |
| 6 | + | | |
| 7 | + | value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=&()>` |
| 8 | + | |
| 9 | + = help: the trait `Sum<&()>` is not implemented for `i32` |
| 10 | + = help: the following other types implement trait `Sum<A>`: |
| 11 | + <i32 as Sum<&'a i32>> |
| 12 | + <i32 as Sum> |
| 13 | +note: required by a bound in `std::iter::Iterator::sum` |
| 14 | + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL |
| 15 | + | |
| 16 | +LL | S: Sum<Self::Item>, |
| 17 | + | ^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::sum` |
| 18 | + |
| 19 | +error[E0277]: a value of type `i32` cannot be made by multiplying all elements of type `&()` from an iterator |
| 20 | + --> $DIR/sum.rs:7:5 |
| 21 | + | |
| 22 | +LL | vec![(), ()].iter().product::<i32>(); |
| 23 | + | ^^^^^^^^^^^^^^^^^^^ ------- required by a bound introduced by this call |
| 24 | + | | |
| 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: required by a bound in `std::iter::Iterator::product` |
| 32 | + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL |
| 33 | + | |
| 34 | +LL | P: Product<Self::Item>, |
| 35 | + | ^^^^^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::product` |
| 36 | + |
| 37 | +error: aborting due to 2 previous errors |
| 38 | + |
| 39 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments