Skip to content

Commit e2e4801

Browse files
committed
Rename tests and add short test description
1 parent d419a5f commit e2e4801

3 files changed

+23
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
// This test checks that errors are showed for lines with `collect` rather than `push` method.
2+
13
fn main() {
24
let v = vec![1_f64, 2.2_f64];
35
let mut fft: Vec<Vec<f64>> = vec![];
46

57
let x1: &[f64] = &v;
68
let x2: Vec<f64> = x1.into_iter().collect();
7-
//~^ ERROR a collection of type
9+
//~^ ERROR a value of type
810
fft.push(x2);
911

1012
let x3 = x1.into_iter().collect::<Vec<f64>>();
11-
//~^ ERROR a collection of type
13+
//~^ ERROR a value of type
1214
fft.push(x3);
1315
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0277]: a value of type `std::vec::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 `std::vec::Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
6+
|
7+
= help: the trait `std::iter::FromIterator<&f64>` is not implemented for `std::vec::Vec<f64>`
8+
9+
error[E0277]: a value of type `std::vec::Vec<f64>` cannot be built from an iterator over elements of type `&f64`
10+
--> $DIR/issue-66923-show-error-for-correct-call.rs:12:29
11+
|
12+
LL | let x3 = x1.into_iter().collect::<Vec<f64>>();
13+
| ^^^^^^^ value of type `std::vec::Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
14+
|
15+
= help: the trait `std::iter::FromIterator<&f64>` is not implemented for `std::vec::Vec<f64>`
16+
17+
error: aborting due to 2 previous errors
18+
19+
For more information about this error, try `rustc --explain E0277`.

src/test/ui/issues/issue-66923.stderr

-19
This file was deleted.

0 commit comments

Comments
 (0)