Skip to content

False positive with rayon's into_par_iter, fold and reduce #10952

Closed
@jorgecarleitao

Description

@jorgecarleitao

Since I am at it, thanks a lot for this amazing piece of software!

Minimal repro I could come up with:

use std::collections::HashMap;

use rayon::prelude::*;

type C = HashMap<u64, (Vec<u64>, Vec<u64>)>;

fn main() {
    let a = vec![1u64];
    a.into_par_iter()
        .enumerate()
        .fold(C::default, |_, _| todo!())
        .reduce(C::default, |acc, other| todo!());
}

it shows as an error in VS code with the configuration below, but it compiles fine. Changing to type C = HashMap<u64, (u64, u64)>; does not show the error.

rust-analyzer version: rust-analyzer version: 7d6fcbc0b 2021-12-06 stable

rustc version: rustc 1.56.1 (59eed8a2a 2021-11-01)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolutionC-bugCategory: bugS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions