<pre> iter thing() -> uint {} fn main() { for each (uint i in thing()) { fn foo(int x) -> int { ret x; } } } </pre> This is because collect_upvars thinks that x is an upvar of the for each body.