about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Holk <eric.holk@gmail.com>2012-07-05 10:25:38 -0700
committerEric Holk <eric.holk@gmail.com>2012-07-05 10:25:38 -0700
commitd93f3c5d835f12614f07c2d840799dd02f4780bc (patch)
tree23598cf176b3bb5bd0a63cd7c38fce70a77c2c5c
parent5bfb5cad3a8d5f9c1819472bcd166f8ed8972b6d (diff)
downloadrust-d93f3c5d835f12614f07c2d840799dd02f4780bc.tar.gz
rust-d93f3c5d835f12614f07c2d840799dd02f4780bc.zip
Arc requires send trait (issue #2788)
-rw-r--r--src/libcore/arc.rs8
-rw-r--r--src/test/run-fail/issue-2444.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/arc.rs b/src/libcore/arc.rs
index ea67f132377..b28830db280 100644
--- a/src/libcore/arc.rs
+++ b/src/libcore/arc.rs
@@ -41,10 +41,10 @@ class arc_destruct<T> {
   }
 }
 
-type arc<T: const> = arc_destruct<T>;
+type arc<T: const send> = arc_destruct<T>;
 
 /// Create an atomically reference counted wrapper.
-fn arc<T: const>(-data: T) -> arc<T> {
+fn arc<T: const send>(-data: T) -> arc<T> {
     let data = ~{mut count: 1, data: data};
     unsafe {
         let ptr = unsafe::transmute(data);
@@ -56,7 +56,7 @@ fn arc<T: const>(-data: T) -> arc<T> {
  * Access the underlying data in an atomically reference counted
  * wrapper.
  */
-fn get<T: const>(rc: &a.arc<T>) -> &a.T {
+fn get<T: const send>(rc: &a.arc<T>) -> &a.T {
     unsafe {
         let ptr: ~arc_data<T> = unsafe::reinterpret_cast((*rc).data);
         // Cast us back into the correct region
@@ -73,7 +73,7 @@ fn get<T: const>(rc: &a.arc<T>) -> &a.T {
  * object. However, one of the `arc` objects can be sent to another task,
  * allowing them to share the underlying data.
  */
-fn clone<T: const>(rc: &arc<T>) -> arc<T> {
+fn clone<T: const send>(rc: &arc<T>) -> arc<T> {
     unsafe {
         let ptr: ~arc_data<T> = unsafe::reinterpret_cast((*rc).data);
         let new_count = rustrt::rust_atomic_increment(&mut ptr.count);
diff --git a/src/test/run-fail/issue-2444.rs b/src/test/run-fail/issue-2444.rs
index 5101de2c46c..3785f83f9f9 100644
--- a/src/test/run-fail/issue-2444.rs
+++ b/src/test/run-fail/issue-2444.rs
@@ -1,6 +1,6 @@
 // error-pattern:explicit failure
 
-enum e<T: const> { e(arc::arc<T>) }
+enum e<T: const send> { e(arc::arc<T>) }
 
 fn foo() -> e<int> {fail;}