aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-10-08 12:43:29 +0100
committerAleksey Kladov <[email protected]>2019-10-08 12:43:29 +0100
commit857f419c9ded5ebeab428535729b57687499d3a6 (patch)
tree546ac4a3004026fa6a0ed07a4854fd41830e3202
parent972079c0e32ba6085eb5ba02a137a6df86b79b5a (diff)
hard-code nightly-only CFGs
-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()?;