@@ -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
@@ -894,7 +895,7 @@ impl<'a> From<&'a CString> for Cow<'a, CStr> {
894895 }
895896}
896897
897- #[ cfg( target_has_atomic = "ptr" ) ]
898+ #[ cfg( all ( not ( no_rc ) , not ( no_sync ) , target_has_atomic = "ptr" ) ) ]
898899#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
899900impl From < CString > for Arc < CStr > {
900901 /// Converts a [`CString`] into an <code>[Arc]<[CStr]></code> by moving the [`CString`]
@@ -906,7 +907,7 @@ impl From<CString> for Arc<CStr> {
906907 }
907908}
908909
909- #[ cfg( target_has_atomic = "ptr" ) ]
910+ #[ cfg( all ( not ( no_rc ) , not ( no_sync ) , target_has_atomic = "ptr" ) ) ]
910911#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
911912impl From < & CStr > for Arc < CStr > {
912913 /// Converts a `&CStr` into a `Arc<CStr>`,
@@ -918,7 +919,7 @@ impl From<&CStr> for Arc<CStr> {
918919 }
919920}
920921
921- #[ cfg( target_has_atomic = "ptr" ) ]
922+ #[ cfg( all ( not ( no_rc ) , not ( no_sync ) , target_has_atomic = "ptr" ) ) ]
922923#[ stable( feature = "shared_from_mut_slice" , since = "1.84.0" ) ]
923924impl From < & mut CStr > for Arc < CStr > {
924925 /// Converts a `&mut CStr` into a `Arc<CStr>`,
@@ -929,6 +930,7 @@ impl From<&mut CStr> for Arc<CStr> {
929930 }
930931}
931932
933+ #[ cfg( not( no_rc) ) ]
932934#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
933935impl From < CString > for Rc < CStr > {
934936 /// Converts a [`CString`] into an <code>[Rc]<[CStr]></code> by moving the [`CString`]
@@ -940,6 +942,7 @@ impl From<CString> for Rc<CStr> {
940942 }
941943}
942944
945+ #[ cfg( not( no_rc) ) ]
943946#[ stable( feature = "shared_from_slice2" , since = "1.24.0" ) ]
944947impl From < & CStr > for Rc < CStr > {
945948 /// Converts a `&CStr` into a `Rc<CStr>`,
@@ -951,6 +954,7 @@ impl From<&CStr> for Rc<CStr> {
951954 }
952955}
953956
957+ #[ cfg( not( no_rc) ) ]
954958#[ stable( feature = "shared_from_mut_slice" , since = "1.84.0" ) ]
955959impl From < & mut CStr > for Rc < CStr > {
956960 /// Converts a `&mut CStr` into a `Rc<CStr>`,
@@ -961,6 +965,7 @@ impl From<&mut CStr> for Rc<CStr> {
961965 }
962966}
963967
968+ #[ cfg( not( no_rc) ) ]
964969#[ cfg( not( no_global_oom_handling) ) ]
965970#[ stable( feature = "more_rc_default_impls" , since = "1.80.0" ) ]
966971impl Default for Rc < CStr > {
0 commit comments