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 {
349
349
let file_id = load ( & sysroot[ krate] . root ) ?;
350
350
351
351
// 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 ( ) ;
357
353
358
354
let env = Env :: default ( ) ;
359
355
let extern_source = ExternSource :: default ( ) ;
@@ -404,7 +400,12 @@ impl ProjectWorkspace {
404
400
if let Some ( file_id) = load ( root) {
405
401
let edition = cargo[ pkg] . edition ;
406
402
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
+
408
409
for feature in cargo[ pkg] . features . iter ( ) {
409
410
opts. insert_key_value ( "feature" . into ( ) , feature. into ( ) ) ;
410
411
}
Original file line number Diff line number Diff line change @@ -151,7 +151,6 @@ pub(crate) fn load(
151
151
// FIXME: cfg options?
152
152
let default_cfg_options = {
153
153
let mut opts = get_rustc_cfg_options ( None ) ;
154
- opts. insert_atom ( "test" . into ( ) ) ;
155
154
opts. insert_atom ( "debug_assertion" . into ( ) ) ;
156
155
opts
157
156
} ;
Original file line number Diff line number Diff line change @@ -138,7 +138,6 @@ impl GlobalState {
138
138
// FIXME: Read default cfgs from config
139
139
let default_cfg_options = {
140
140
let mut opts = get_rustc_cfg_options ( config. cargo . target . as_ref ( ) ) ;
141
- opts. insert_atom ( "test" . into ( ) ) ;
142
141
opts. insert_atom ( "debug_assertion" . into ( ) ) ;
143
142
opts
144
143
} ;
You can’t perform that action at this time.
0 commit comments