about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2012-09-18 16:28:16 -0700
committerGraydon Hoare <graydon@mozilla.com>2012-09-18 16:28:16 -0700
commit9b58369f6ba8e01f1965e8aa39e8c7fc25f861cc (patch)
treee7dfa894da8e1d593441229eb2cfe20a13c99343
parente653d493fb8df74bd0583c4f32c882a590135ef1 (diff)
Treat static slices and rptrs as sendable.
-rw-r--r--src/rustc/middle/ty.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs
index b3450b922bb..f0f5a4165cd 100644
--- a/src/rustc/middle/ty.rs
+++ b/src/rustc/middle/ty.rs
@@ -1950,7 +1950,11 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
       // Trait instances are (for now) like shared boxes, basically
       ty_trait(_, _, _) => kind_safe_for_default_mode() | kind_owned(),
 
-      // Region pointers are copyable but NOT owned nor sendable
+      // Static region pointers are copyable and sendable, but not owned
+      ty_rptr(re_static, mt) =>
+      kind_safe_for_default_mode() | mutable_type_kind(cx, mt),
+
+      // General region pointers are copyable but NOT owned nor sendable
       ty_rptr(_, _) => kind_safe_for_default_mode(),
 
       // Unique boxes and vecs have the kind of their contained type,
@@ -1972,6 +1976,9 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
       ty_evec(tm, vstore_box) => {
         remove_send(kind_safe_for_default_mode() | mutable_type_kind(cx, tm))
       }
+      ty_evec(tm, vstore_slice(re_static)) => {
+        kind_safe_for_default_mode() | mutable_type_kind(cx, tm)
+      }
       ty_evec(tm, vstore_slice(_)) => {
         remove_owned_send(kind_safe_for_default_mode() |
                           mutable_type_kind(cx, tm))
@@ -1984,6 +1991,9 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
       ty_estr(vstore_box) => {
         kind_safe_for_default_mode() | kind_const() | kind_owned()
       }
+      ty_estr(vstore_slice(re_static)) => {
+        kind_safe_for_default_mode() | kind_send_copy() | kind_const()
+      }
       ty_estr(vstore_slice(_)) => {
         kind_safe_for_default_mode() | kind_const()
       }