@@ -6,7 +6,6 @@ use crate::boxed::Box;
6
6
use crate :: rc:: Rc ;
7
7
use crate :: slice:: hack:: into_vec;
8
8
use crate :: string:: String ;
9
- use crate :: sync:: Arc ;
10
9
use crate :: vec:: Vec ;
11
10
use core:: borrow:: Borrow ;
12
11
use core:: ffi:: { c_char, CStr } ;
@@ -19,6 +18,9 @@ use core::slice;
19
18
use core:: slice:: memchr;
20
19
use core:: str:: { self , Utf8Error } ;
21
20
21
+ #[ cfg( target_has_atomic = "ptr" ) ]
22
+ use crate :: sync:: Arc ;
23
+
22
24
/// A type representing an owned, C-compatible, nul-terminated string with no nul bytes in the
23
25
/// middle.
24
26
///
@@ -859,6 +861,7 @@ impl<'a> From<&'a CString> for Cow<'a, CStr> {
859
861
}
860
862
}
861
863
864
+ #[ cfg( target_has_atomic = "ptr" ) ]
862
865
#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
863
866
impl From < CString > for Arc < CStr > {
864
867
/// Converts a [`CString`] into an <code>[Arc]<[CStr]></code> by moving the [`CString`]
@@ -870,6 +873,7 @@ impl From<CString> for Arc<CStr> {
870
873
}
871
874
}
872
875
876
+ #[ cfg( target_has_atomic = "ptr" ) ]
873
877
#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
874
878
impl From < & CStr > for Arc < CStr > {
875
879
/// Converts a `&CStr` into a `Arc<CStr>`,
0 commit comments