Skip to content

RA unable to deduce the type of hashmap collected from iterator chain #11072

Closed
@OleStrohm

Description

@OleStrohm

rust-analyzer version: 2021-12-13

rustc version: 1.56.1

In this code example RA seems unable to figure out the type of the HashMap.
This gets resolved either by removing the second map, or by making the tuple something simpler, like ((0, 0), 0).

use std::collections::HashMap;

let _conversions = (0..1)
    .map(|_| (0, ((0, 0, 0), 0)))
    .map(|c| c)
    .collect::<HashMap<_, _>>();

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolutionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions