diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index 33c8e94e32b6..31f37a8a1bbd 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -331,8 +331,7 @@ impl IntoStr for Vec { #[inline] fn into_string(self) -> String { unsafe { - let s: &str = mem::transmute(self.as_slice()); - String::from_str(s) + string::raw::from_utf8(self.into_bytes()) } } }