1- error[E0277]: the trait bound `i32: Sum<()>` is not satisfied
1+ error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()`
22 --> $DIR/invalid-iterator-chain.rs:7:20
33 |
44LL | println!("{}", scores.sum::<i32>());
55 | ^^^^^^ --- required by a bound introduced by this call
66 | |
7- | the trait `Sum<()>` is not implemented for `i32 `
7+ | value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=()> `
88 |
9+ = help: the trait `Sum<()>` is not implemented for `i32`
910 = help: the following other types implement trait `Sum<A>`:
1011 <i32 as Sum<&'a i32>>
1112 <i32 as Sum>
@@ -27,7 +28,7 @@ note: required by a bound in `std::iter::Iterator::sum`
2728LL | S: Sum<Self::Item>,
2829 | ^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::sum`
2930
30- error[E0277]: the trait bound `i32: Sum<()>` is not satisfied
31+ error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()`
3132 --> $DIR/invalid-iterator-chain.rs:10:9
3233 |
3334LL | / vec![0, 1]
@@ -37,10 +38,11 @@ LL | | .map(|x| x as f64)
3738... |
3839LL | | .map(|x| { x + 1 })
3940LL | | .map(|x| { x; })
40- | |____________________________^ the trait `Sum<()>` is not implemented for `i32 `
41+ | |____________________________^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=()> `
4142LL | .sum::<i32>(),
4243 | --- required by a bound introduced by this call
4344 |
45+ = help: the trait `Sum<()>` is not implemented for `i32`
4446 = help: the following other types implement trait `Sum<A>`:
4547 <i32 as Sum<&'a i32>>
4648 <i32 as Sum>
@@ -69,7 +71,7 @@ note: required by a bound in `std::iter::Iterator::sum`
6971LL | S: Sum<Self::Item>,
7072 | ^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::sum`
7173
72- error[E0277]: the trait bound `i32: Sum<f64>` is not satisfied
74+ error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `f64`
7375 --> $DIR/invalid-iterator-chain.rs:22:9
7476 |
7577LL | / vec![0, 1]
@@ -78,10 +80,11 @@ LL | | .map(|x| x * 2)
7880LL | | .map(|x| x as f64)
7981LL | | .filter(|x| *x > 0.0)
8082LL | | .map(|x| { x + 1.0 })
81- | |_________________________________^ the trait `Sum<f64>` is not implemented for `i32 `
83+ | |_________________________________^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=f64> `
8284LL | .sum::<i32>(),
8385 | --- required by a bound introduced by this call
8486 |
87+ = help: the trait `Sum<f64>` is not implemented for `i32`
8588 = help: the following other types implement trait `Sum<A>`:
8689 <i32 as Sum<&'a i32>>
8790 <i32 as Sum>
@@ -106,14 +109,15 @@ note: required by a bound in `std::iter::Iterator::sum`
106109LL | S: Sum<Self::Item>,
107110 | ^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::sum`
108111
109- error[E0277]: the trait bound `i32: Sum<()>` is not satisfied
112+ error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()`
110113 --> $DIR/invalid-iterator-chain.rs:30:20
111114 |
112115LL | println!("{}", vec![0, 1].iter().map(|x| { x; }).sum::<i32>());
113116 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- required by a bound introduced by this call
114117 | |
115- | the trait `Sum<()>` is not implemented for `i32 `
118+ | value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=()> `
116119 |
120+ = help: the trait `Sum<()>` is not implemented for `i32`
117121 = help: the following other types implement trait `Sum<A>`:
118122 <i32 as Sum<&'a i32>>
119123 <i32 as Sum>
@@ -131,14 +135,15 @@ note: required by a bound in `std::iter::Iterator::sum`
131135LL | S: Sum<Self::Item>,
132136 | ^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::sum`
133137
134- error[E0277]: the trait bound `i32: Sum< &()>` is not satisfied
138+ error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type ` &()`
135139 --> $DIR/invalid-iterator-chain.rs:31:20
136140 |
137141LL | println!("{}", vec![(), ()].iter().sum::<i32>());
138142 | ^^^^^^^^^^^^^^^^^^^ --- required by a bound introduced by this call
139143 | |
140- | the trait `Sum<&()>` is not implemented for `i32 `
144+ | value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=&()> `
141145 |
146+ = help: the trait `Sum<&()>` is not implemented for `i32`
142147 = help: the following other types implement trait `Sum<A>`:
143148 <i32 as Sum<&'a i32>>
144149 <i32 as Sum>
0 commit comments