The for syntax in Rust only works with “ordinary” sequential iterators. The abstraction of parallel iteration provided by rayon does thus not work with for syntax. The way you can write something similar to a for loop is by using the for_each method. Of course, printing to stdout is not an operation for which parallelization makes much sense: The elements are potentially printed in a weird order and printing would have to coordinate through a global lock on stdout anyways. Nonetheless, using for_each, you can make your program compile.
Your original code,
for t in arr.par_iter() {
println!("{}, {}", t.int, t.f);
}
now becomes
arr.par_iter().for_each(|t| {
println!("{}, {}", t.int, t.f);
});
The |t| { ... } syntax here is defining a closure. Such a for_each call is a bit more limited than an ordinary for-loop, in that it doesn’t support continue or break or early returns from the containing function. Compared to the for_each method that ordinary iterators offer as well, in the case of rayon’s parallel iterators there are further restrictions around thread-safety that you might encounter, so feel free to ask more questions in case you’re trying to solve some more practical example next and are having trouble getting that to work.