debug_assert

Module

Implements a debug assert.

These are Mojo built-ins, so you don’t need to import them.

debug_assert

debug_assert(cond: Bool, msg: StringLiteral)

Asserts that the condition is true.

The debug_assert is similar to assert in C++. It is a no-op in release builds.

Args:

  • cond (Bool): The bool value to assert.
  • msg (StringLiteral): The message to display on failure.