simplify typing rule for vector addition: use mutability of LHS

This commit is contained in:
Niko Matsakis
2012-04-05 12:06:42 -07:00
parent 79cbdba037
commit b91c9f803d
6 changed files with 516 additions and 15 deletions

View File

@@ -1658,7 +1658,7 @@ mod unsafe {
Does not verify that the vector contains valid UTF-8.
"]
unsafe fn from_bytes(v: [const u8]) -> str unsafe {
let mut vcopy: [u8] = v + [0u8];
let vcopy = v + [0u8];
let scopy: str = ::unsafe::reinterpret_cast(vcopy);
::unsafe::forget(vcopy);
ret scopy;