mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
fix: no-proc-macro
is overridden by subsequent edges (#15764)
### What does this PR try to resolve? To close #15763. ### How to test and review this PR? See steps in #15763.
This commit is contained in:
commit
dfcf4c2cbd
@ -254,8 +254,12 @@ fn parse_edge_kinds(
|
||||
|es| {
|
||||
es.flat_map(|e| e.split(','))
|
||||
.filter(|e| {
|
||||
no_proc_macro = *e == "no-proc-macro";
|
||||
!no_proc_macro
|
||||
if *e == "no-proc-macro" {
|
||||
no_proc_macro = true;
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
},
|
||||
|
@ -2318,3 +2318,51 @@ foo v1.0.0 ([ROOT]/foo)
|
||||
"#]])
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn no_proc_macro_order() {
|
||||
Package::new("dep", "1.0.0").publish();
|
||||
Package::new("pm", "1.0.0").proc_macro(true).publish();
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
pm = "1.0"
|
||||
dep = "1.0"
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
p.cargo("tree")
|
||||
.with_stdout_data(str![[r#"
|
||||
foo v0.1.0 ([ROOT]/foo)
|
||||
├── dep v1.0.0
|
||||
└── pm v1.0.0 (proc-macro)
|
||||
|
||||
"#]])
|
||||
.run();
|
||||
|
||||
// no-proc-macro combined with other edge kinds
|
||||
p.cargo("tree -e normal,no-proc-macro")
|
||||
.with_stdout_data(str![[r#"
|
||||
foo v0.1.0 ([ROOT]/foo)
|
||||
└── dep v1.0.0
|
||||
|
||||
"#]])
|
||||
.run();
|
||||
|
||||
// change flag order, expecting the same output
|
||||
p.cargo("tree -e no-proc-macro,normal")
|
||||
.with_stdout_data(str![[r#"
|
||||
foo v0.1.0 ([ROOT]/foo)
|
||||
└── dep v1.0.0
|
||||
|
||||
"#]])
|
||||
.run();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user