Make type parameters not implicitly copyable, even if they have the Copy bound.

Consider: T:Copy could be bound to ~T, which is not implicitly copyable.
This commit is contained in:
Niko Matsakis 2013-06-13 17:42:01 -04:00
parent e7b0b71197
commit a9012a2ad1

View file

@ -2273,7 +2273,7 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents {
for type_param_def.bounds.builtin_bounds.each |bound| {
debug!("tc = %s, bound = %?", tc.to_str(), bound);
tc = tc - match bound {
BoundCopy => TypeContents::nonimplicitly_copyable(cx),
BoundCopy => TypeContents::noncopyable(cx),
BoundStatic => TypeContents::nonstatic(cx),
BoundOwned => TypeContents::nonowned(cx),
BoundConst => TypeContents::nonconst(cx),