@@ -96,15 +96,14 @@ pub struct Config {
96
96
pub rust_codegen_units : Option < u32 > ,
97
97
pub rust_codegen_units_std : Option < u32 > ,
98
98
pub rust_debug_assertions : bool ,
99
- pub rust_debuginfo : bool ,
100
- pub rust_debuginfo_lines : bool ,
101
- pub rust_debuginfo_only_std : bool ,
102
- pub rust_debuginfo_tools : bool ,
99
+ pub rust_debuginfo_level_rustc : u32 ,
100
+ pub rust_debuginfo_level_std : u32 ,
101
+ pub rust_debuginfo_level_tools : u32 ,
102
+ pub rust_debuginfo_level_tests : u32 ,
103
103
pub rust_rpath : bool ,
104
104
pub rustc_parallel : bool ,
105
105
pub rustc_default_linker : Option < String > ,
106
106
pub rust_optimize_tests : bool ,
107
- pub rust_debuginfo_tests : bool ,
108
107
pub rust_dist_src : bool ,
109
108
pub rust_codegen_backends : Vec < Interned < String > > ,
110
109
pub rust_codegen_backends_dir : String ,
@@ -300,18 +299,18 @@ struct Rust {
300
299
codegen_units : Option < u32 > ,
301
300
codegen_units_std : Option < u32 > ,
302
301
debug_assertions : Option < bool > ,
303
- debuginfo : Option < bool > ,
304
- debuginfo_lines : Option < bool > ,
305
- debuginfo_only_std : Option < bool > ,
306
- debuginfo_tools : Option < bool > ,
302
+ debuginfo_level : Option < u32 > ,
303
+ debuginfo_level_rustc : Option < u32 > ,
304
+ debuginfo_level_std : Option < u32 > ,
305
+ debuginfo_level_tools : Option < u32 > ,
306
+ debuginfo_level_tests : Option < u32 > ,
307
307
parallel_compiler : Option < bool > ,
308
308
backtrace : Option < bool > ,
309
309
default_linker : Option < String > ,
310
310
channel : Option < String > ,
311
311
musl_root : Option < String > ,
312
312
rpath : Option < bool > ,
313
313
optimize_tests : Option < bool > ,
314
- debuginfo_tests : Option < bool > ,
315
314
codegen_tests : Option < bool > ,
316
315
ignore_git : Option < bool > ,
317
316
debug : Option < bool > ,
@@ -495,12 +494,13 @@ impl Config {
495
494
// Store off these values as options because if they're not provided
496
495
// we'll infer default values for them later
497
496
let mut llvm_assertions = None ;
498
- let mut debuginfo_lines = None ;
499
- let mut debuginfo_only_std = None ;
500
- let mut debuginfo_tools = None ;
501
497
let mut debug = None ;
502
- let mut debuginfo = None ;
503
498
let mut debug_assertions = None ;
499
+ let mut debuginfo_level = None ;
500
+ let mut debuginfo_level_rustc = None ;
501
+ let mut debuginfo_level_std = None ;
502
+ let mut debuginfo_level_tools = None ;
503
+ let mut debuginfo_level_tests = None ;
504
504
let mut optimize = None ;
505
505
let mut ignore_git = None ;
506
506
@@ -540,14 +540,14 @@ impl Config {
540
540
if let Some ( ref rust) = toml. rust {
541
541
debug = rust. debug ;
542
542
debug_assertions = rust. debug_assertions ;
543
- debuginfo = rust. debuginfo ;
544
- debuginfo_lines = rust. debuginfo_lines ;
545
- debuginfo_only_std = rust. debuginfo_only_std ;
546
- debuginfo_tools = rust. debuginfo_tools ;
543
+ debuginfo_level = rust. debuginfo_level ;
544
+ debuginfo_level_rustc = rust. debuginfo_level_rustc ;
545
+ debuginfo_level_std = rust. debuginfo_level_std ;
546
+ debuginfo_level_tools = rust. debuginfo_level_tools ;
547
+ debuginfo_level_tests = rust. debuginfo_level_tests ;
547
548
optimize = rust. optimize ;
548
549
ignore_git = rust. ignore_git ;
549
550
set ( & mut config. rust_optimize_tests , rust. optimize_tests ) ;
550
- set ( & mut config. rust_debuginfo_tests , rust. debuginfo_tests ) ;
551
551
set ( & mut config. codegen_tests , rust. codegen_tests ) ;
552
552
set ( & mut config. rust_rpath , rust. rpath ) ;
553
553
set ( & mut config. jemalloc , rust. jemalloc ) ;
@@ -639,18 +639,19 @@ impl Config {
639
639
let default = true ;
640
640
config. rust_optimize = optimize. unwrap_or ( default) ;
641
641
642
- let default = match & config. channel [ ..] {
643
- "stable" | "beta" | "nightly" => true ,
644
- _ => false ,
645
- } ;
646
- config. rust_debuginfo_lines = debuginfo_lines. unwrap_or ( default) ;
647
- config. rust_debuginfo_only_std = debuginfo_only_std. unwrap_or ( default) ;
648
- config. rust_debuginfo_tools = debuginfo_tools. unwrap_or ( false ) ;
649
-
650
642
let default = debug == Some ( true ) ;
651
- config. rust_debuginfo = debuginfo. unwrap_or ( default) ;
652
643
config. rust_debug_assertions = debug_assertions. unwrap_or ( default) ;
653
644
645
+ let with_defaults = |debuginfo_level_specific : Option < u32 > | {
646
+ debuginfo_level_specific
647
+ . or ( debuginfo_level)
648
+ . unwrap_or ( if debug == Some ( true ) { 2 } else { 0 } )
649
+ } ;
650
+ config. rust_debuginfo_level_rustc = with_defaults ( debuginfo_level_rustc) ;
651
+ config. rust_debuginfo_level_std = with_defaults ( debuginfo_level_std) ;
652
+ config. rust_debuginfo_level_tools = with_defaults ( debuginfo_level_tools) ;
653
+ config. rust_debuginfo_level_tests = debuginfo_level_tests. unwrap_or ( 0 ) ;
654
+
654
655
let default = config. channel == "dev" ;
655
656
config. ignore_git = ignore_git. unwrap_or ( default) ;
656
657
0 commit comments