Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vmalloc opened this issue Nov 13, 2022 · 2 comments
Closed

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

vmalloc opened this issue Nov 13, 2022 · 2 comments

Comments

@vmalloc
Copy link

vmalloc commented Nov 13, 2022

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

@lnicola
Copy link
Member

lnicola commented Nov 13, 2022

Duplicate of #11681.

@lnicola lnicola closed this as completed Nov 13, 2022
@vmalloc
Copy link
Author

vmalloc commented Nov 13, 2022

@lnicola thanks! Sorry for spamming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants