@@ -280,8 +280,8 @@ pub struct Target {
280280    pub  ranlib :  Option < PathBuf > , 
281281    pub  linker :  Option < PathBuf > , 
282282    pub  ndk :  Option < PathBuf > , 
283-     pub  sanitizers :  bool , 
284-     pub  profiler :  bool , 
283+     pub  sanitizers :  Option < bool > , 
284+     pub  profiler :  Option < bool > , 
285285    pub  crt_static :  Option < bool > , 
286286    pub  musl_root :  Option < PathBuf > , 
287287    pub  musl_libdir :  Option < PathBuf > , 
@@ -896,8 +896,8 @@ impl Config {
896896                target. musl_libdir  = cfg. musl_libdir . map ( PathBuf :: from) ; 
897897                target. wasi_root  = cfg. wasi_root . map ( PathBuf :: from) ; 
898898                target. qemu_rootfs  = cfg. qemu_rootfs . map ( PathBuf :: from) ; 
899-                 target. sanitizers  = cfg. sanitizers . unwrap_or ( build . sanitizers . unwrap_or_default ( ) ) ; 
900-                 target. profiler  = cfg. profiler . unwrap_or ( build . profiler . unwrap_or_default ( ) ) ; 
899+                 target. sanitizers  = cfg. sanitizers ; 
900+                 target. profiler  = cfg. profiler ; 
901901
902902                config. target_config . insert ( TargetSelection :: from_user ( & triple) ,  target) ; 
903903            } 
@@ -1008,19 +1008,19 @@ impl Config {
10081008    } 
10091009
10101010    pub  fn  sanitizers_enabled ( & self ,  target :  TargetSelection )  -> bool  { 
1011-         self . target_config . get ( & target) . map ( |t| t. sanitizers ) . unwrap_or ( self . sanitizers ) 
1011+         self . target_config . get ( & target) . map ( |t| t. sanitizers ) . flatten ( ) . unwrap_or ( self . sanitizers ) 
10121012    } 
10131013
10141014    pub  fn  any_sanitizers_enabled ( & self )  -> bool  { 
1015-         self . target_config . values ( ) . any ( |t| t. sanitizers )  || self . sanitizers 
1015+         self . target_config . values ( ) . any ( |t| t. sanitizers  ==  Some ( true ) )  || self . sanitizers 
10161016    } 
10171017
10181018    pub  fn  profiler_enabled ( & self ,  target :  TargetSelection )  -> bool  { 
1019-         self . target_config . get ( & target) . map ( |t| t. profiler ) . unwrap_or ( self . profiler ) 
1019+         self . target_config . get ( & target) . map ( |t| t. profiler ) . flatten ( ) . unwrap_or ( self . profiler ) 
10201020    } 
10211021
10221022    pub  fn  any_profiler_enabled ( & self )  -> bool  { 
1023-         self . target_config . values ( ) . any ( |t| t. profiler )  || self . profiler 
1023+         self . target_config . values ( ) . any ( |t| t. profiler  ==  Some ( true ) )  || self . profiler 
10241024    } 
10251025
10261026    pub  fn  llvm_enabled ( & self )  -> bool  { 
0 commit comments