File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -369,20 +369,19 @@ pub fn create_bcx<'a, 'cfg>(
369369 let target_data = RustcTargetData :: new ( ws, & build_config. requested_kinds ) ?;
370370
371371 let all_packages = & Packages :: All ;
372- let full_specs = if rustdoc_scrape_examples. is_some ( ) {
372+ let need_reverse_dependencies = rustdoc_scrape_examples. is_some ( ) ;
373+ let full_specs = if need_reverse_dependencies {
373374 all_packages
374375 } else {
375376 spec
376377 } ;
377378
378- let specs = spec. to_package_id_specs ( ws) ?;
379379 let resolve_specs = full_specs. to_package_id_specs ( ws) ?;
380- let has_dev_units =
381- if filter. need_dev_deps ( build_config. mode ) || rustdoc_scrape_examples. is_some ( ) {
382- HasDevUnits :: Yes
383- } else {
384- HasDevUnits :: No
385- } ;
380+ let has_dev_units = if filter. need_dev_deps ( build_config. mode ) || need_reverse_dependencies {
381+ HasDevUnits :: Yes
382+ } else {
383+ HasDevUnits :: No
384+ } ;
386385 let resolve = ops:: resolve_ws_with_opts (
387386 ws,
388387 & target_data,
@@ -422,6 +421,11 @@ pub fn create_bcx<'a, 'cfg>(
422421 // Find the packages in the resolver that the user wants to build (those
423422 // passed in with `-p` or the defaults from the workspace), and convert
424423 // Vec<PackageIdSpec> to a Vec<PackageId>.
424+ let specs = if need_reverse_dependencies {
425+ spec. to_package_id_specs ( ws) ?
426+ } else {
427+ resolve_specs. clone ( )
428+ } ;
425429 let to_build_ids = resolve. specs_to_ids ( & specs) ?;
426430 // Now get the `Package` for each `PackageId`. This may trigger a download
427431 // if the user specified `-p` for a dependency that is not downloaded.
You can’t perform that action at this time.
0 commit comments