Skip to content

typeck::_match::check_pat() should record types for fn argument patterns, not just match patterns #6872

Closed
@bblum

Description

@bblum

#6308 needs to walk all variable binding sites, look up the type of the variable, and ensure that it has the Sized kind. But ty::node_id_to_type doesn't work on the pat_ident's node id when the pattern is a function argument.

Other analyses should be able to look up the types of function arguments (...or be able to look up the types of match bindings without special-casing some situations away...) this way too.

I verified this by open-coding the function visitor code in kind::check_fn and deleting the calls to visit_pat, and the rest of the kind::check_pat cases worked fine.

cc @pcwalton

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-grammarArea: The grammar of Rust

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions