Skip to content

Commit 2654f29

Browse files
committed
fix: no-proc-macro is overridden by subsequent edges
1 parent 4fdd6ec commit 2654f29

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/bin/cargo/commands/tree.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,12 @@ fn parse_edge_kinds(
254254
|es| {
255255
es.flat_map(|e| e.split(','))
256256
.filter(|e| {
257-
no_proc_macro = *e == "no-proc-macro";
258-
!no_proc_macro
257+
if *e == "no-proc-macro" {
258+
no_proc_macro = true;
259+
false
260+
} else {
261+
true
262+
}
259263
})
260264
.collect()
261265
},

tests/testsuite/cargo_tree/deps.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,12 +2357,11 @@ foo v0.1.0 ([ROOT]/foo)
23572357
"#]])
23582358
.run();
23592359

2360-
// change flag order, no-proc-macro takes no effect if followed by other flags
2360+
// change flag order, expecting the same output
23612361
p.cargo("tree -e no-proc-macro,normal")
23622362
.with_stdout_data(str![[r#"
23632363
foo v0.1.0 ([ROOT]/foo)
2364-
├── dep v1.0.0
2365-
└── pm v1.0.0 (proc-macro)
2364+
└── dep v1.0.0
23662365
23672366
"#]])
23682367
.run();

0 commit comments

Comments
 (0)