Skip to content

std::unreachable #873

@brson

Description

@brson

We need a function in the standard library that indicates unreachable code, specifically for the following case:

fn f() -> int {
  while true { ... }
  std::unreachable()
}

Typestate can't prove that the while loop terminates, so the user has to do it themselves. Implement unreachable as a fail function, then hunt out the places where we're doing this with fail and replace them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions