File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -2652,3 +2652,43 @@ fn dep_with_optional_host_deps_activated() {
2652
2652
)
2653
2653
. run ( ) ;
2654
2654
}
2655
+
2656
+ #[ cargo_test]
2657
+ fn dont_unify_proc_macro_example_from_dependency ( ) {
2658
+ // See https://github.com/rust-lang/cargo/issues/13726
2659
+ let p = project ( )
2660
+ . file (
2661
+ "Cargo.toml" ,
2662
+ r#"
2663
+ [package]
2664
+ name = "foo"
2665
+ edition = "2021"
2666
+
2667
+ [dependencies]
2668
+ pm_helper = { path = "pm_helper" }
2669
+ "# ,
2670
+ )
2671
+ . file ( "src/lib.rs" , "" )
2672
+ . file (
2673
+ "pm_helper/Cargo.toml" ,
2674
+ r#"
2675
+ [package]
2676
+ name = "pm_helper"
2677
+
2678
+ [[example]]
2679
+ name = "pm"
2680
+ proc-macro = true
2681
+ crate-type = ["proc-macro"]
2682
+ "# ,
2683
+ )
2684
+ . file ( "pm_helper/src/lib.rs" , "" )
2685
+ . file ( "pm_helper/examples/pm.rs" , "" )
2686
+ . build ( ) ;
2687
+
2688
+ p. cargo ( "check" )
2689
+ . with_status ( 101 )
2690
+ . with_stderr_contains (
2691
+ "[..]activated_features for invalid package: features did not find PackageId [..]pm_helper[..]NormalOrDev[..]"
2692
+ )
2693
+ . run ( ) ;
2694
+ }
You can’t perform that action at this time.
0 commit comments