diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index c2e88bfdbcfb9..98445efafd238 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -330,8 +330,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()) } } }