implements https://github.com/nim-lang/RFCs/issues/258 (#15503)
* implements https://github.com/nim-lang/RFCs/issues/258 * don't be too strict with custom pragma blocks * cast pragmas: documentation * added most missing inference query procs to effecttraits.nim
This commit is contained in:
parent
acd71dd6bb
commit
92163fa330
16 changed files with 232 additions and 68 deletions
|
|
@ -6031,12 +6031,12 @@ so that it can be used for debugging routines marked as ``noSideEffect``.
|
|||
|
||||
|
||||
To override the compiler's side effect analysis a ``{.noSideEffect.}``
|
||||
pragma block can be used:
|
||||
``cast`` pragma block can be used:
|
||||
|
||||
.. code-block:: nim
|
||||
|
||||
func f() =
|
||||
{.noSideEffect.}:
|
||||
{.cast(noSideEffect).}:
|
||||
echo "test"
|
||||
|
||||
|
||||
|
|
@ -7501,7 +7501,7 @@ To disable the GC-safety checking the ``--threadAnalysis:off`` command line
|
|||
switch can be used. This is a temporary workaround to ease the porting effort
|
||||
from old code to the new threading model.
|
||||
|
||||
To override the compiler's gcsafety analysis a ``{.gcsafe.}`` pragma block can
|
||||
To override the compiler's gcsafety analysis a ``{.cast(gcsafe).}`` pragma block can
|
||||
be used:
|
||||
|
||||
.. code-block:: nim
|
||||
|
|
@ -7511,7 +7511,7 @@ be used:
|
|||
perThread {.threadvar.}: string
|
||||
|
||||
proc setPerThread() =
|
||||
{.gcsafe.}:
|
||||
{.cast(gcsafe).}:
|
||||
deepCopy(perThread, someGlobal)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue