summary refs log tree commit diff stats
path: root/compiler/injectdestructors.nim
diff options
context:
space:
mode:
authorcooldome <ariabushenko@gmail.com>2020-09-16 16:26:45 +0100
committerGitHub <noreply@github.com>2020-09-16 17:26:45 +0200
commita3e9cc52343a54cadc7b77b783e1c8b6ba2b327f (patch)
tree53b08cbbc176a3ae27ddbb35a6cbe9521a7ba104 /compiler/injectdestructors.nim
parentae4ede6b009632bd0d809c61066b240e8ee7719a (diff)
downloadNim-a3e9cc52343a54cadc7b77b783e1c8b6ba2b327f.tar.gz
Introduce explicit copy (#15330)
Diffstat (limited to 'compiler/injectdestructors.nim')
-rw-r--r--compiler/injectdestructors.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/injectdestructors.nim b/compiler/injectdestructors.nim
index 9d1f43595..de28c9f70 100644
--- a/compiler/injectdestructors.nim
+++ b/compiler/injectdestructors.nim
@@ -408,7 +408,7 @@ proc passCopyToSink(n: PNode; c: var Con; s: var Scope): PNode =
     if isLValue(n) and not isCapturedVar(n) and n.typ.skipTypes(abstractInst).kind != tyRef and c.inSpawn == 0:
       message(c.graph.config, n.info, hintPerformance,
         ("passing '$1' to a sink parameter introduces an implicit copy; " &
-        "if possible, rearrange your program's control flow to prevent it") % $n)
+         "if possible, rearrange your program's control flow to prevent it or use 'copy($1)' to hint the compiler it is intentional") % $n)
   else:
     if c.graph.config.selectedGC in {gcArc, gcOrc}:
       assert(not containsGarbageCollectedRef(n.typ))