Skip to content

Commit 7978783

Browse files
committed
Make sure classes with dtors are still sendable (but not copyable)
1 parent 475013f commit 7978783

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rustc/middle/ty.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,10 @@ fn remove_implicit(k: kind) -> kind {
13401340
k - kind_(KIND_MASK_IMPLICIT)
13411341
}
13421342

1343+
fn remove_copyable(k: kind) -> kind {
1344+
k - kind_(KIND_MASK_COPY)
1345+
}
1346+
13431347
impl operators for kind {
13441348
fn &(other: kind) -> kind {
13451349
lower_kind(self, other)
@@ -1508,7 +1512,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
15081512
// ...but classes with dtors are never copyable (they can be
15091513
// sendable)
15101514
if ty::has_dtor(cx, did) {
1511-
lowest = lower_kind(lowest, kind_noncopyable());
1515+
lowest = remove_copyable(lowest);
15121516
}
15131517
lowest
15141518
}

0 commit comments

Comments
 (0)