Skip to content

error: return in block function #6965

Closed
@lilyball

Description

@lilyball

Current rust incoming doesn't allow me to use return inside a lambda.

std::u8::range(0, 1, |_| return true )

produces (output taken from the IRC rusti bot):

<anon>:10:34: 10:45 error: `return` in block function
<anon>:10          std::u8::range(0, 1, |_| return true )
                                            ^~~~~~~~~~~
note: in expansion of fmt!
<anon>:9:12: 11:7 note: expansion site
error: aborting due to previous error
application terminated with error code 101

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