File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,51 @@ error: usage of an `unsafe` block
306
306
. run ( ) ;
307
307
}
308
308
309
+ #[ cargo_test]
310
+ fn workspace_cant_be_false ( ) {
311
+ let foo = project ( )
312
+ . file (
313
+ "Cargo.toml" ,
314
+ r#"
315
+ [package]
316
+ name = "foo"
317
+ version = "0.0.1"
318
+ authors = []
319
+
320
+ [lints]
321
+ workspace = false
322
+
323
+ [workspace.lints.rust]
324
+ "unsafe_code" = "deny"
325
+ "# ,
326
+ )
327
+ . file (
328
+ "src/lib.rs" ,
329
+ "
330
+ pub fn foo(num: i32) -> u32 {
331
+ unsafe { std::mem::transmute(num) }
332
+ }
333
+ " ,
334
+ )
335
+ . build ( ) ;
336
+
337
+ foo. cargo ( "check" )
338
+ . with_status ( 101 )
339
+ . with_stderr_contains (
340
+ "\
341
+ error: failed to parse manifest at `[CWD]/Cargo.toml`
342
+
343
+ Caused by:
344
+ TOML parse error at line 8, column 29
345
+ |
346
+ 8 | workspace = false
347
+ | ^^^^^
348
+ `workspace` cannot be false
349
+ " ,
350
+ )
351
+ . run ( ) ;
352
+ }
353
+
309
354
#[ cargo_test]
310
355
fn workspace_lint_deny ( ) {
311
356
let foo = project ( )
You can’t perform that action at this time.
0 commit comments