Skip to content

Defining a function that takes arguments inside a for-each loop fails during trans #697

Closed
@msullivan

Description

@msullivan
iter thing() -> uint {}
fn main() {
    for each (uint i in thing()) {
        fn foo(int x) -> int { ret x; }
    }
}

This is because collect_upvars thinks that x is an upvar of the for each body.

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