summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-09-16 23:24:17 +0200
committerGitHub <noreply@github.com>2020-09-16 23:24:17 +0200
commitbc9967f05a4272eb35f543ba6422086b57320ad8 (patch)
tree7b3beacbcf4d21a9dbc1e0667a74828cc263835b /tests
parentd938c6411e399ee1c936fa7b9ee3a1b53ab65791 (diff)
downloadNim-bc9967f05a4272eb35f543ba6422086b57320ad8.tar.gz
Revert "Introduce explicit copy (#15330)" (#15346)
This reverts commit a3e9cc52343a54cadc7b77b783e1c8b6ba2b327f.
Diffstat (limited to 'tests')
-rw-r--r--tests/arc/tcopytosink_warning.nim22
1 files changed, 0 insertions, 22 deletions
diff --git a/tests/arc/tcopytosink_warning.nim b/tests/arc/tcopytosink_warning.nim
deleted file mode 100644
index 8ae36386a..000000000
--- a/tests/arc/tcopytosink_warning.nim
+++ /dev/null
@@ -1,22 +0,0 @@
-discard """
-  cmd: "nim c --gc:arc $file"
-  nimout: '''tcopytosink_warning.nim(17, 7) Hint: myhint [User]
-tcopytosink_warning.nim(19, 9) Hint: passing 'x' to a sink parameter introduces an implicit copy; if possible, rearrange your program's control flow to prevent it or use 'copy(x)' to hint the compiler it is intentional [Performance]
-'''
-  output: "x"
-"""
-import macros
-
-proc test(v: var seq[string], x: sink string) =
-  v.add x
-
-var v = @["a", "b", "c"]
-var x = "x"
-
-static:
-  hint("myhint")
-test(v, copy(x)) # no warning
-test(v, x)  # produces warning
-
-echo x  # use after sink
-