@@ -9,9 +9,10 @@ use core::{fmt, mem, ops, ptr, slice};
99
1010use crate :: borrow:: { Cow , ToOwned } ;
1111use crate :: boxed:: Box ;
12+ #[ cfg( not( no_rc) ) ]
1213use crate :: rc:: Rc ;
1314use crate :: string:: String ;
14- #[ cfg( target_has_atomic = "ptr" ) ]
15+ #[ cfg( all ( not ( no_rc ) , not ( no_sync ) , target_has_atomic = "ptr" ) ) ]
1516use crate :: sync:: Arc ;
1617use crate :: vec:: Vec ;
1718
@@ -898,7 +899,7 @@ impl<'a> From<&'a CString> for Cow<'a, CStr> {
898899 }
899900}
900901
901- #[ cfg( target_has_atomic = "ptr" ) ]
902+ #[ cfg( all ( not ( no_rc ) , not ( no_sync ) , target_has_atomic = "ptr" ) ) ]
902903#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
903904impl From < CString > for Arc < CStr > {
904905 /// Converts a [`CString`] into an <code>[Arc]<[CStr]></code> by moving the [`CString`]
@@ -910,7 +911,7 @@ impl From<CString> for Arc<CStr> {
910911 }
911912}
912913
913- #[ cfg( target_has_atomic = "ptr" ) ]
914+ #[ cfg( all ( not ( no_rc ) , not ( no_sync ) , target_has_atomic = "ptr" ) ) ]
914915#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
915916impl From < & CStr > for Arc < CStr > {
916917 /// Converts a `&CStr` into a `Arc<CStr>`,
@@ -922,7 +923,7 @@ impl From<&CStr> for Arc<CStr> {
922923 }
923924}
924925
925- #[ cfg( target_has_atomic = "ptr" ) ]
926+ #[ cfg( all ( not ( no_rc ) , not ( no_sync ) , target_has_atomic = "ptr" ) ) ]
926927#[ stable( feature = "shared_from_mut_slice" , since = "1.84.0" ) ]
927928impl From < & mut CStr > for Arc < CStr > {
928929 /// Converts a `&mut CStr` into a `Arc<CStr>`,
@@ -933,6 +934,7 @@ impl From<&mut CStr> for Arc<CStr> {
933934 }
934935}
935936
937+ #[ cfg( not( no_rc) ) ]
936938#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
937939impl From < CString > for Rc < CStr > {
938940 /// Converts a [`CString`] into an <code>[Rc]<[CStr]></code> by moving the [`CString`]
@@ -944,6 +946,7 @@ impl From<CString> for Rc<CStr> {
944946 }
945947}
946948
949+ #[ cfg( not( no_rc) ) ]
947950#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
948951impl From < & CStr > for Rc < CStr > {
949952 /// Converts a `&CStr` into a `Rc<CStr>`,
@@ -955,6 +958,7 @@ impl From<&CStr> for Rc<CStr> {
955958 }
956959}
957960
961+ #[ cfg( not( no_rc) ) ]
958962#[ stable( feature = "shared_from_mut_slice" , since = "1.84.0" ) ]
959963impl From < & mut CStr > for Rc < CStr > {
960964 /// Converts a `&mut CStr` into a `Rc<CStr>`,
@@ -965,6 +969,7 @@ impl From<&mut CStr> for Rc<CStr> {
965969 }
966970}
967971
972+ #[ cfg( not( no_rc) ) ]
968973#[ cfg( not( no_global_oom_handling) ) ]
969974#[ stable( feature = "more_rc_default_impls" , since = "1.80.0" ) ]
970975impl Default for Rc < CStr > {
0 commit comments