@@ -564,10 +564,14 @@ fn unexpected_cfgs_target() {
564564 . file ( "c/src/lib.rs" , "" )
565565 . build ( ) ;
566566
567- p. cargo ( "check -Zcheck-target-cfgs" )
567+ p. cargo ( "check -Zcargo-lints - Zcheck-target-cfgs" )
568568 . masquerade_as_nightly_cargo ( & [ "requires -Zcheck-target-cfgs" ] )
569- // FIXME: We should warn on multiple cfgs
570569 . 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]`
571575[LOCKING] 2 packages to latest compatible versions
572576[CHECKING] b v0.0.1 ([ROOT]/foo/b)
573577[CHECKING] a v0.0.1 ([ROOT]/foo)
@@ -614,10 +618,13 @@ fn unexpected_cfgs_target_with_lint() {
614618 . file ( "b/src/lib.rs" , "" )
615619 . build ( ) ;
616620
617- p. cargo ( "check -Zcheck-target-cfgs" )
621+ p. cargo ( "check -Zcargo-lints - Zcheck-target-cfgs" )
618622 . 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
620624 . 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]`
621628[LOCKING] 1 package to latest compatible version
622629[CHECKING] a v0.0.1 ([ROOT]/foo)
623630[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -650,10 +657,11 @@ fn unexpected_cfgs_target_lint_level_allow() {
650657 . file ( "b/src/lib.rs" , "" )
651658 . build ( ) ;
652659
653- p. cargo ( "check -Zcheck-target-cfgs" )
660+ p. cargo ( "check -Zcargo-lints - Zcheck-target-cfgs" )
654661 . 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"
656663 . with_stderr_data ( str![ [ r#"
664+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `foo` in `[target.'cfg(foo)'.dependencies]`
657665[LOCKING] 1 package to latest compatible version
658666[CHECKING] a v0.0.1 ([ROOT]/foo)
659667[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -686,9 +694,10 @@ fn unexpected_cfgs_target_lint_level_deny() {
686694 . file ( "b/src/lib.rs" , "" )
687695 . build ( ) ;
688696
689- p. cargo ( "check -Zcheck-target-cfgs" )
697+ p. cargo ( "check -Zcargo-lints - Zcheck-target-cfgs" )
690698 . masquerade_as_nightly_cargo ( & [ "requires -Zcheck-target-cfgs" ] )
691699 . with_stderr_data ( str![ [ r#"
700+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `foo` in `[target.'cfg(foo)'.dependencies]`
692701[LOCKING] 1 package to latest compatible version
693702[CHECKING] a v0.0.1 ([ROOT]/foo)
694703[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -724,9 +733,11 @@ fn unexpected_cfgs_target_cfg_any() {
724733 . file ( "b/src/lib.rs" , "" )
725734 . build ( ) ;
726735
727- p. cargo ( "check -Zcheck-target-cfgs" )
736+ p. cargo ( "check -Zcargo-lints - Zcheck-target-cfgs" )
728737 . masquerade_as_nightly_cargo ( & [ "requires -Zcheck-target-cfgs" ] )
738+ // FIXME: We shouldn't be linting `cfg(foo)` because of the `cfg(any())`
729739 . with_stderr_data ( str![ [ r#"
740+ [WARNING] [ROOT]/foo/Cargo.toml: unexpected `cfg` condition name: `foo` in `[target.'cfg(foo)'.dependencies]`
730741[LOCKING] 1 package to latest compatible version
731742[CHECKING] a v0.0.1 ([ROOT]/foo)
732743[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
0 commit comments