remove un-needed {.push hint[ConvFromXtoItselfNotNeeded]: off.} in asyncfutures, asyncmacro (#17631)
This commit is contained in:
parent
66890c3ad4
commit
97764c8dc9
2 changed files with 1 additions and 6 deletions
|
|
@ -363,12 +363,10 @@ proc read*[T](future: Future[T] | FutureVar[T]): T =
|
||||||
## this function will fail with a `ValueError` exception.
|
## this function will fail with a `ValueError` exception.
|
||||||
##
|
##
|
||||||
## If the result of the future is an error then that error will be raised.
|
## If the result of the future is an error then that error will be raised.
|
||||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
|
||||||
when future is Future[T]:
|
when future is Future[T]:
|
||||||
let fut = future
|
let fut = future
|
||||||
else:
|
else:
|
||||||
let fut = Future[T](future)
|
let fut = Future[T](future)
|
||||||
{.pop.}
|
|
||||||
if fut.finished:
|
if fut.finished:
|
||||||
if fut.error != nil:
|
if fut.error != nil:
|
||||||
injectStacktrace(fut)
|
injectStacktrace(fut)
|
||||||
|
|
|
||||||
|
|
@ -35,14 +35,11 @@ template createCb(retFutureSym, iteratorNameSym,
|
||||||
|
|
||||||
if next == nil:
|
if next == nil:
|
||||||
if not retFutureSym.finished:
|
if not retFutureSym.finished:
|
||||||
let msg = "Async procedure ($1) yielded `nil`, are you await'ing a " &
|
let msg = "Async procedure ($1) yielded `nil`, are you await'ing a `nil` Future?"
|
||||||
"`nil` Future?"
|
|
||||||
raise newException(AssertionDefect, msg % strName)
|
raise newException(AssertionDefect, msg % strName)
|
||||||
else:
|
else:
|
||||||
{.gcsafe.}:
|
{.gcsafe.}:
|
||||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
|
||||||
next.addCallback cast[proc() {.closure, gcsafe.}](identName)
|
next.addCallback cast[proc() {.closure, gcsafe.}](identName)
|
||||||
{.pop.}
|
|
||||||
except:
|
except:
|
||||||
futureVarCompletions
|
futureVarCompletions
|
||||||
if retFutureSym.finished:
|
if retFutureSym.finished:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue