diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-08-12 00:24:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-11 18:24:46 +0200 |
commit | 3f7e1d7daadf4002da1a155d7b98ff7fcca9e2fa (patch) | |
tree | ca733c386244be34e2d0e53b8f79d4e2844b8794 /lib/std/private | |
parent | 48da472dd2e625d2d794907afd33a4a153fa2dc1 (diff) | |
download | Nim-3f7e1d7daadf4002da1a155d7b98ff7fcca9e2fa.tar.gz |
replace `doAssert false` with `raiseAssert` in lib, which works better with strictdefs (#22458)
Diffstat (limited to 'lib/std/private')
-rw-r--r-- | lib/std/private/globs.nim | 2 | ||||
-rw-r--r-- | lib/std/private/osfiles.nim | 2 | ||||
-rw-r--r-- | lib/std/private/ospaths2.nim | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/private/globs.nim b/lib/std/private/globs.nim index 5e3e33cb4..64065aac8 100644 --- a/lib/std/private/globs.nim +++ b/lib/std/private/globs.nim @@ -60,7 +60,7 @@ proc nativeToUnixPath*(path: string): string = result[0] = '/' result[1] = path[0] if path.len > 2 and path[2] != '\\': - doAssert false, "paths like `C:foo` are currently unsupported, path: " & path + raiseAssert "paths like `C:foo` are currently unsupported, path: " & path when DirSep == '\\': result = replace(result, '\\', '/') diff --git a/lib/std/private/osfiles.nim b/lib/std/private/osfiles.nim index 78afd35da..f2e7bf11d 100644 --- a/lib/std/private/osfiles.nim +++ b/lib/std/private/osfiles.nim @@ -396,7 +396,7 @@ proc moveFile*(source, dest: string) {.rtl, extern: "nos$1", if not tryMoveFSObject(source, dest, isDir = false): when defined(windows): - doAssert false + raiseAssert "unreachable" else: # Fallback to copy & del copyFile(source, dest, {cfSymlinkAsIs}) diff --git a/lib/std/private/ospaths2.nim b/lib/std/private/ospaths2.nim index 18a01b104..421def62b 100644 --- a/lib/std/private/ospaths2.nim +++ b/lib/std/private/ospaths2.nim @@ -259,7 +259,7 @@ proc isAbsolute*(path: string): bool {.rtl, noSideEffect, extern: "nos$1", raise # This works around the problem for posix, but Windows is still broken with nim js -d:nodejs result = path[0] == '/' else: - doAssert false # if ever hits here, adapt as needed + raiseAssert "unreachable" # if ever hits here, adapt as needed when FileSystemCaseSensitive: template `!=?`(a, b: char): bool = a != b @@ -859,7 +859,7 @@ when not defined(nimscript): {.emit: "`ret` = process.cwd();".} return $ret elif defined(js): - doAssert false, "use -d:nodejs to have `getCurrentDir` defined" + raiseAssert "use -d:nodejs to have `getCurrentDir` defined" elif defined(windows): var bufsize = MAX_PATH.int32 var res = newWideCString("", bufsize) |