Skip to content

"foo() -> !" means something different in fns than in proto! #3295

Closed
@bblum

Description

@bblum

In functions, -> ! indicates the function returns bottom, i.e., doesn't return. In pipe protocol definitions, -> ! means "terminate the session", which is analogous to returning unit (the 1 type), not bottom (the 0 type).

It seems more conceptually in-line to write session-end transitions with no arrow, like ... { continue(T) -> state2, close(U) } ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-concurrencyArea: ConcurrencyA-frontendArea: Compiler frontend (errors, parsing and HIR)A-grammarArea: The grammar of RustA-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions