diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-06-01 19:54:16 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-06-01 20:40:35 -0700 |
| commit | 79787833bbf1c705bb1fa877a88339260a90ec11 (patch) | |
| tree | 2711379b071df16672bf70a95970126060147021 /src/rustc | |
| parent | 475013fcb60607130b7661f601eee3391ac2bd47 (diff) | |
| download | rust-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.rs | 6 |
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 } |
