summary refs log tree commit diff
path: root/src/rustc
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-06-01 19:54:16 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-06-01 20:40:35 -0700
commit79787833bbf1c705bb1fa877a88339260a90ec11 (patch)
tree2711379b071df16672bf70a95970126060147021 /src/rustc
parent475013fcb60607130b7661f601eee3391ac2bd47 (diff)
downloadrust-79787833bbf1c705bb1fa877a88339260a90ec11.tar.gz
rust-79787833bbf1c705bb1fa877a88339260a90ec11.zip
Make sure classes with dtors are still sendable (but not copyable)
Diffstat (limited to 'src/rustc')
-rw-r--r--src/rustc/middle/ty.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs
index 95ed681c481..fd6b797d559 100644
--- a/src/rustc/middle/ty.rs
+++ b/src/rustc/middle/ty.rs
@@ -1340,6 +1340,10 @@ fn remove_implicit(k: kind) -> kind {
     k - kind_(KIND_MASK_IMPLICIT)
 }
 
+fn remove_copyable(k: kind) -> kind {
+    k - kind_(KIND_MASK_COPY)
+}
+
 impl operators for kind {
     fn &(other: kind) -> kind {
         lower_kind(self, other)
@@ -1508,7 +1512,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
         // ...but classes with dtors are never copyable (they can be
         // sendable)
         if ty::has_dtor(cx, did) {
-           lowest = lower_kind(lowest, kind_noncopyable());
+           lowest = remove_copyable(lowest);
         }
         lowest
       }