Make the implicit copyability of []/~ configurable, like [] is, since we will be switching sooner rather than later.

This commit is contained in:
Michael Sullivan 2012-06-22 11:23:54 -07:00
parent b8710de5ff
commit 986662cebd

View file

@ -1496,7 +1496,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
ty_nil | ty_bot | ty_bool | ty_int(_) | ty_uint(_) | ty_float(_) |
ty_ptr(_) { kind_implicitly_sendable() | kind_const() }
// Implicit copyability of strs is configurable
ty_str {
ty_str | ty_estr(vstore_uniq) {
if cx.vecs_implicitly_copyable {
kind_implicitly_sendable() | kind_const()
} else { kind_sendable() | kind_const() }
@ -1526,7 +1526,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
remove_implicit(mutable_type_kind(cx, tm))
}
// Implicit copyability of vecs is configurable
ty_vec(tm) {
ty_vec(tm) | ty_evec(tm, vstore_uniq) {
if cx.vecs_implicitly_copyable {
mutable_type_kind(cx, tm)
} else { remove_implicit(mutable_type_kind(cx, tm)) }
@ -1544,9 +1544,6 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
kind_implicitly_copyable()
}
}
ty_evec(tm, vstore_uniq) {
remove_implicit(mutable_type_kind(cx, tm))
}
ty_evec(tm, vstore_fixed(_)) {
mutable_type_kind(cx, tm)
}
@ -1554,7 +1551,6 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
// All estrs are copyable; uniques and interiors are sendable.
ty_estr(vstore_box) |
ty_estr(vstore_slice(_)) { kind_implicitly_copyable() | kind_const() }
ty_estr(vstore_uniq) { kind_sendable() | kind_const() }
ty_estr(vstore_fixed(_)) { kind_implicitly_sendable() | kind_const() }
// Records lower to the lowest of their members.