@@ -132,12 +132,12 @@ macro_rules! crate_root {
132132 } ;
133133 }
134134
135- #[ cfg_attr( no_serde_core , path = "core/de/mod.rs" ) ]
135+ #[ cfg_attr( all ( docsrs , if_docsrs_then_no_serde_core ) , path = "core/de/mod.rs" ) ]
136136 pub mod de;
137- #[ cfg_attr( no_serde_core , path = "core/ser/mod.rs" ) ]
137+ #[ cfg_attr( all ( docsrs , if_docsrs_then_no_serde_core ) , path = "core/ser/mod.rs" ) ]
138138 pub mod ser;
139139
140- #[ cfg_attr( no_serde_core , path = "core/format.rs" ) ]
140+ #[ cfg_attr( all ( docsrs , if_docsrs_then_no_serde_core ) , path = "core/format.rs" ) ]
141141 mod format;
142142
143143 #[ doc( inline) ]
@@ -147,7 +147,10 @@ macro_rules! crate_root {
147147
148148 // Used by generated code. Not public API.
149149 #[ doc( hidden) ]
150- #[ cfg_attr( no_serde_core, path = "core/private/mod.rs" ) ]
150+ #[ cfg_attr(
151+ all( docsrs, if_docsrs_then_no_serde_core) ,
152+ path = "core/private/mod.rs"
153+ ) ]
151154 mod private;
152155
153156 // Used by declarative macro generated code. Not public API.
@@ -162,7 +165,7 @@ macro_rules! crate_root {
162165 include!( concat!( env!( "OUT_DIR" ) , "/private.rs" ) ) ;
163166
164167 #[ cfg( all( not( feature = "std" ) , no_core_error) ) ]
165- #[ cfg_attr( no_serde_core , path = "core/std_error.rs" ) ]
168+ #[ cfg_attr( all ( docsrs , if_docsrs_then_no_serde_core ) , path = "core/std_error.rs" ) ]
166169 mod std_error;
167170 } ;
168171}
0 commit comments