Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
error[E0277]: a value of type
Vec<i32>
cannot be built from an iterator over elements of type&{integer}
--> main.rs:26:44
|
26 | let v4: Vec = [0; 10].into_iter().collect();
| ^^^^^^^ value of type
Vec<i32>
cannot be built fromstd::iter::Iterator<Item=&{integer}>
|
= help: the trait
FromIterator<&{integer}>
is not implemented forVec<i32>
= help: the trait
FromIterator<T>
is implemented forVec<T>
note: the method call chain might not have had the expected associated types
--> main.rs:26:32
|
26 | let v4: Vec = [0; 10].into_iter().collect();
| ------- ^^^^^^^^^^^
Iterator::Item
is&{integer}
here| |
| this expression has type
[{integer}; 10]
note: required by a bound in
collect
--> /Users/hible/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:2049:19
|
2049 | fn collect<B: FromIteratorSelf::Item>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in
Iterator::collect
error: aborting due to previous error
For more information about this error, try
rustc --explain E0277
.