@@ -6,7 +6,6 @@ use crate::boxed::Box;
66use crate :: rc:: Rc ;
77use crate :: slice:: hack:: into_vec;
88use crate :: string:: String ;
9- use crate :: sync:: Arc ;
109use crate :: vec:: Vec ;
1110use core:: borrow:: Borrow ;
1211use core:: ffi:: { c_char, CStr } ;
@@ -19,6 +18,9 @@ use core::slice;
1918use core:: slice:: memchr;
2019use core:: str:: { self , Utf8Error } ;
2120
21+ #[ cfg( target_has_atomic = "ptr" ) ]
22+ use crate :: sync:: Arc ;
23+
2224/// A type representing an owned, C-compatible, nul-terminated string with no nul bytes in the
2325/// middle.
2426///
@@ -859,6 +861,7 @@ impl<'a> From<&'a CString> for Cow<'a, CStr> {
859861 }
860862}
861863
864+ #[ cfg( target_has_atomic = "ptr" ) ]
862865#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
863866impl From < CString > for Arc < CStr > {
864867 /// Converts a [`CString`] into an <code>[Arc]<[CStr]></code> by moving the [`CString`]
@@ -870,6 +873,7 @@ impl From<CString> for Arc<CStr> {
870873 }
871874}
872875
876+ #[ cfg( target_has_atomic = "ptr" ) ]
873877#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
874878impl From < & CStr > for Arc < CStr > {
875879 /// Converts a `&CStr` into a `Arc<CStr>`,
0 commit comments