File tree 1 file changed +46
-0
lines changed
1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -824,3 +824,49 @@ fn config_features_and_build_script() {
824
824
. with_stderr_contains ( x ! ( "rustc" => "cfg" of "docsrs" ) ) // Cargo well known
825
825
. run ( ) ;
826
826
}
827
+
828
+ #[ cargo_test( >=1.79 , reason = "--check-cfg was stabilized in Rust 1.79" ) ]
829
+ fn config_fingerprint ( ) {
830
+ let p = project ( )
831
+ . file (
832
+ "Cargo.toml" ,
833
+ r#"
834
+ [package]
835
+ name = "foo"
836
+ version = "0.1.0"
837
+ edition = "2015"
838
+
839
+ [lints.rust]
840
+ unexpected_cfgs = { level = "warn", check-cfg = ["cfg(bar)"] }
841
+ "# ,
842
+ )
843
+ . file ( "src/lib.rs" , "fn entry() {}" )
844
+ . build ( ) ;
845
+
846
+ p. cargo ( "check -v" )
847
+ . with_stderr_contains ( x ! ( "rustc" => "cfg" of "bar" ) )
848
+ . run ( ) ;
849
+
850
+ p. cargo ( "check -v" )
851
+ . with_stderr_does_not_contain ( "[..]rustc[..]" )
852
+ . run ( ) ;
853
+
854
+ // checking that changing the `-check-cfg` config does not invalid the fingerprint
855
+ // FIXME: This should change the fingerprint
856
+ p. change_file (
857
+ "Cargo.toml" ,
858
+ r#"
859
+ [package]
860
+ name = "foo"
861
+ version = "0.1.0"
862
+ edition = "2015"
863
+
864
+ [lints.rust]
865
+ unexpected_cfgs = { level = "warn", check-cfg = ["cfg(bar)", "cfg(foo)"] }
866
+ "# ,
867
+ ) ;
868
+
869
+ p. cargo ( "check -v" )
870
+ . with_stderr_does_not_contain ( "[..]rustc[..]" )
871
+ . run ( ) ;
872
+ }
You can’t perform that action at this time.
0 commit comments