Skip to content

Block style autodetection should take upvars into account #1474

Closed
@marijnh

Description

@marijnh

This is a slight variation on #1467:

fn main() {
    let x = 3;
    fn blah(_a: fn()) {}
    blah({|| log(error, x); });
}

Compiling that crashes when trans tries to resolve the upvar for x inside the block. I guess typeck should refuse to convert something that has upvars into a bare function. (Or, if we end up dumping bare functions, this would be moot too.)

Metadata

Metadata

Assignees

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