Skip to content

assert! terminates rusti REPL #5774

Closed
Closed
@danluu

Description

@danluu

Perhaps this is expected behavior in order to maintain consistency, but, as a newcomer to rust, this surprised me, and it seems mildly inconvenient.

rusti> assert!(false); rust: task failed at 'assertion failed: false', <anon>:34 terminate called throwing an exception Abort trap: 6

By comparison, other languages I'm familiar with throw an error and then return you to the REPL:
Scala:
scala> assert (false) java.lang.AssertionError: assertion failed ... scala>

Ocaml:
utop $ assert(0 == 1);; Exception: (Assert_failure //toplevel// 1 0) utop $

Python:
p> assert(0) Traceback (most recent call last): File "<stdin>", line 1, in <module> AssertionError p>

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