@@ -571,12 +571,10 @@ config_data! {
571
571
/// avoid checking unnecessary things.
572
572
cargo_buildScripts_useRustcWrapper: bool = true ,
573
573
/// List of cfg options to enable with the given values.
574
- cargo_cfgs: FxHashMap <String , Option <String >> = {
575
- let mut m = FxHashMap :: default ( ) ;
576
- m. insert( "debug_assertions" . to_owned( ) , None ) ;
577
- m. insert( "miri" . to_owned( ) , None ) ;
578
- m
579
- } ,
574
+ cargo_cfgs: Vec <String > = {
575
+ vec![ "debug_assertion" . into( ) , "miri" . into( ) ]
576
+ }
577
+ ,
580
578
/// Extra arguments that are passed to every cargo invocation.
581
579
cargo_extraArgs: Vec <String > = vec![ ] ,
582
580
/// Extra environment variables that will be set when running cargo, rustc
@@ -1944,6 +1942,17 @@ impl Config {
1944
1942
global : CfgDiff :: new (
1945
1943
self . cargo_cfgs ( source_root)
1946
1944
. iter ( )
1945
+ // parse any cfg setting formatted as key=value
1946
+ . map ( |s| {
1947
+ let mut sp = s. splitn ( 2 , "=" ) ;
1948
+ let key = sp. next ( ) ;
1949
+ let val = sp. next ( ) ;
1950
+ ( key, val)
1951
+ } )
1952
+ // we filter out anything with a None key
1953
+ . filter ( |( key, _) | key. is_some ( ) )
1954
+ // unwrap cannot panic here as we are sure key is Some
1955
+ . map ( |( key, val) | ( key. unwrap ( ) , val) )
1947
1956
. map ( |( key, val) | match val {
1948
1957
Some ( val) => CfgAtom :: KeyValue {
1949
1958
key : Symbol :: intern ( key) ,
0 commit comments