From bc9967f05a4272eb35f543ba6422086b57320ad8 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 16 Sep 2020 23:24:17 +0200 Subject: Revert "Introduce explicit copy (#15330)" (#15346) This reverts commit a3e9cc52343a54cadc7b77b783e1c8b6ba2b327f. --- tests/arc/tcopytosink_warning.nim | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 tests/arc/tcopytosink_warning.nim (limited to 'tests') 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 - -- cgit 1.4.1-2-gfad0