@@ -564,10 +564,14 @@ fn unexpected_cfgs_target() {
564
564
. file ( "c/src/lib.rs" , "" )
565
565
. build ( ) ;
566
566
567
- p. cargo ( "check -Zcheck-target-cfgs" )
567
+ p. cargo ( "check -Zcargo-lints - Zcheck-target-cfgs" )
568
568
. masquerade_as_nightly_cargo ( & [ "requires -Zcheck-target-cfgs" ] )
569
- // FIXME: We should warn on multiple cfgs
570
569
. with_stderr_data ( str![ [ r#"
570
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `foo` in `[target.'cfg(any(foo, all(bar)))'.dependencies]`
571
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `bar` in `[target.'cfg(any(foo, all(bar)))'.dependencies]`
572
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition value: `` for `windows = ""` in `[target.'cfg(not(windows = ""))'.dependencies]`
573
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition value: `zoo` for `unix = "zoo"` in `[target.'cfg(unix = "zoo")'.dependencies]`
574
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition value: `zoo` for `unix = "zoo"` in `[target.'cfg(unix = "zoo")'.dependencies]`
571
575
[LOCKING] 2 packages to latest compatible versions
572
576
[CHECKING] b v0.0.1 ([ROOT]/foo/b)
573
577
[CHECKING] a v0.0.1 ([ROOT]/foo)
@@ -614,10 +618,13 @@ fn unexpected_cfgs_target_with_lint() {
614
618
. file ( "b/src/lib.rs" , "" )
615
619
. build ( ) ;
616
620
617
- p. cargo ( "check -Zcheck-target-cfgs" )
621
+ p. cargo ( "check -Zcargo-lints - Zcheck-target-cfgs" )
618
622
. masquerade_as_nightly_cargo ( & [ "requires -Zcheck-target-cfgs" ] )
619
- // FIXME: We should warn on multiple cfgs
623
+ // FIXME: We should not warn on `cfg(foo = "foo")` but we currently do
620
624
. with_stderr_data ( str![ [ r#"
625
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `bar` in `[target.'cfg(bar)'.dependencies]`
626
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `foo` for `foo = "foo"` in `[target.'cfg(foo = "foo")'.dependencies]`
627
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `foo` in `[target.'cfg(foo)'.dependencies]`
621
628
[LOCKING] 1 package to latest compatible version
622
629
[CHECKING] a v0.0.1 ([ROOT]/foo)
623
630
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -650,10 +657,11 @@ fn unexpected_cfgs_target_lint_level_allow() {
650
657
. file ( "b/src/lib.rs" , "" )
651
658
. build ( ) ;
652
659
653
- p. cargo ( "check -Zcheck-target-cfgs" )
660
+ p. cargo ( "check -Zcargo-lints - Zcheck-target-cfgs" )
654
661
. masquerade_as_nightly_cargo ( & [ "requires -Zcheck-target-cfgs" ] )
655
- // FIXME: We should warn on multiple cfgs
662
+ // FIXME: We shouldn't warn any target cfgs because of the level="allow"
656
663
. with_stderr_data ( str![ [ r#"
664
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `foo` in `[target.'cfg(foo)'.dependencies]`
657
665
[LOCKING] 1 package to latest compatible version
658
666
[CHECKING] a v0.0.1 ([ROOT]/foo)
659
667
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -686,9 +694,10 @@ fn unexpected_cfgs_target_lint_level_deny() {
686
694
. file ( "b/src/lib.rs" , "" )
687
695
. build ( ) ;
688
696
689
- p. cargo ( "check -Zcheck-target-cfgs" )
697
+ p. cargo ( "check -Zcargo-lints - Zcheck-target-cfgs" )
690
698
. masquerade_as_nightly_cargo ( & [ "requires -Zcheck-target-cfgs" ] )
691
699
. with_stderr_data ( str![ [ r#"
700
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `foo` in `[target.'cfg(foo)'.dependencies]`
692
701
[LOCKING] 1 package to latest compatible version
693
702
[CHECKING] a v0.0.1 ([ROOT]/foo)
694
703
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -724,9 +733,11 @@ fn unexpected_cfgs_target_cfg_any() {
724
733
. file ( "b/src/lib.rs" , "" )
725
734
. build ( ) ;
726
735
727
- p. cargo ( "check -Zcheck-target-cfgs" )
736
+ p. cargo ( "check -Zcargo-lints - Zcheck-target-cfgs" )
728
737
. masquerade_as_nightly_cargo ( & [ "requires -Zcheck-target-cfgs" ] )
738
+ // FIXME: We shouldn't be linting `cfg(foo)` because of the `cfg(any())`
729
739
. with_stderr_data ( str![ [ r#"
740
+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `foo` in `[target.'cfg(foo)'.dependencies]`
730
741
[LOCKING] 1 package to latest compatible version
731
742
[CHECKING] a v0.0.1 ([ROOT]/foo)
732
743
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
0 commit comments