File tree 2 files changed +4
-2
lines changed
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]> {
1377
1377
impl < ' a > From < & ' a str > for Arc < str > {
1378
1378
#[ inline]
1379
1379
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 ) }
1381
1382
}
1382
1383
}
1383
1384
Original file line number Diff line number Diff line change @@ -1099,7 +1099,8 @@ impl<'a, T: Clone> From<&'a [T]> for Rc<[T]> {
1099
1099
impl < ' a > From < & ' a str > for Rc < str > {
1100
1100
#[ inline]
1101
1101
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 ) }
1103
1104
}
1104
1105
}
1105
1106
You can’t perform that action at this time.
0 commit comments