Skip to content

Document diverging functions, and ⊥, better #7538

Closed
@catamorphism

Description

@catamorphism

As per discussion on IRC, it's surprising at first that return(); is an expression. What's the result type of this expression? Bottom / | , but since you can't write this type explicitly in Rust, it's confusing.

Likewise, it's tempting to invoke fn f() -> ! when trying to explain ⊥, but that's different -- it means "f definitely diverges".

So, document these clearly and precisely in the manual / tutorial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions