Prepare chronos for Nim version 1.6 (#226)

This commit is contained in:
Andreas Rumpf 2021-11-19 01:05:47 +01:00 committed by GitHub
parent 0d46e0ff9b
commit cc22234dc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -284,6 +284,7 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
procBody, nnkIteratorDef)
closureIterator.pragma = newNimNode(nnkPragma, lineInfoFrom=prc.body)
closureIterator.addPragma(newIdentNode("closure"))
closureIterator.addPragma(newIdentNode("gcsafe"))
# TODO when push raises is active in a module, the iterator here inherits
# that annotation - here we explicitly disable it again which goes
@ -330,6 +331,7 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
if prc.kind != nnkLambda: # TODO: Nim bug?
prc.addPragma(newColonExpr(ident "stackTrace", ident "off"))
prc.addPragma(newIdentNode("gcsafe"))
result = prc
if subtypeIsVoid: