File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -655,6 +655,16 @@ impl TomlProfile {
655
655
}
656
656
}
657
657
658
+ if let Some ( StringOrBool :: String ( arg) ) = & self . lto {
659
+ if arg == "true" || arg == "false" {
660
+ bail ! (
661
+ "`lto` setting of string `\" {arg}\" ` for `{name}` profile is not \
662
+ a valid setting, must be a boolean (`true`/`false`) or a string \
663
+ (`\" thin\" `/`\" fat\" `/`\" off\" `) or omitted.",
664
+ ) ;
665
+ }
666
+ }
667
+
658
668
Ok ( ( ) )
659
669
}
660
670
Original file line number Diff line number Diff line change @@ -323,6 +323,37 @@ fn profile_in_virtual_manifest_works() {
323
323
. run ( ) ;
324
324
}
325
325
326
+ #[ cargo_test]
327
+ fn profile_lto_string_bool_dev ( ) {
328
+ let p = project ( )
329
+ . file (
330
+ "Cargo.toml" ,
331
+ r#"
332
+ [package]
333
+ name = "foo"
334
+ version = "0.0.1"
335
+
336
+ [profile.dev]
337
+ lto = "true"
338
+ "# ,
339
+ )
340
+ . file ( "src/lib.rs" , "" )
341
+ . build ( ) ;
342
+
343
+ p. cargo ( "build" )
344
+ . with_status ( 101 )
345
+ . with_stderr (
346
+ "\
347
+ error: failed to parse manifest at `[ROOT]/foo/Cargo.toml`
348
+
349
+ Caused by:
350
+ `lto` setting of string `\" true\" ` for `dev` profile is not a valid setting, \
351
+ must be a boolean (`true`/`false`) or a string (`\" thin\" `/`\" fat\" `/`\" off\" `) or omitted.
352
+ " ,
353
+ )
354
+ . run ( ) ;
355
+ }
356
+
326
357
#[ cargo_test]
327
358
fn profile_panic_test_bench ( ) {
328
359
let p = project ( )
You can’t perform that action at this time.
0 commit comments