File tree 1 file changed +43
-0
lines changed
1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -939,3 +939,46 @@ error: `im_a_teapot` is specified
939
939
)
940
940
. run ( ) ;
941
941
}
942
+
943
+ #[ cargo_test]
944
+ fn workspace_cargo_lints ( ) {
945
+ let p = project ( )
946
+ . file (
947
+ "Cargo.toml" ,
948
+ r#"
949
+ cargo-features = ["test-dummy-unstable"]
950
+
951
+ [workspace.lints.cargo]
952
+ im-a-teapot = { level = "warn", priority = 10 }
953
+ test-dummy-unstable = { level = "forbid", priority = -1 }
954
+
955
+ [package]
956
+ name = "foo"
957
+ version = "0.0.1"
958
+ edition = "2015"
959
+ authors = []
960
+ im-a-teapot = true
961
+
962
+ [lints]
963
+ workspace = true
964
+ "# ,
965
+ )
966
+ . file ( "src/lib.rs" , "" )
967
+ . build ( ) ;
968
+
969
+ p. cargo ( "check -Zcargo-lints" )
970
+ . masquerade_as_nightly_cargo ( & [ "cargo-lints" , "test-dummy-unstable" ] )
971
+ . with_status ( 101 )
972
+ . with_stderr (
973
+ "\
974
+ error: `im_a_teapot` is specified
975
+ --> Cargo.toml:13:1
976
+ |
977
+ 13 | im-a-teapot = true
978
+ | ^^^^^^^^^^^^^^^^^^
979
+ |
980
+ = note: `cargo::im_a_teapot` is set to `forbid`
981
+ " ,
982
+ )
983
+ . run ( ) ;
984
+ }
You can’t perform that action at this time.
0 commit comments