From 986662cebd3f41911cb72c18f4e824a4856b009b Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Fri, 22 Jun 2012 11:23:54 -0700 Subject: [PATCH] Make the implicit copyability of []/~ configurable, like [] is, since we will be switching sooner rather than later. --- src/rustc/middle/ty.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index 3083563d220..6663413d34d 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -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.