File tree 1 file changed +12
-8
lines changed
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>(
369
369
let target_data = RustcTargetData :: new ( ws, & build_config. requested_kinds ) ?;
370
370
371
371
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 {
373
374
all_packages
374
375
} else {
375
376
spec
376
377
} ;
377
378
378
- let specs = spec. to_package_id_specs ( ws) ?;
379
379
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
+ } ;
386
385
let resolve = ops:: resolve_ws_with_opts (
387
386
ws,
388
387
& target_data,
@@ -422,6 +421,11 @@ pub fn create_bcx<'a, 'cfg>(
422
421
// Find the packages in the resolver that the user wants to build (those
423
422
// passed in with `-p` or the defaults from the workspace), and convert
424
423
// 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
+ } ;
425
429
let to_build_ids = resolve. specs_to_ids ( & specs) ?;
426
430
// Now get the `Package` for each `PackageId`. This may trigger a download
427
431
// if the user specified `-p` for a dependency that is not downloaded.
You can’t perform that action at this time.
0 commit comments