Skip to content

HashSet/HashMap nesting results to methods not being defined properly #25946

Closed
@tijsmaas

Description

@tijsmaas
This compiles just fine:
fn x(input: HashSet<usize>) {
    for i in input.iter() {}
}
This gives compile time error:

no method named iter found for type std::collections::hash::set::HashSet<std::collections::hash::set::HashSet<usize>> in the current scope

fn x(input: HashSet<HashSet<usize>>) {
    for i in input.iter() {}
}

I tested this code on multiple versions of rust using play.rust-lang.org and all versions seem to be affected in the same way. I also noticed that using a HashMap results to the same issue, and in both cases not only iter() is gone, but no single method seems to work. (I only tested iter(), capacity() and clear())

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