clean up SOME pending/xxx/issue link comments (#21826)

* clean up SOME pending/xxx/issue link comments

* great
This commit is contained in:
metagn
2023-05-11 11:23:52 +03:00
committed by GitHub
parent 3a08e2e6ac
commit 02be212dae
35 changed files with 110 additions and 177 deletions

View File

@@ -81,7 +81,6 @@ when not defined(nimscript):
doAssert false
proc setProgramResult*(a: int) =
# pending https://github.com/nim-lang/Nim/issues/14674
when defined(js) and defined(nodejs):
asm """
process.exitCode = `a`;

View File

@@ -110,7 +110,7 @@ func `==`*(x, y: JsBigInt): bool {.importjs: "(# == #)".} =
doAssert big"42" == big"42"
func `**`*(x, y: JsBigInt): JsBigInt {.importjs: "((#) $1 #)".} =
# (#) needed, refs https://github.com/nim-lang/Nim/pull/16409#issuecomment-760550812
# (#) needed due to unary minus
runnableExamples:
doAssert big"2" ** big"64" == big"18446744073709551616"
doAssert big"-2" ** big"3" == big"-8"
@@ -120,8 +120,6 @@ func `**`*(x, y: JsBigInt): JsBigInt {.importjs: "((#) $1 #)".} =
try: discard big"2" ** big"-1" # raises foreign `RangeError`
except: ok = true
doAssert ok
# pending https://github.com/nim-lang/Nim/pull/15940, simplify to:
# doAssertRaises: discard big"2" ** big"-1" # raises foreign `RangeError`
func `and`*(x, y: JsBigInt): JsBigInt {.importjs: "(# & #)".} =
runnableExamples:

View File

@@ -371,7 +371,6 @@ proc toJsonHook*[K: string|cstring, V](t: (Table[K, V] | OrderedTable[K, V]), op
##
## See also:
## * `fromJsonHook proc<#fromJsonHook,,JsonNode>`_
# pending PR #9217 use: toSeq(a) instead of `collect` in `runnableExamples`.
runnableExamples:
import std/[tables, json, sugar]
let foo = (

View File

@@ -155,10 +155,14 @@ when hasCCopyfile:
proc copyfile_state_alloc(): copyfile_state_t
proc copyfile_state_free(state: copyfile_state_t): cint
proc c_copyfile(src, dst: cstring, state: copyfile_state_t, flags: copyfile_flags_t): cint {.importc: "copyfile".}
# replace with `let` pending bootstrap >= 1.4.0
var
COPYFILE_DATA {.nodecl.}: copyfile_flags_t
COPYFILE_XATTR {.nodecl.}: copyfile_flags_t
when (NimMajor, NimMinor) >= (1, 4):
let
COPYFILE_DATA {.nodecl.}: copyfile_flags_t
COPYFILE_XATTR {.nodecl.}: copyfile_flags_t
else:
var
COPYFILE_DATA {.nodecl.}: copyfile_flags_t
COPYFILE_XATTR {.nodecl.}: copyfile_flags_t
{.pop.}
type

View File

@@ -23,8 +23,8 @@ proc add*(x: var string, y: openArray[char]) =
# Use `{.noalias.}` ?
let n = x.len
x.setLen n + y.len
# pending https://github.com/nim-lang/Nim/issues/14655#issuecomment-643671397
# use x.setLen(n + y.len, isInit = false)
# pending #19727
# setLen unnecessarily zeros memory
var i = 0
while i < y.len:
x[n + i] = y[i]

View File

@@ -168,8 +168,10 @@ elif defined(windows):
result = randomBytes(addr dest[0], size)
elif defined(linux) and not defined(nimNoGetRandom) and not defined(emscripten):
# TODO using let, pending bootstrap >= 1.4.0
var SYS_getrandom {.importc: "SYS_getrandom", header: "<sys/syscall.h>".}: clong
when (NimMajor, NimMinor) >= (1, 4):
let SYS_getrandom {.importc: "SYS_getrandom", header: "<sys/syscall.h>".}: clong
else:
var SYS_getrandom {.importc: "SYS_getrandom", header: "<sys/syscall.h>".}: clong
const syscallHeader = """#include <unistd.h>
#include <sys/syscall.h>"""