revert #20719; relieve std/assertions of the sysFatal dep (#20743)

* Revert "make `system/fatal` importable (#20718)"

This reverts commit d735c447d3.

* relieve `std/assertions` of the sysFatal dep
This commit is contained in:
ringabout 2022-11-04 16:53:19 +08:00 • committed by GitHub
commit 12a20b9fb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 28 deletions

View file

@ -1637,13 +1637,8 @@ when not defined(nimscript):
## for debug builds. Since it's usually used for debugging, this
## is proclaimed to have no IO effect!
when defined(nimHasExceptionsQuery):
const gotoBasedExceptions = compileOption("exceptions", "goto")
else:
const gotoBasedExceptions = false
import system/fatal
when not declared(sysFatal):
include "system/fatal"
when not defined(nimscript):
{.push stackTrace: off, profiler: off.}
@ -1656,6 +1651,12 @@ when not defined(nimscript):
when defined(nimV2):
include system/arc
template newException*(exceptn: typedesc, message: string;
parentException: ref Exception = nil): untyped =
## Creates an exception object of type `exceptn` and sets its `msg` field
## to `message`. Returns the new exception object.
(ref exceptn)(msg: message, parent: parentException)
when not defined(nimPreviewSlimSystem):
{.deprecated: "assertions is about to move out of system; use `-d:nimPreviewSlimSystem` and import `std/assertions`".}
import std/assertions
@ -1863,12 +1864,6 @@ proc debugEcho*(x: varargs[typed, `$`]) {.magic: "Echo", noSideEffect,
## for debugging routines marked as `noSideEffect
## <manual.html#pragmas-nosideeffect-pragma>`_.
template newException*(exceptn: typedesc, message: string;
parentException: ref Exception = nil): untyped =
## Creates an exception object of type `exceptn` and sets its `msg` field
## to `message`. Returns the new exception object.
(ref exceptn)(msg: message, parent: parentException)
when hostOS == "standalone" and defined(nogc):
proc nimToCStringConv(s: NimString): cstring {.compilerproc, inline.} =
if s == nil or s.len == 0: result = cstring""