refact: Remove assertion effect hiding workaround (#21472)

refact: Remove asseertion effect hiding workaround

There was a code comment to remove after bootstrapping with `nim >= 1.4.0`.

Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
This commit is contained in:
quantimnot
2023-04-21 06:06:20 -04:00
committed by GitHub
parent d76458a6cd
commit 175a83c2de

View File

@@ -38,12 +38,7 @@ proc raiseAssert*(msg: string) {.noinline, noreturn, nosinks.} =
proc failedAssertImpl*(msg: string) {.raises: [], tags: [].} =
## Raises an `AssertionDefect` with `msg`, but this is hidden
## from the effect system. Called when an assertion failed.
# trick the compiler to not list `AssertionDefect` when called
# by `assert`.
# xxx simplify this pending bootstrap >= 1.4.0, after which cast not needed
# anymore since `Defect` can't be raised.
type Hide = proc (msg: string) {.noinline, raises: [], noSideEffect, tags: [].}
cast[Hide](raiseAssert)(msg)
raiseAssert(msg)
template assertImpl(cond: bool, msg: string, expr: string, enabled: static[bool]) =
when enabled: