summary refs log tree commit diff stats
path: root/lib/pure/asyncmacro.nim
diff options
context:
space:
mode:
authorDanil Yarantsev <tiberiumk12@gmail.com>2020-05-31 13:43:27 +0300
committerGitHub <noreply@github.com>2020-05-31 12:43:27 +0200
commit5150186c68af1fbcc1185d815f52024c4647fe0b (patch)
treeb96dc3af542381a2e658e2ff2c5fd90158d409ce /lib/pure/asyncmacro.nim
parent177c7f96e93c6b8d9d206cd13f22c0d0d7d4192e (diff)
downloadNim-5150186c68af1fbcc1185d815f52024c4647fe0b.tar.gz
Disable unused warnings for await in async macro (#14517)
* Disable unused warnings for await in async macro

* Remove used for the error template
Diffstat (limited to 'lib/pure/asyncmacro.nim')
-rw-r--r--lib/pure/asyncmacro.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/asyncmacro.nim b/lib/pure/asyncmacro.nim
index afc28bbdf..77db80bc6 100644
--- a/lib/pure/asyncmacro.nim
+++ b/lib/pure/asyncmacro.nim
@@ -267,7 +267,7 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
       static:
         error "await expects Future[T], got " & $typeof(f)
 
-    template await[T](f: Future[T]): auto =
+    template await[T](f: Future[T]): auto {.used.} =
       var internalTmpFuture: FutureBase = f
       yield internalTmpFuture
       (cast[type(f)](internalTmpFuture)).read()
@@ -355,4 +355,4 @@ macro multisync*(prc: untyped): untyped =
 # overload for await as a fallback handler, based on the yglukhov's patch to chronos: https://github.com/status-im/nim-chronos/pull/47
 # template await*(f: typed): untyped =
   # static:
-    # error "await only available within {.async.}"
\ No newline at end of file
+    # error "await only available within {.async.}"