summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorAnatoly Galiulin <galiulin.anatoly@gmail.com>2016-03-25 16:41:48 +0600
committerAnatoly Galiulin <galiulin.anatoly@gmail.com>2016-03-31 16:47:55 +0600
commitebc02f6dc0dd15f0ec34a8c0f22432ca49c71c5b (patch)
treec188e05a7e15e7e2d323b6498a0ba2badfc8dc96 /lib/system.nim
parentd836028fe7b18c93c9a9751f470da387eab09af1 (diff)
downloadNim-ebc02f6dc0dd15f0ec34a8c0f22432ca49c71c5b.tar.gz
Fix ``XDeclaredButNotUsed`` warning when locks or rlocks module is used
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/system.nim b/lib/system.nim
index fefabe53f..03b9e158a 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -2561,6 +2561,16 @@ else:
     if x < 0: -x else: x
 {.pop.}
 
+proc compiles*(x: expr): bool {.magic: "Compiles", noSideEffect, compileTime.} =
+  ## Special compile-time procedure that checks whether `x` can be compiled
+  ## without any semantic error.
+  ## This can be used to check whether a type supports some operation:
+  ##
+  ## .. code-block:: Nim
+  ##   when not compiles(3 + 4):
+  ##     echo "'+' for integers is available"
+  discard
+
 when not defined(JS): #and not defined(nimscript):
   {.push stack_trace: off, profiler:off.}
 
@@ -3469,16 +3479,6 @@ when hasAlloc:
       x[j+i] = item[j]
       inc(j)
 
-proc compiles*(x: expr): bool {.magic: "Compiles", noSideEffect, compileTime.} =
-  ## Special compile-time procedure that checks whether `x` can be compiled
-  ## without any semantic error.
-  ## This can be used to check whether a type supports some operation:
-  ##
-  ## .. code-block:: Nim
-  ##   when not compiles(3 + 4):
-  ##     echo "'+' for integers is available"
-  discard
-
 when declared(initDebugger):
   initDebugger()