@@ -756,14 +756,14 @@ fn cargo_lints_nightly_required() {
756
756
. file (
757
757
"Cargo.toml" ,
758
758
r#"
759
- [package]
760
- name = "foo"
761
- version = "0.0.1"
762
- edition = "2015"
763
- authors = []
764
-
765
- [lints.cargo]
766
- "unused-features" = "deny "
759
+ [package]
760
+ name = "foo"
761
+ version = "0.0.1"
762
+ edition = "2015"
763
+ authors = []
764
+
765
+ [lints.cargo]
766
+ im-a-teapot = "warn "
767
767
"# ,
768
768
)
769
769
. file ( "src/lib.rs" , "" )
@@ -790,21 +790,24 @@ fn cargo_lints_no_z_flag() {
790
790
. file (
791
791
"Cargo.toml" ,
792
792
r#"
793
- [package]
794
- name = "foo"
795
- version = "0.0.1"
796
- edition = "2015"
797
- authors = []
793
+ cargo-features = ["test-dummy-unstable"]
794
+
795
+ [package]
796
+ name = "foo"
797
+ version = "0.0.1"
798
+ edition = "2015"
799
+ authors = []
800
+ im-a-teapot = true
798
801
799
- [lints.cargo]
800
- "unused-features" = "deny "
802
+ [lints.cargo]
803
+ im-a-teapot = "warn "
801
804
"# ,
802
805
)
803
806
. file ( "src/lib.rs" , "" )
804
807
. build ( ) ;
805
808
806
809
foo. cargo ( "check" )
807
- . masquerade_as_nightly_cargo ( & [ "-Zcargo- lints" ] )
810
+ . masquerade_as_nightly_cargo ( & [ "cargo- lints" , "test-dummy-unstable "] )
808
811
. with_stderr (
809
812
"\
810
813
[WARNING] unused manifest key `lints.cargo` (may be supported in a future version)
@@ -819,27 +822,37 @@ consider passing `-Zcargo-lints` to enable this feature.
819
822
820
823
#[ cargo_test]
821
824
fn cargo_lints_success ( ) {
822
- let foo = project ( )
825
+ let p = project ( )
823
826
. file (
824
827
"Cargo.toml" ,
825
828
r#"
826
- [package]
827
- name = "foo"
828
- version = "0.0.1"
829
- edition = "2015"
830
- authors = []
829
+ cargo-features = ["test-dummy-unstable"]
830
+
831
+ [package]
832
+ name = "foo"
833
+ version = "0.0.1"
834
+ edition = "2015"
835
+ authors = []
836
+ im-a-teapot = true
831
837
832
- [lints.cargo]
833
- "unused-features" = "deny "
838
+ [lints.cargo]
839
+ im-a-teapot = "warn "
834
840
"# ,
835
841
)
836
842
. file ( "src/lib.rs" , "" )
837
843
. build ( ) ;
838
844
839
- foo . cargo ( "check -Zcargo-lints" )
840
- . masquerade_as_nightly_cargo ( & [ "-Zcargo- lints" ] )
845
+ p . cargo ( "check -Zcargo-lints" )
846
+ . masquerade_as_nightly_cargo ( & [ "cargo- lints" , "test-dummy-unstable "] )
841
847
. with_stderr (
842
848
"\
849
+ warning: `im_a_teapot` is specified
850
+ --> Cargo.toml:9:1
851
+ |
852
+ 9 | im-a-teapot = true
853
+ | ------------------
854
+ |
855
+ = note: `cargo::im_a_teapot` is set to `warn`
843
856
[CHECKING] foo v0.0.1 ([CWD])
844
857
[FINISHED] [..]
845
858
" ,
@@ -849,40 +862,37 @@ fn cargo_lints_success() {
849
862
850
863
#[ cargo_test]
851
864
fn cargo_lints_underscore_supported ( ) {
852
- Package :: new ( "bar" , "0.1.0" ) . publish ( ) ;
853
865
let foo = project ( )
854
866
. file (
855
867
"Cargo.toml" ,
856
868
r#"
857
- [package]
858
- name = "foo"
859
- version = "0.0.1"
860
- edition = "2021"
861
- authors = []
869
+ cargo-features = ["test-dummy-unstable"]
862
870
863
- [lints.cargo]
864
- "implicit_features" = "warn"
871
+ [package]
872
+ name = "foo"
873
+ version = "0.0.1"
874
+ edition = "2015"
875
+ authors = []
876
+ im-a-teapot = true
865
877
866
- [dependencies ]
867
- bar = { version = "0.1.0", optional = true }
878
+ [lints.cargo ]
879
+ im_a_teapot = "warn"
868
880
"# ,
869
881
)
870
882
. file ( "src/lib.rs" , "" )
871
883
. build ( ) ;
872
884
873
885
foo. cargo ( "check -Zcargo-lints" )
874
- . masquerade_as_nightly_cargo ( & [ "-Zcargo- lints" ] )
886
+ . masquerade_as_nightly_cargo ( & [ "cargo- lints" , "test-dummy-unstable "] )
875
887
. with_stderr (
876
888
"\
877
- warning: implicit features for optional dependencies is deprecated and will be unavailable in the 2024 edition
878
- --> Cargo.toml:12:17
879
- |
880
- 12 | bar = { version = \" 0.1.0\" , optional = true }
881
- | ---
882
- |
883
- = note: `cargo::implicit_features` is set to `warn`
884
- [UPDATING] `dummy-registry` index
885
- [LOCKING] [..]
889
+ warning: `im_a_teapot` is specified
890
+ --> Cargo.toml:9:1
891
+ |
892
+ 9 | im-a-teapot = true
893
+ | ------------------
894
+ |
895
+ = note: `cargo::im_a_teapot` is set to `warn`
886
896
[CHECKING] foo v0.0.1 ([CWD])
887
897
[FINISHED] [..]
888
898
" ,
0 commit comments