@@ -160,7 +160,10 @@ impl TargetTypes {
160
160
pub enum CargoAction {
161
161
Build ,
162
162
Clippy ,
163
- Doc { open : bool } ,
163
+ Doc {
164
+ open : bool ,
165
+ document_private_items : bool ,
166
+ } ,
164
167
Miri ,
165
168
Test ,
166
169
}
@@ -235,11 +238,17 @@ impl Cargo {
235
238
tool_args. extend ( [ "-D" , "warnings" ] ) ;
236
239
}
237
240
}
238
- CargoAction :: Doc { open } => {
241
+ CargoAction :: Doc {
242
+ open,
243
+ document_private_items,
244
+ } => {
239
245
action = "doc" ;
240
246
if self . warnings_as_errors {
241
247
cmd. env ( "RUSTDOCFLAGS" , "-Dwarnings" ) ;
242
248
}
249
+ if document_private_items {
250
+ extra_args. push ( "--document-private-items" ) ;
251
+ }
243
252
if open {
244
253
extra_args. push ( "--open" ) ;
245
254
}
@@ -326,7 +335,10 @@ mod tests {
326
335
#[ test]
327
336
fn test_cargo_command ( ) {
328
337
let cargo = Cargo {
329
- action : CargoAction :: Doc { open : true } ,
338
+ action : CargoAction :: Doc {
339
+ open : true ,
340
+ document_private_items : true ,
341
+ } ,
330
342
features : vec ! [ Feature :: GlobalAllocator ] ,
331
343
packages : vec ! [ Package :: Uefi , Package :: Xtask ] ,
332
344
release : false ,
@@ -336,7 +348,7 @@ mod tests {
336
348
} ;
337
349
assert_eq ! (
338
350
command_to_string( & cargo. command( ) . unwrap( ) ) ,
339
- "RUSTDOCFLAGS=-Dwarnings cargo doc --package uefi --package xtask --features global_allocator --open"
351
+ "RUSTDOCFLAGS=-Dwarnings cargo doc --package uefi --package xtask --features global_allocator --document-private-items -- open"
340
352
) ;
341
353
}
342
354
}
0 commit comments