]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-66923-show-error-for-correct-call.stderr
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / issues / issue-66923-show-error-for-correct-call.stderr
1 error[E0277]: a value of type `Vec<f64>` cannot be built from an iterator over elements of type `&f64`
2   --> $DIR/issue-66923-show-error-for-correct-call.rs:8:39
3    |
4 LL |     let x2: Vec<f64> = x1.into_iter().collect();
5    |                                       ^^^^^^^ value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
6    |
7    = help: the trait `FromIterator<&f64>` is not implemented for `Vec<f64>`
8    = help: the trait `FromIterator<T>` is implemented for `Vec<T>`
9 note: the method call chain might not have had the expected associated types
10   --> $DIR/issue-66923-show-error-for-correct-call.rs:8:27
11    |
12 LL |     let x1: &[f64] = &v;
13    |                      -- this expression has type `&Vec<f64>`
14 LL |     let x2: Vec<f64> = x1.into_iter().collect();
15    |                           ^^^^^^^^^^^ `Iterator::Item` is `&f64` here
16 note: required by a bound in `collect`
17   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
18
19 error[E0277]: a value of type `Vec<f64>` cannot be built from an iterator over elements of type `&f64`
20   --> $DIR/issue-66923-show-error-for-correct-call.rs:12:29
21    |
22 LL |     let x3 = x1.into_iter().collect::<Vec<f64>>();
23    |                             ^^^^^^^ value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
24    |
25    = help: the trait `FromIterator<&f64>` is not implemented for `Vec<f64>`
26    = help: the trait `FromIterator<T>` is implemented for `Vec<T>`
27 note: the method call chain might not have had the expected associated types
28   --> $DIR/issue-66923-show-error-for-correct-call.rs:12:17
29    |
30 LL |     let x1: &[f64] = &v;
31    |                      -- this expression has type `&Vec<f64>`
32 ...
33 LL |     let x3 = x1.into_iter().collect::<Vec<f64>>();
34    |                 ^^^^^^^^^^^ `Iterator::Item` is `&f64` here
35 note: required by a bound in `collect`
36   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
37
38 error: aborting due to 2 previous errors
39
40 For more information about this error, try `rustc --explain E0277`.