Open
Description
Code
use rayon::iter::{IntoParallelIterator, ParallelIterator};
pub fn parallelize<T>(v: Vec<T>) -> impl ParallelIterator<Item = T>
where
// T: Send,
{
v.into_par_iter()
}
Current output
error[E0599]: the method `into_par_iter` exists for struct `Vec<T>`, but its trait bounds were not satisfied
--> src/lib.rs:7:7
|
7 | v.into_par_iter()
| ^^^^^^^^^^^^^
|
= note: the following trait bounds were not satisfied:
`[T]: Sized`
which is required by `[T]: IntoParallelIterator`
`[T]: ParallelIterator`
which is required by `[T]: IntoParallelIterator`
warning: unused import: `IntoParallelIterator`
--> src/lib.rs:1:19
|
1 | use rayon::iter::{IntoParallelIterator, ParallelIterator};
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Desired output
What's really missing is a T: Send
bound.
Rationale and extra context
No response
Other cases
No response
Rust Version
rustc 1.79.0-beta.3 (f5d04caa7 2024-05-03)
binary: rustc
commit-hash: f5d04caa74a1dfa5ffc4082c2c8f621f25336bbc
commit-date: 2024-05-03
host: x86_64-unknown-linux-gnu
release: 1.79.0-beta.3
LLVM version: 18.1.4
Anything else?
I will try to provide a MCVE. In the meantime, @rustbot label +E-needs-mcve