aboutsummaryrefslogtreecommitdiff
path: root/crates/project_model/src/workspace.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/project_model/src/workspace.rs')
-rw-r--r--crates/project_model/src/workspace.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs
index 2fcd0f8fa..84c702fdf 100644
--- a/crates/project_model/src/workspace.rs
+++ b/crates/project_model/src/workspace.rs
@@ -143,7 +143,8 @@ impl ProjectWorkspace {
143 } else { 143 } else {
144 None 144 None
145 }; 145 };
146 let rustc_cfg = rustc_cfg::get(config.target.as_deref()); 146
147 let rustc_cfg = rustc_cfg::get(Some(&cargo_toml), config.target.as_deref());
147 ProjectWorkspace::Cargo { cargo, sysroot, rustc, rustc_cfg } 148 ProjectWorkspace::Cargo { cargo, sysroot, rustc, rustc_cfg }
148 } 149 }
149 }; 150 };
@@ -159,7 +160,7 @@ impl ProjectWorkspace {
159 Some(path) => Some(Sysroot::load(path)?), 160 Some(path) => Some(Sysroot::load(path)?),
160 None => None, 161 None => None,
161 }; 162 };
162 let rustc_cfg = rustc_cfg::get(target); 163 let rustc_cfg = rustc_cfg::get(None, target);
163 Ok(ProjectWorkspace::Json { project: project_json, sysroot, rustc_cfg }) 164 Ok(ProjectWorkspace::Json { project: project_json, sysroot, rustc_cfg })
164 } 165 }
165 166
@@ -310,7 +311,7 @@ fn project_json_to_crate_graph(
310 311
311 let target_cfgs = match krate.target.as_deref() { 312 let target_cfgs = match krate.target.as_deref() {
312 Some(target) => { 313 Some(target) => {
313 cfg_cache.entry(target).or_insert_with(|| rustc_cfg::get(Some(target))) 314 cfg_cache.entry(target).or_insert_with(|| rustc_cfg::get(None, Some(target)))
314 } 315 }
315 None => &rustc_cfg, 316 None => &rustc_cfg,
316 }; 317 };