File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -349,11 +349,7 @@ impl ProjectWorkspace {
349349 let file_id = load ( & sysroot[ krate] . root ) ?;
350350
351351 // Crates from sysroot have `cfg(test)` disabled
352- let cfg_options = {
353- let mut opts = default_cfg_options. clone ( ) ;
354- opts. remove_atom ( "test" ) ;
355- opts
356- } ;
352+ let cfg_options = default_cfg_options. clone ( ) ;
357353
358354 let env = Env :: default ( ) ;
359355 let extern_source = ExternSource :: default ( ) ;
@@ -404,7 +400,12 @@ impl ProjectWorkspace {
404400 if let Some ( file_id) = load ( root) {
405401 let edition = cargo[ pkg] . edition ;
406402 let cfg_options = {
407- let mut opts = default_cfg_options. clone ( ) ;
403+ let mut opts = {
404+ let mut opts = default_cfg_options. clone ( ) ;
405+ opts. insert_atom ( "test" . into ( ) ) ;
406+ opts
407+ } ;
408+
408409 for feature in cargo[ pkg] . features . iter ( ) {
409410 opts. insert_key_value ( "feature" . into ( ) , feature. into ( ) ) ;
410411 }
Original file line number Diff line number Diff line change @@ -151,7 +151,6 @@ pub(crate) fn load(
151151 // FIXME: cfg options?
152152 let default_cfg_options = {
153153 let mut opts = get_rustc_cfg_options ( None ) ;
154- opts. insert_atom ( "test" . into ( ) ) ;
155154 opts. insert_atom ( "debug_assertion" . into ( ) ) ;
156155 opts
157156 } ;
Original file line number Diff line number Diff line change @@ -138,7 +138,6 @@ impl GlobalState {
138138 // FIXME: Read default cfgs from config
139139 let default_cfg_options = {
140140 let mut opts = get_rustc_cfg_options ( config. cargo . target . as_ref ( ) ) ;
141- opts. insert_atom ( "test" . into ( ) ) ;
142141 opts. insert_atom ( "debug_assertion" . into ( ) ) ;
143142 opts
144143 } ;
You can’t perform that action at this time.
0 commit comments