Skip to content

Assigning break to a variable hits type checking errors even outside a loop #13292

Closed
@huonw

Description

@huonw
fn main() { let x = { break }; }
error: cannot determine a type for this local variable: unconstrained type
fn main() { let x = { break }; }
                ^~~~~~~~~~~~~

I would think this should just emit the same error as

fn main() { break }
error: `break` outside of loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions