File tree 5 files changed +11
-11
lines changed
5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 91
91
/// ```
92
92
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
93
93
#[ rustc_on_unimplemented(
94
- message="a collection of type `{Self}` cannot be built from an iterator \
94
+ message="a value of type `{Self}` cannot be built from an iterator \
95
95
over elements of type `{A}`",
96
- label="a collection of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`" ,
96
+ label="value of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`" ,
97
97
) ]
98
98
pub trait FromIterator < A > : Sized {
99
99
/// Creates a value from an iterator.
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ use std::ops::Add;
4
4
5
5
struct Foo < T , U : FromIterator < T > > ( T , U ) ;
6
6
struct WellFormed < Z = Foo < i32 , i32 > > ( Z ) ;
7
- //~^ ERROR a collection of type `i32` cannot be built from an iterator over elements of type `i32`
7
+ //~^ ERROR a value of type `i32` cannot be built from an iterator over elements of type `i32`
8
8
struct WellFormedNoBounds < Z : ?Sized = Foo < i32 , i32 > > ( Z ) ;
9
- //~^ ERROR a collection of type `i32` cannot be built from an iterator over elements of type `i32`
9
+ //~^ ERROR a value of type `i32` cannot be built from an iterator over elements of type `i32`
10
10
11
11
struct Bounds < T : Copy =String > ( T ) ;
12
12
//~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
Original file line number Diff line number Diff line change 1
- error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32`
1
+ error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
2
2
--> $DIR/type-check-defaults.rs:6:19
3
3
|
4
4
LL | struct Foo<T, U: FromIterator<T>>(T, U);
5
5
| ---------------------------------------- required by `Foo`
6
6
LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
7
- | ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
7
+ | ^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
8
8
|
9
9
= help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`
10
10
11
- error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32`
11
+ error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
12
12
--> $DIR/type-check-defaults.rs:8:27
13
13
|
14
14
LL | struct Foo<T, U: FromIterator<T>>(T, U);
15
15
| ---------------------------------------- required by `Foo`
16
16
...
17
17
LL | struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
18
- | ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
18
+ | ^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
19
19
|
20
20
= help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`
21
21
Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ fn main() {
3
3
const l: usize = v. count ( ) ; //~ ERROR attempt to use a non-constant value in a constant
4
4
let s: [ u32 ; l] = v. into_iter ( ) . collect ( ) ;
5
5
//~^ ERROR evaluation of constant value failed
6
- //~^^ ERROR a collection of type
6
+ //~^^ ERROR a value of type
7
7
}
Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ error[E0080]: evaluation of constant value failed
10
10
LL | let s: [u32; l] = v.into_iter().collect();
11
11
| ^ referenced constant has errors
12
12
13
- error[E0277]: a collection of type `[u32; _]` cannot be built from an iterator over elements of type `{integer}`
13
+ error[E0277]: a value of type `[u32; _]` cannot be built from an iterator over elements of type `{integer}`
14
14
--> $DIR/type-dependent-def-issue-49241.rs:4:37
15
15
|
16
16
LL | let s: [u32; l] = v.into_iter().collect();
17
- | ^^^^^^^ a collection of type `[u32; _]` cannot be built from `std::iter::Iterator<Item={integer}>`
17
+ | ^^^^^^^ value of type `[u32; _]` cannot be built from `std::iter::Iterator<Item={integer}>`
18
18
|
19
19
= help: the trait `std::iter::FromIterator<{integer}>` is not implemented for `[u32; _]`
20
20
You can’t perform that action at this time.
0 commit comments