提交 79787833 编写于 作者: T Tim Chevalier

Make sure classes with dtors are still sendable (but not copyable)

上级 475013fc
......@@ -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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册