Skip to content

Commit 986662c

Browse files
committed
Make the implicit copyability of []/~ configurable, like [] is, since we will be switching sooner rather than later.
1 parent b8710de commit 986662c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/rustc/middle/ty.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
14961496
ty_nil | ty_bot | ty_bool | ty_int(_) | ty_uint(_) | ty_float(_) |
14971497
ty_ptr(_) { kind_implicitly_sendable() | kind_const() }
14981498
// Implicit copyability of strs is configurable
1499-
ty_str {
1499+
ty_str | ty_estr(vstore_uniq) {
15001500
if cx.vecs_implicitly_copyable {
15011501
kind_implicitly_sendable() | kind_const()
15021502
} else { kind_sendable() | kind_const() }
@@ -1526,7 +1526,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
15261526
remove_implicit(mutable_type_kind(cx, tm))
15271527
}
15281528
// Implicit copyability of vecs is configurable
1529-
ty_vec(tm) {
1529+
ty_vec(tm) | ty_evec(tm, vstore_uniq) {
15301530
if cx.vecs_implicitly_copyable {
15311531
mutable_type_kind(cx, tm)
15321532
} else { remove_implicit(mutable_type_kind(cx, tm)) }
@@ -1544,17 +1544,13 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
15441544
kind_implicitly_copyable()
15451545
}
15461546
}
1547-
ty_evec(tm, vstore_uniq) {
1548-
remove_implicit(mutable_type_kind(cx, tm))
1549-
}
15501547
ty_evec(tm, vstore_fixed(_)) {
15511548
mutable_type_kind(cx, tm)
15521549
}
15531550

15541551
// All estrs are copyable; uniques and interiors are sendable.
15551552
ty_estr(vstore_box) |
15561553
ty_estr(vstore_slice(_)) { kind_implicitly_copyable() | kind_const() }
1557-
ty_estr(vstore_uniq) { kind_sendable() | kind_const() }
15581554
ty_estr(vstore_fixed(_)) { kind_implicitly_sendable() | kind_const() }
15591555

15601556
// Records lower to the lowest of their members.

0 commit comments

Comments
 (0)