summaryrefslogtreecommitdiffstats
path: root/tests/ui/iterators
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/iterators')
-rw-r--r--tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr6
-rw-r--r--tests/ui/iterators/invalid-iterator-chain.stderr30
2 files changed, 24 insertions, 12 deletions
diff --git a/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr b/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr
index 7f1b9c38e..e728fec29 100644
--- a/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr
+++ b/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr
@@ -1,8 +1,10 @@
error[E0277]: a value of type `f32` cannot be made by summing an iterator over elements of type `{integer}`
- --> $DIR/invalid-iterator-chain-with-int-infer.rs:2:41
+ --> $DIR/invalid-iterator-chain-with-int-infer.rs:2:47
|
LL | let x = Some(()).iter().map(|()| 1).sum::<f32>();
- | ^^^ value of type `f32` cannot be made by summing a `std::iter::Iterator<Item={integer}>`
+ | --- ^^^ value of type `f32` cannot be made by summing a `std::iter::Iterator<Item={integer}>`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sum<{integer}>` is not implemented for `f32`
= help: the following other types implement trait `Sum<A>`:
diff --git a/tests/ui/iterators/invalid-iterator-chain.stderr b/tests/ui/iterators/invalid-iterator-chain.stderr
index a2688107d..b355da5cb 100644
--- a/tests/ui/iterators/invalid-iterator-chain.stderr
+++ b/tests/ui/iterators/invalid-iterator-chain.stderr
@@ -17,10 +17,12 @@ note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()`
- --> $DIR/invalid-iterator-chain.rs:15:27
+ --> $DIR/invalid-iterator-chain.rs:15:33
|
LL | println!("{}", scores.sum::<i32>());
- | ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=()>`
+ | --- ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=()>`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sum<()>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`:
@@ -42,10 +44,12 @@ note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()`
- --> $DIR/invalid-iterator-chain.rs:26:14
+ --> $DIR/invalid-iterator-chain.rs:26:20
|
LL | .sum::<i32>(),
- | ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=()>`
+ | --- ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=()>`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sum<()>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`:
@@ -74,10 +78,12 @@ note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `f64`
- --> $DIR/invalid-iterator-chain.rs:36:14
+ --> $DIR/invalid-iterator-chain.rs:36:20
|
LL | .sum::<i32>(),
- | ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=f64>`
+ | --- ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=f64>`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sum<f64>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`:
@@ -102,10 +108,12 @@ note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()`
- --> $DIR/invalid-iterator-chain.rs:38:54
+ --> $DIR/invalid-iterator-chain.rs:38:60
|
LL | println!("{}", vec![0, 1].iter().map(|x| { x; }).sum::<i32>());
- | ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=()>`
+ | --- ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=()>`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sum<()>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`:
@@ -123,10 +131,12 @@ note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `&()`
- --> $DIR/invalid-iterator-chain.rs:39:40
+ --> $DIR/invalid-iterator-chain.rs:39:46
|
LL | println!("{}", vec![(), ()].iter().sum::<i32>());
- | ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=&()>`
+ | --- ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=&()>`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sum<&()>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`: