From 79787833bbf1c705bb1fa877a88339260a90ec11 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 1 Jun 2012 19:54:16 -0700 Subject: [PATCH] Make sure classes with dtors are still sendable (but not copyable) --- src/rustc/middle/ty.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 } -- GitLab