Skip to content

Incorrect inlay type hint when using itertools::izip! #13613

Closed
@vmalloc

Description

@vmalloc

rust-analyzer version: 0.3.1277-standalone (d03c1c8 2022-11-05)
rustc version: rustc 1.65.0 (897e37553 2022-11-02)

Below is a code snippet that reproduces the issue:

use itertools::izip;

fn main() {
    let nums1 = vec![0f64];
    let nums2 = vec![0f64];
    let bools = vec![false];

    let _x =
        izip!(nums1.iter(), nums2.iter(), bools.iter(),).fold(0f64, |res, (num_1, num_2, boolean)| res);
}

The above code is processed by RA, but the type inlay hint provided for boolean is incorrect:
Screenshot 2022-11-13 at 15 56 52

It is deduced as &f64 whereas it should be deduced as &bool

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions