diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-06-02 22:03:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-02 16:03:32 +0200 |
commit | 1133f20fe2c834d14454c32d7d9fc2cd1fe8ffa2 (patch) | |
tree | 6eb03f314132d5022d6ebfdc7d4b706dfa8cfb5f /tests/destructor/tv2_cast.nim | |
parent | ead7e20926b1f5ea1b06679947d3d16fcc085e68 (diff) | |
download | Nim-1133f20fe2c834d14454c32d7d9fc2cd1fe8ffa2.tar.gz |
lift the `=dup` hook (#21903)
* fixes tests again * remove helper functions * fixes closures, owned refs * final cleanup
Diffstat (limited to 'tests/destructor/tv2_cast.nim')
-rw-r--r-- | tests/destructor/tv2_cast.nim | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/destructor/tv2_cast.nim b/tests/destructor/tv2_cast.nim index 6fa419996..4ff2dc9a0 100644 --- a/tests/destructor/tv2_cast.nim +++ b/tests/destructor/tv2_cast.nim @@ -3,7 +3,7 @@ discard """ @[116, 101, 115, 116] @[1953719668, 875770417] destroying O1''' - cmd: '''nim c --gc:arc --expandArc:main --expandArc:main1 --expandArc:main2 --expandArc:main3 --hints:off --assertions:off $file''' + cmd: '''nim c --mm:arc --expandArc:main --expandArc:main1 --expandArc:main2 --expandArc:main3 --hints:off --assertions:off $file''' nimout: ''' --expandArc: main @@ -13,8 +13,7 @@ var :tmpD_1 :tmpD_2 data = - `=wasMoved`(:tmpD) - `=copy`(:tmpD, cast[string]( + :tmpD = `=dup`(cast[string]( :tmpD_2 = encode(cast[seq[byte]]( :tmpD_1 = newString(100) :tmpD_1)) @@ -33,8 +32,7 @@ var :tmpD_1 s = newString(100) data = - `=wasMoved`(:tmpD) - `=copy`(:tmpD, cast[string]( + :tmpD = `=dup`(cast[string]( :tmpD_1 = encode(toOpenArrayByte(s, 0, len(s) - 1)) :tmpD_1)) :tmpD @@ -51,8 +49,7 @@ var :tmpD_1 s = newSeq(100) data = - `=wasMoved`(:tmpD) - `=copy`(:tmpD, cast[string]( + :tmpD = `=dup`(cast[string]( :tmpD_1 = encode(s) :tmpD_1)) :tmpD @@ -68,8 +65,7 @@ var :tmpD_1 :tmpD_2 data = - `=wasMoved`(:tmpD) - `=copy`(:tmpD, cast[string]( + :tmpD = `=dup`(cast[string]( :tmpD_2 = encode do: :tmpD_1 = newSeq(100) :tmpD_1 |