Skip to content

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

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
bblum opened this issue Jun 1, 2013 · 2 comments
Labels
A-grammar Area: The grammar of Rust

Comments

@bblum
Copy link
Contributor

bblum commented Jun 1, 2013

#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

bblum added a commit to bblum/rust that referenced this issue Jun 7, 2013
@emberian
Copy link
Member

emberian commented Aug 5, 2013

Visiting for triage; nothing to add

@nikomatsakis
Copy link
Contributor

I believe I fixed this as part of making irrefutable bindings work. trans, for example, assumes it can find the type for every pattern binding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust
Projects
None yet
Development

No branches or pull requests

3 participants