add -d:nimStrictMode in CI to keep code from regressing; fixes ConvFromXtoItselfNotNeeded, UnusedImport notes (#16764)

This commit is contained in:
Timothee Cour 2021-02-17 10:30:09 -08:00 • committed by GitHub
commit 31bb67a309
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 43 additions and 23 deletions

View file

@ -5,7 +5,6 @@ proc `$`*(x: int): string {.magic: "IntToStr", noSideEffect.}
when defined(js):
import std/private/since
since (1, 3):
proc `$`*(x: uint): string =
## Caveat: currently implemented as $(cast[int](x)), tied to current

View file

@ -378,7 +378,8 @@ proc reportUnhandledErrorAux(e: ref Exception) {.nodestroy.} =
# ugly, but avoids heap allocations :-)
template xadd(buf, s, slen) =
if L + slen < high(buf):
copyMem(addr(buf[L]), cstring(s), slen)
copyMem(addr(buf[L]), (when s is cstring: s else: cstring(s)), slen)
inc L, slen
template add(buf, s) =
xadd(buf, s, s.len)