@@ -160,7 +160,10 @@ impl TargetTypes {
160160pub enum CargoAction {
161161 Build ,
162162 Clippy ,
163- Doc { open : bool } ,
163+ Doc {
164+ open : bool ,
165+ document_private_items : bool ,
166+ } ,
164167 Miri ,
165168 Test ,
166169}
@@ -235,11 +238,17 @@ impl Cargo {
235238 tool_args. extend ( [ "-D" , "warnings" ] ) ;
236239 }
237240 }
238- CargoAction :: Doc { open } => {
241+ CargoAction :: Doc {
242+ open,
243+ document_private_items,
244+ } => {
239245 action = "doc" ;
240246 if self . warnings_as_errors {
241247 cmd. env ( "RUSTDOCFLAGS" , "-Dwarnings" ) ;
242248 }
249+ if document_private_items {
250+ extra_args. push ( "--document-private-items" ) ;
251+ }
243252 if open {
244253 extra_args. push ( "--open" ) ;
245254 }
@@ -326,7 +335,10 @@ mod tests {
326335 #[ test]
327336 fn test_cargo_command ( ) {
328337 let cargo = Cargo {
329- action : CargoAction :: Doc { open : true } ,
338+ action : CargoAction :: Doc {
339+ open : true ,
340+ document_private_items : true ,
341+ } ,
330342 features : vec ! [ Feature :: GlobalAllocator ] ,
331343 packages : vec ! [ Package :: Uefi , Package :: Xtask ] ,
332344 release : false ,
@@ -336,7 +348,7 @@ mod tests {
336348 } ;
337349 assert_eq ! (
338350 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"
340352 ) ;
341353 }
342354}
0 commit comments