File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1377,7 +1377,8 @@ impl<'a, T: Clone> From<&'a [T]> for Arc<[T]> {
13771377impl < ' a > From < & ' a str > for Arc < str > {
13781378 #[ inline]
13791379 fn from ( v : & str ) -> Arc < str > {
1380- unsafe { mem:: transmute ( <Arc < [ u8 ] > >:: from ( v. as_bytes ( ) ) ) }
1380+ let arc = Arc :: < [ u8 ] > :: from ( v. as_bytes ( ) ) ;
1381+ unsafe { Arc :: from_raw ( Arc :: into_raw ( arc) as * const str ) }
13811382 }
13821383}
13831384
Original file line number Diff line number Diff line change @@ -1099,7 +1099,8 @@ impl<'a, T: Clone> From<&'a [T]> for Rc<[T]> {
10991099impl < ' a > From < & ' a str > for Rc < str > {
11001100 #[ inline]
11011101 fn from ( v : & str ) -> Rc < str > {
1102- unsafe { mem:: transmute ( <Rc < [ u8 ] > >:: from ( v. as_bytes ( ) ) ) }
1102+ let rc = Rc :: < [ u8 ] > :: from ( v. as_bytes ( ) ) ;
1103+ unsafe { Rc :: from_raw ( Rc :: into_raw ( rc) as * const str ) }
11031104 }
11041105}
11051106
You can’t perform that action at this time.
0 commit comments