Skip to content

Commit e305bf8

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

5 files changed

+38
-26
lines changed

src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub fn no_debug() {
66
pub fn no_hash() {
77
use std::collections::HashSet;
88
let mut set = HashSet::new();
9+
//~^ ERROR arrays only have std trait implementations for lengths 0..=32
910
set.insert([0_usize; 33]);
1011
//~^ ERROR arrays only have std trait implementations for lengths 0..=32
1112
}

src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr

+14-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,24 @@ LL | println!("{:?}", [0_usize; 33]);
88
= note: required by `std::fmt::Debug::fmt`
99

1010
error[E0277]: arrays only have std trait implementations for lengths 0..=32
11-
--> $DIR/core-traits-no-impls-length-33.rs:9:16
11+
--> $DIR/core-traits-no-impls-length-33.rs:10:16
1212
|
1313
LL | set.insert([0_usize; 33]);
1414
| ^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[usize; 33]`
1515
|
1616
= note: required because of the requirements on the impl of `std::cmp::Eq` for `[usize; 33]`
1717

18+
error[E0277]: arrays only have std trait implementations for lengths 0..=32
19+
--> $DIR/core-traits-no-impls-length-33.rs:8:19
20+
|
21+
LL | let mut set = HashSet::new();
22+
| ^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[usize; 33]`
23+
|
24+
= note: required because of the requirements on the impl of `std::cmp::Eq` for `[usize; 33]`
25+
= note: required by `std::collections::HashSet::<T>::new`
26+
1827
error[E0369]: binary operation `==` cannot be applied to type `[usize; 33]`
19-
--> $DIR/core-traits-no-impls-length-33.rs:14:19
28+
--> $DIR/core-traits-no-impls-length-33.rs:15:19
2029
|
2130
LL | [0_usize; 33] == [1_usize; 33]
2231
| ------------- ^^ ------------- [usize; 33]
@@ -26,7 +35,7 @@ LL | [0_usize; 33] == [1_usize; 33]
2635
= note: an implementation of `std::cmp::PartialEq` might be missing for `[usize; 33]`
2736

2837
error[E0369]: binary operation `<` cannot be applied to type `[usize; 33]`
29-
--> $DIR/core-traits-no-impls-length-33.rs:19:19
38+
--> $DIR/core-traits-no-impls-length-33.rs:20:19
3039
|
3140
LL | [0_usize; 33] < [1_usize; 33]
3241
| ------------- ^ ------------- [usize; 33]
@@ -36,7 +45,7 @@ LL | [0_usize; 33] < [1_usize; 33]
3645
= note: an implementation of `std::cmp::PartialOrd` might be missing for `[usize; 33]`
3746

3847
error[E0277]: the trait bound `&[usize; 33]: std::iter::IntoIterator` is not satisfied
39-
--> $DIR/core-traits-no-impls-length-33.rs:24:14
48+
--> $DIR/core-traits-no-impls-length-33.rs:25:14
4049
|
4150
LL | for _ in &[0_usize; 33] {
4251
| ^^^^^^^^^^^^^^ the trait `std::iter::IntoIterator` is not implemented for `&[usize; 33]`
@@ -48,7 +57,7 @@ LL | for _ in &[0_usize; 33] {
4857
<&'a mut [T] as std::iter::IntoIterator>
4958
= note: required by `std::iter::IntoIterator::into_iter`
5059

51-
error: aborting due to 5 previous errors
60+
error: aborting due to 6 previous errors
5261

5362
Some errors have detailed explanations: E0277, E0369.
5463
For more information about an error, try `rustc --explain E0277`.
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)