File tree Expand file tree Collapse file tree 3 files changed +5
-28
lines changed Expand file tree Collapse file tree 3 files changed +5
-28
lines changed Original file line number Diff line number Diff line change @@ -362,6 +362,10 @@ fn add_pkg(
362
362
if !opts. edge_kinds . contains ( & EdgeKind :: Dep ( dep. kind ( ) ) ) {
363
363
return false ;
364
364
}
365
+ // Filter out proc-macrcos if requested.
366
+ if opts. no_proc_macro && graph. package_for_id ( dep_id) . proc_macro ( ) {
367
+ return false ;
368
+ }
365
369
if dep. is_optional ( ) {
366
370
// If the new feature resolver does not enable this
367
371
// optional dep, then don't use it.
Original file line number Diff line number Diff line change @@ -267,7 +267,6 @@ fn print(
267
267
opts. prefix ,
268
268
opts. no_dedupe ,
269
269
opts. max_display_depth ,
270
- opts. no_proc_macro ,
271
270
& mut visited_deps,
272
271
& mut levels_continue,
273
272
& mut print_stack,
@@ -288,7 +287,6 @@ fn print_node<'a>(
288
287
prefix : Prefix ,
289
288
no_dedupe : bool ,
290
289
max_display_depth : u32 ,
291
- no_proc_macro : bool ,
292
290
visited_deps : & mut HashSet < usize > ,
293
291
levels_continue : & mut Vec < bool > ,
294
292
print_stack : & mut Vec < usize > ,
@@ -348,7 +346,6 @@ fn print_node<'a>(
348
346
prefix,
349
347
no_dedupe,
350
348
max_display_depth,
351
- no_proc_macro,
352
349
visited_deps,
353
350
levels_continue,
354
351
print_stack,
@@ -369,7 +366,6 @@ fn print_dependencies<'a>(
369
366
prefix : Prefix ,
370
367
no_dedupe : bool ,
371
368
max_display_depth : u32 ,
372
- no_proc_macro : bool ,
373
369
visited_deps : & mut HashSet < usize > ,
374
370
levels_continue : & mut Vec < bool > ,
375
371
print_stack : & mut Vec < usize > ,
@@ -405,19 +401,6 @@ fn print_dependencies<'a>(
405
401
406
402
let mut it = deps
407
403
. iter ( )
408
- . filter ( |dep| {
409
- // Filter out proc-macro dependencies.
410
- if no_proc_macro {
411
- match graph. node ( * * dep) {
412
- & Node :: Package { package_id, .. } => {
413
- !graph. package_for_id ( package_id) . proc_macro ( )
414
- }
415
- _ => true ,
416
- }
417
- } else {
418
- true
419
- }
420
- } )
421
404
. filter ( |dep| {
422
405
// Filter out packages to prune.
423
406
match graph. node ( * * dep) {
@@ -441,7 +424,6 @@ fn print_dependencies<'a>(
441
424
prefix,
442
425
no_dedupe,
443
426
max_display_depth,
444
- no_proc_macro,
445
427
visited_deps,
446
428
levels_continue,
447
429
print_stack,
Original file line number Diff line number Diff line change @@ -1134,14 +1134,7 @@ dupe-dep v2.0.0
1134
1134
. run ( ) ;
1135
1135
1136
1136
p. cargo ( "tree --duplicates --edges no-proc-macro" )
1137
- . with_stdout (
1138
- "\
1139
- dupe-dep v1.0.0
1140
-
1141
- dupe-dep v2.0.0
1142
- └── foo v0.1.0 ([..]/foo)
1143
- " ,
1144
- )
1137
+ . with_stdout ( "" )
1145
1138
. run ( ) ;
1146
1139
}
1147
1140
@@ -1600,8 +1593,6 @@ somedep v1.0.0
1600
1593
"\
1601
1594
somedep v1.0.0
1602
1595
└── foo v0.1.0 ([..]/foo)
1603
-
1604
- somedep v1.0.0
1605
1596
" ,
1606
1597
)
1607
1598
. run ( ) ;
You can’t perform that action at this time.
0 commit comments