aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_project_model
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_project_model')
-rw-r--r--crates/ra_project_model/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs
index a4d117e34..8b8663a78 100644
--- a/crates/ra_project_model/src/lib.rs
+++ b/crates/ra_project_model/src/lib.rs
@@ -320,6 +320,14 @@ fn find_cargo_toml(path: &Path) -> Result<PathBuf> {
320pub fn get_rustc_cfg_options() -> CfgOptions { 320pub fn get_rustc_cfg_options() -> CfgOptions {
321 let mut cfg_options = CfgOptions::default(); 321 let mut cfg_options = CfgOptions::default();
322 322
323 // Some nightly-only cfgs, which are required for stdlib
324 {
325 cfg_options.insert_atom("target_thread_local".into());
326 for &target_has_atomic in ["16", "32", "64", "8", "cas", "ptr"].iter() {
327 cfg_options.insert_key_value("target_has_atomic".into(), target_has_atomic.into())
328 }
329 }
330
323 match (|| -> Result<_> { 331 match (|| -> Result<_> {
324 // `cfg(test)` and `cfg(debug_assertion)` are handled outside, so we suppress them here. 332 // `cfg(test)` and `cfg(debug_assertion)` are handled outside, so we suppress them here.
325 let output = Command::new("rustc").args(&["--print", "cfg", "-O"]).output()?; 333 let output = Command::new("rustc").args(&["--print", "cfg", "-O"]).output()?;