File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 9191/// ```
9292#[ stable( feature = "rust1" , since = "1.0.0" ) ]
9393#[ 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 \
9595 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}>`" ,
9797) ]
9898pub trait FromIterator < A > : Sized {
9999 /// Creates a value from an iterator.
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ use std::ops::Add;
44
55struct Foo < T , U : FromIterator < T > > ( T , U ) ;
66struct 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`
88struct 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`
1010
1111struct Bounds < T : Copy =String > ( T ) ;
1212//~^ 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`
22 --> $DIR/type-check-defaults.rs:6:19
33 |
44LL | struct Foo<T, U: FromIterator<T>>(T, U);
55 | ---------------------------------------- required by `Foo`
66LL | 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>`
88 |
99 = help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`
1010
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`
1212 --> $DIR/type-check-defaults.rs:8:27
1313 |
1414LL | struct Foo<T, U: FromIterator<T>>(T, U);
1515 | ---------------------------------------- required by `Foo`
1616...
1717LL | 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>`
1919 |
2020 = help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`
2121
Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ fn main() {
33 const l: usize = v. count ( ) ; //~ ERROR attempt to use a non-constant value in a constant
44 let s: [ u32 ; l] = v. into_iter ( ) . collect ( ) ;
55 //~^ ERROR evaluation of constant value failed
6- //~^^ ERROR a collection of type
6+ //~^^ ERROR a value of type
77}
Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ error[E0080]: evaluation of constant value failed
1010LL | let s: [u32; l] = v.into_iter().collect();
1111 | ^ referenced constant has errors
1212
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}`
1414 --> $DIR/type-dependent-def-issue-49241.rs:4:37
1515 |
1616LL | 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}>`
1818 |
1919 = help: the trait `std::iter::FromIterator<{integer}>` is not implemented for `[u32; _]`
2020
You can’t perform that action at this time.
0 commit comments