From 8468c40fdef3544169ea5b06b5b9905a5d448495 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 24 Oct 2012 09:47:59 -0700 Subject: [PATCH] Workaround #3850 --- src/test/run-pass/string-self-append.rs | 2 +- src/test/run-pass/vec-ivec-deadlock.rs | 6 +++++- src/test/run-pass/vec-self-append.rs | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/test/run-pass/string-self-append.rs b/src/test/run-pass/string-self-append.rs index a8be417c9555a..9e0442a250909 100644 --- a/src/test/run-pass/string-self-append.rs +++ b/src/test/run-pass/string-self-append.rs @@ -8,7 +8,7 @@ fn main() { while i > 0 { log(error, str::len(a)); assert (str::len(a) == expected_len); - a += a; + a = a + a; // FIXME(#3387)---can't write a += a i -= 1; expected_len *= 2u; } diff --git a/src/test/run-pass/vec-ivec-deadlock.rs b/src/test/run-pass/vec-ivec-deadlock.rs index 5609a76231bc8..d8bef194e4795 100644 --- a/src/test/run-pass/vec-ivec-deadlock.rs +++ b/src/test/run-pass/vec-ivec-deadlock.rs @@ -1 +1,5 @@ -fn main() { let a = ~[1, 2, 3, 4, 5]; let mut b = ~[a, a]; b += b; } +fn main() { + let a = ~[1, 2, 3, 4, 5]; + let mut b = ~[a, a]; + b = b + b; // FIXME(#3387)---can't write b += b +} diff --git a/src/test/run-pass/vec-self-append.rs b/src/test/run-pass/vec-self-append.rs index 1b0475a72cfa5..82fa7103b4dd0 100644 --- a/src/test/run-pass/vec-self-append.rs +++ b/src/test/run-pass/vec-self-append.rs @@ -3,7 +3,7 @@ extern mod std; fn test_heap_to_heap() { // a spills onto the heap let mut a = ~[0, 1, 2, 3, 4]; - a += a; + a = a + a; // FIXME(#3387)---can't write a += a assert (vec::len(a) == 10u); assert (a[0] == 0); assert (a[1] == 1); @@ -21,7 +21,7 @@ fn test_stack_to_heap() { // a is entirely on the stack let mut a = ~[0, 1, 2]; // a spills to the heap - a += a; + a = a + a; // FIXME(#3387)---can't write a += a assert (vec::len(a) == 6u); assert (a[0] == 0); assert (a[1] == 1); @@ -39,7 +39,7 @@ fn test_loop() { while i > 0 { log(error, vec::len(a)); assert (vec::len(a) == expected_len); - a += a; + a = a + a; // FIXME(#3387)---can't write a += a i -= 1; expected_len *= 2u; }